wow classic pvp macro

  •  warrior

 

 

How to write to a file in wow addon

来源网址:  https://us.battle.net/forums/en/wow/topic/20043655806

 

 

 

World of Warcraft
Forums
UI and Macro
Can an addon write to a log file?
The World of Warcraft community forums have moved!
These forums are in read-only mode. Please visit the new World of Warcraft community forums at https://us.forums.blizzard.com/en/wow

Can an addon write to a log file?
UI AND MACRO

Cold
<God Tier>
110 Human Mage
11030
3138 posts
Dec 12, 2015
Does wow allow addons to write data to a txt file for example?

Gello
<Underhill>
100 Gnome Priest
16605
4654 posts
Dec 12, 2015
Not directly. All file i/o is removed from addons.

However, an addon can tag a variable to be saved in the SavedVariables folder under the addon’s name. An addon can tag it to save in a global file or a per-character file.

And this variable can record stuff over time to create a log. (It’s how addons can keep track of stuff over time)

While this file can’t be forced into a format immediately recognizable to an outside program (unless it reads lua files), there may be an ODBC written up for doing this to convert to Access or maybe a csv for Excel or something.

Cold
<God Tier>
110 Human Mage
11030
3138 posts
Dec 12, 2015
Any chance you could link me to what you are talking about?

Every page I looked at has a common theme: Blizzard won’t allow io because of bots.

Never even heard a mention about what you just said.

Gello
<Underhill>
100 Gnome Priest
16605
4654 posts
Dec 12, 2015
I don’t know if this would qualify as a link for this intended purpose but:
http://wow.gamepedia.com/Saving_variables_between_game_sessions

It’s easier to explain by example. Create the two files named in bold in a folder called TargetLog under AddOns:

TargetLog.toc
## Interface: 60200
## Title: TargetLog
## Notes: Uses SavedVariables to log targets across multiple sessions
## SavedVariables: TargetLogData
TargetLog.lua

TargetLog.lua
TargetLogData = {} — initial value (will be overwritten when/if SavedVariables load)
local f = CreateFrame(“Frame”)
f:SetScript(“OnEvent”,function(self)
if UnitExists(“target”) then
local name = UnitName(“target”)
local level = UnitLevel(“target”)
local health = UnitHealthMax(“target”)
— adds date/time,name,level,health of target to TargetLogData
tinsert(TargetLogData,format(“%s,%s,%s,%s”,date(),name,level,health))
end
end)
f:RegisterEvent(“PLAYER_TARGET_CHANGED”)

The next time you log in, as you target stuff, it gathers a few bits of info about your target and adds it to a table (TargetLogData). This data will accumulate across sessions (the purpose of SavedVariables is to keep stuff between sessions).

Note the ## SavedVariables: TargetLogData in the .toc. This is where you tag a variable to save. Then the addon itself fills the variable (almost always a table) with stuff.

Now when you logout or reload (and ONLY when you logout or reload–addons can’t control when this stuff writes beyond forcing a /reload which a user is generally not going to want while they play), the contents of TargetLogData is saved to the file WTF\Account\%accountname%\SavedVariables\TargetLog.lua. This is a text file that looks like:

TargetLogData = {
“12/12/15 00:19:57,Lunarfall Infantry,100,195708”, — [1]
“12/12/15 00:19:59,Muradin Bronzebeard,100,29356200”, — [2]
“12/12/15 00:20:02,Deedree,90,17503”, — [3]
“12/12/15 00:20:05,Captain Towix,100,97854”, — [4]
“12/12/15 00:20:06,Officer Jeor,100,97854”, — [5]
“12/12/15 00:20:08,Alliance Sailor,100,1467810”, — [6]
“12/12/15 00:20:09,Lieutenant Thorn,94,63226”, — [7]
“12/12/15 00:20:11,Shield Captain Chien,100,97854”, — [8]
“12/12/15 00:20:13,Sentinel Dawnshadow,100,97854”, — [9]
“12/12/15 00:20:15,Ro,100,385260”, — [10]
“12/12/15 00:20:18,Lunarfall Infantry,100,195708”, — [11]
“12/12/15 00:20:19,Porter,2,50”, — [12]
“12/12/15 00:20:22,Seer Kazal,100,97854”, — [13]
“12/12/15 00:20:24,Aenir,90,14002”, — [14]
“12/12/15 00:20:25,Squiggy,90,35006”, — [15]
“12/12/15 00:20:27,Rooter the Ravenous,100,146781”, — [16]
“12/12/15 00:20:28,Lio the Lioness,98,65312”, — [17]
“12/12/15 00:20:29,Quintessence of Light,25,788”, — [18]
}

This is a lua table of the data saved. When you log in later, part of the addon loading process is to run any existing SavedVariables files, so the table you saved on last logout is created with previous data on next login.

That is the complete and total extent that addons are allowed to write files.

An addon cannot change the structure of this file. The table name and syntax (table = { stuff, stuff, stuff, etc }) is there so it can be run. An addon has no control over this. The game creates it for its own purpose and makes no accomidation for outside programs to read it. If they ever change the structure of this file it would probably be to encrypt it so outside programs can’t use it.

To use it as a log for an outside program would require massaging this text to remove the syntax stuff to get a CSV or whatever format you choose. And it’s important to remember that this stuff only writes on a logout/reload. They don’t want it writing in realtime to prevent outside programs from learning about what’s going on in the game.

Cold
<God Tier>
110 Human Mage
11030
3138 posts
Dec 12, 2015
Thanks!
Join the Conversation
Have something to say? Log in to join the conversation.
Thanks for visiting the Blizzard Forums (3.8.2) · Patch Notes
CAREERSABOUTSUPPORTCONTACT USPRESSAPI
©2019 BLIZZARD ENTERTAINMENT, INC. ALL RIGHTS RESERVED.
All trademarks referenced herein are the properties of their respective owners.
PRIVACYLEGALTERMSCOOKIES
en-US

How classic addon spy find nearby pl ?

  • 所有注册的事件:

 

  • 关键函数

function Spy:ShowAlert(type, name, source, location)   in  MainWindow.lua

function Spy:AlertProwlPlayer(player)                                   in  List.lua

function Spy:CombatLogEvent(…)                                            in Spy.lua


判断 level :  用这个函数

function Spy:ParseUnitAbility(analyseSpell, event, player, flags, spellId, spellName)                                  In :   List.lua

 

  • 启动顺序

在 spy.xml 的 OnUpdate 事件中: 指定了当update发生时的执行函数

之后执行到 Spy.lua 的:

GameTooltipTextLeft1 这个是 wow 自带函数 ,功能是 :  Google GameTooltipTextLeft1  或者 GameTooltipTextLeft1  函数

用法例子:

To see it’s effects try this:

GameTooltipTextLeft1:SetAlphaGradient(0,40)
Now, view any tooltip. You will see the text on the first line of the tooltip fade out as it approaches 40 pixels from the left. To set the tooltip back use:

GameTooltipTextLeft1:SetAlphaGradient(0,0)

 

skill or need addon inplement skill

  • given all enemy within X range a  level one tong ,   by priest
  • when multi pull , remberber use an’tu’su’er ‘s  hand  as main hand weapon
  • charge and intercept use just one key

改为更简洁的:  change stance use another key

  • the spell of warrior which not cause public cooldown
  • conditional cast

conditional

 

How to write an auto-fish scripts for wow classic

  • 建立python 虚拟环境

查看当前python 版本 :  python –version

查看 32bit还是 64bit, 方法是

 

  • 依次安装       numpy  (数学库) :  pip install numpy

matplotlib  (坐标图)  :  pip install matplotlib

opencv-python  (图像识别) :  pip install opencv-python

pyscreenshot  (截屏) : pip install pyscreenshot

pillow  (这个库是替代旧的 image库) : pip install Pillow

autopy (模拟按键)

  • 尝试安装 pip install win32gui , 但不能安装 ,32和64版本都不行,因为 win32gui 只有python 3.6 版本

重新装python 3.6.7

在安装win32gui之后,还要安装 pywin32 

安装完成后, 执行这个脚本测试一下:

方法是先执行, 在新建一个notepad , 然后让 notepad 获得焦点, 会每2秒打字一个 “1”

但是, 这是对 notepad的键盘模拟, 对 wow能不能一样, 待测试。

  • 试试能不能截屏 :

  • 找 bobber (或者叫 float )的方法:

 

 

  • How to know if fish ready

 

  • How to filter loot , for example only keep black mouth

use addon :   EasyLoot

 

  • 参考文章:

https://github.com/YECHEZ/wow-fish-bot  

这个新一些


https://github.com/kioltk/wow-fishipy

这个方法比较旧, 但是opencv用的好

 

 

 

 

  • 参考文章 :  https://www.reddit.com/r/learnpython/comments/22tke1/use_python_to_send_keystrokes_to_games_in_windows/

same purpose with me


https://github.com/kioltk/wow-fishipy/blob/master/fishing.py

主要是学这个


https://github.com/FrontMage/wowAutoFishing

图像识别找 bubble , 声音确定点右键的时机

 

  • 已有的bot :

https://www.ownedcore.com/forums/wow-classic/wow-classic-bots-programs/799510-vanillabuddy-fishbot-support-thread.html

还不知道是什么功能

此外 youtube 也有很多classic fish bot的视频,不知真假

 

 

how to write a new wow classic addon from beginning

  • classic api is base on V 8.1.0 ,

it full reference is here :

The Classic API is based on the 8.1.0 api but then half stripped down. The changes are available here, including for widgets, events, CVars and enums.

Diff: https://github.com/Ketho/BlizzardInterfaceResources/commit/dfe14662c6aeef9a968daf1609b8b8327e610622

API: https://github.com/Ketho/BlizzardInterfaceResources/blob/classic/Resources/GlobalAPI.lua

Wowpedia: https://wow.gamepedia.com/Patch_1.13.2/API_changes

 

正文部分 :

WoW Addon Writing Guide Part One: How to make your first addon
By GalacticGlum Last updated 2019/05/09 at 3:10 PM View Changelog

WoW Addon Writing Guide Part 1 5.4.2+ : How to make your fist Addon
I make gaming videos and make coding tutorials on my YouTube channel! I’m also going to be making a video version of this guide very soon! My YouTube channel is http://youtube.com/galacticglum/
Introduction:
In This Guide you will learn how to write a basic “Hello World” addon and a Basic “Level Up” Congratulation addon in the Programming Language LUA at the end of this guide you should have a completely working addon and basic understanding of what you need to write an addon and what you need to know
*If you want to download a Sample version of this addon for the source code there is a link at the bottom of the guide*
What you will need:
1. Notepad ++ (This is a Free code editor) ** There are different programs like Eclipse IDE, but for this tutorial we will be using Notepad ++ **
Link: http://notepad-plus-plus.org/
2. Basic Computer Knowledge (Just Basic Computer Skills, You need to know how to operate a Computer *you managed to get to this guide so you are good to go*)
3. A WoW Account (For testing purposes)
Tips Before we start:
Remember this guide is for people who don’t know Programming

After this guide you might want to go read and watch some basic LUA tutorials and guides
*There will be links for LUA tutorials at the bottom of the guide*

Remember this can be used on different versions you just need to do a couple different stuff which I explain in the guide
Setting Up
So first and for most you are going to want to download Notepad ++ and install it.
You are also going to want to get the current Interface number. There are numerous of ways of doing this.
Here are a couple of ways.The Best Way is to go on WoW and run this script
/run print((select(4, GetBuildInfo())));
**Thank you Funda for telling me about this script**

You could also steal the Interface number from an updated WoW addon in the TOC File but a simpler way would
be to just Google it (EX. Wow 5.4.2 Interface number) and you should find the Interface number one way or another. The version 5.4.2 Interface number is 50400 but this changes from a version to version. After you obtain the interface number and install Notepad ++ you are going to want to locate your WoW installation folder it is either in C:\Program Files or C:\Program Files (X86) and then go to your Interface Folder inside the WoW installation folder and then into your addon folder inside the interface folder. Inside the addon folder you are going to make a new folder called “HelloWorld” this folder will store all of your addon files so before making the folder make sure you are in this file path:

C:\Program Files\World of Warcraft\_retail_\Interface\Addon\

That is the file path you should have now this is how it should look at the top after you make the
HelloWorld Folder:

C:\Program Files\World of Warcraft\_retail_\Interface\Addon\HelloWorld
Writing Our .TOC File (Table of Contents File)
The TOC File is the first file WoW goes to look to find info about your addon so it is very important to not mess the TOC file up.
The first thing you are going to want to do is to create a new text document and name it HelloWorld you are then going to open it in regular notepad and save it as HelloWorld.toc and save it as all file types. You are now going to see a text document and a .toc file in your folder delete the HelloWorld text document but keep your HelloWorld.toc file. Now open the HelloWorld.toc file in Notepad ++ and paste this code:

## Interface: (Your Interface number)
## Title: (Name of your Addon)
## Author: (Your name here)
## Version: (Version of your Addon)
Copy that and change it to your info
This is how my TOC would look like:

## Interface: 50400
## Title: Hello World
## Author: Shon Verch
## Version: 0.1
Click file in the top left hand side of the Notepad ++ tool-bar and click save
Call this file HelloWorld and if it asks you to overwrite HelloWorld.toc file say yes.
Writing the “HelloWorld” Script
Of course we need to write a script because you can’t make a addon do something before you tell it to do something. So you are going to make a new text document called “main” and open it in Notepad ++ you are then going to paste or type this code:

message(‘HelloWorld’)
Of course you can make this message bigger for example:

message(‘Hi how are you I am good what up’)
But for the sake of this tutorial we are just going to write in the message HelloWorld
After you write in the code you are going to click file in the left hand side of the tool-bar and click save as
You are going to save it as a LUA file so just name it main.lua and it should automatically recognize the .LUA extension.
Now go to your .toc file and type in the main.lua file under your .toc it should look like this:

## Interface: 50400
## Title: Hello World
## Author: Shon Verch
## Version: 0.1

main.lua
The reason you need to put the name of the file there is because WoW needs to know what files to run everytime you run the addon
Now open up your WoW and enable the addon to enable addons on your character selection screen in the bottom left hand side of your screen there should be a button that says addon on it. Click on that and you should see HelloWorld on the list if you have no other addons except the addon you just made press enable all at the bottom the window on the addon screen. If you have more addon just go to the HelloWorld Addon and tick the check-box beside the addon name your addon name should be in yellow if it is in red then that means it is outdated and your interface number is not the correct one for the version.
This is how the addon window looks like:

That is how the addon window should look like.
Now select a character and when you log on you should have a box that says HelloWorld like this:

Hooray it worked
Now you made your first addon but we are not done yet!
A Little More Advanced
Now that we made our first addon the Hello world addon its time to add a Level up Congratulatory feature that congratulates you every time you level up
First make a new text document called “lvup” open this file in Notepad ++ and first insert this line of code:

local Congrats_EventFrame = CreateFrame(“Frame”)
What this code is doing is creating a frame it is also using a local variable versus a bigger variable so it does not interfere with other WoW codes. Next up you are going to want to insert this line of code:

Congrats_EventFrame:RegisterEvent(“PLAYER_LEVEL_UP”)
What this is doing is registering the event that when you level up something happens
So far your new .LUA file should look like this

local Congrats_EventFrame = CreateFrame(“Frame”)
Congrats_EventFrame:RegisterEvent(“PLAYER_LEVEL_UP”)
Now we are going to set the script for the level up congratulation system. To set the script you insert this code:

Congrats_EventFrame:SetScript(“OnEvent”,
This is setting the script for the text message it displays when you level up now we are going to make a function to recognize we levelled up to do this insert this code:

function(self, event, …)
Your .LUA file should look like this:

local Congrats_EventFrame = CreateFrame(“Frame”)
Congrats_EventFrame:RegisterEvent(“PLAYER_LEVEL_UP”)
Congrats_EventFrame:SetScript(“OnEvent”,
function(self, event, …)
Now we are going to use the local variable again we are also going to makeing the level up recognizer that the Addon will run to check if you levelled up just insert this code:

local arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9 = …
Your code should look like this now:

local Congrats_EventFrame = CreateFrame(“Frame”)
Congrats_EventFrame:RegisterEvent(“PLAYER_LEVEL_UP”)
Congrats_EventFrame:SetScript(“OnEvent”,
function(self, event, …)
local arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9 = …
Now we are going to actually right what the message is and who to display to insert this code:

print(Congratulations on reaching level ‘ ..arg1.. ‘, ‘ .. UnitName(“Player”).. ‘! You gained ‘ ..arg2.. ‘ HP and ‘ ..arg3.. ‘ MP!’)
Write a customized message so when you level up you know that the addon worked. Write something WoW Automatically would never say.

your code should now look like this:

local Congrats_EventFrame = CreateFrame(“Frame”)
Congrats_EventFrame:RegisterEvent(“PLAYER_LEVEL_UP”)
Congrats_EventFrame:SetScript(“OnEvent”,
function(self, event, …)
local arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9 = …
print(Congratulations on reaching level ‘ ..arg1.. ‘, ‘ .. UnitName(“Player”).. ‘! You gained ‘ ..arg2.. ‘ HP and ‘ ..arg3.. ‘ MP!’)
end)
now go to file and click save as and save it as:

lvup.lua

Notepad ++ will automatically make it a .lua file if you add the .lua at the end of your name
go back to your .toc file and add lvup.lua to your .toc it should look like this:

## Interface: 50400
## Title: Hello World
## Author: Shon Verch
## Version: 0.1

lvup.lua
main.lua
your .toc file should look like this but with your name and version and all that.
Conclusion
In this guide I taught you how to make a simple addon that Congratulates you when you level up and that says HelloWorld when you log in if you want to disable the HelloWorld popup every time you log in then go to your .toc file and erase main.lua it should look like this:

## Interface: 50400
## Title: Hello World
## Author: Shon Verch
## Version: 0.1

lvup.lua
Thank you for reading and hope you can make a new revolutionary addon
LUA Guide and Video Links:
1. http://www.youtube.com/watch?v=dA9tcPeZa8k
2. http://www.lua.org/pil/1.html
3. http://www.wowwiki.com/Portal:Interface_customization
4. http://wowprogramming.com/
5. http://www.mmo-champion.com/threads/817817-Creating-Your-Own-WoW-Addon
6. http://www.codeproject.com/Articles/284961/A-Simple-World-of-Warcraft-Addon-using-Lua
7.http://www.phailed.me/2011/02/learn-lua-the-hard-way-1/

There are more just search it up on Google
Addon Source Code Download Link
Download: https://www.mediafire.com/?q3v1opqicrvb1a8
Extra Stuff
Have Fun Coding 😀

Guide by WoWlover123

I wrote this guide when I was 12, I am now 14 as of 4/14/2015

I’m currently working on a 2D ORPG called The Five Heroes and I would love for you guys to support me.
Also check out this video tutorial I made teaching you how to program in VB.NET
https://www.youtube.com/watch?v=BwXjsVgBJ9U

Official game website: http://www.tfh.altervista.org/
Official game forums: http://www.thefiveheroes.4umotion.com/

 

 

  • api 函数大全

 

  • 能不能从macro 调用 scripts  ,  或者从 lua script 调用 python  function

因为 script 不允许 condition cast , 因为这会让 blizzard觉得是 AI make decision ,  如果允许, 就会衍生出各种 onekey addon , 最终就是 bot ,

例如 vanilla 版本的  AutoRogue

 

但是 这样是允许的:

但是如果把 SendChatMessage  改为 cast X   就不行

如何绕过这一点 ?  python有一个库是发送 模拟键盘消息的, 如果能从 lua script 调用 ,并实现按下一个按键 ,  是否就可是实现 cast

 

  • simple code

Registers which events the object would like to monitor.

success = frame:RegisterEvent(“event”)
Arguments
event
string – The name of the event to register the object as monitoring.
Returns
success
boolean – Returns true if the event was successfully registered, false if (already) registered.
Example
The snippet below creates a frame, registers it for the CHAT_MSG_YELL event, and sets an OnEvent handler that would print a message whenever that event fires — whenever you hear someone /yell.


关于 frame register event 的更详细解释

→ API events
Contents[show]
← Event API
Events are messages sent by the WoW client to UI code (OnEvent script handlers of Frame derivatives), mostly in reaction to things occurring in the game world. To process events, an addon needs to create an event handler and register it for the events it wishes to receive.

Setting up an event handler Edit
Events are sent to Frame-derived widgets; an add-on needs to create a frame if it does not already own one that can be used for the purpose of handling events. Frames may be created in Lua using the CreateFrame function; or constructed in XML (using the <Frame> tag).

Once a frame has been created, its OnEvent handler must be set to a function that would handle the event on behalf of the addon. The OnEvent script handler may be set using the Lua frame:SetScript() function; or constructed in XML (using <Scripts><OnEvent>function body</OnEvent></Scripts>). The OnEvent handler function receives at least two arguments:

self, a reference to the frame to which the script handler belongs1
event, the name of the event being fired
The remaining event arguments are placed within the vararg exp/ression (…), as well as in the arg1-arg9 variables (the latter mechanic is deprecated and will be removed in Cataclysm[1]). You can extract variables from the vararg expression by simply assigning it to your local variables: local arg1, arg2, arg3 = …;
The addon’s OnEvent script handler function should either handle the event, or call another addon function to handle the event.

In order to receive event notifications, the event handler frame needs to be registered for events the addon needs to handle; use frame:RegisterEvent(“eventName”) to achieve this. The RegisterEvent function can be called at any time after the frame’s creation; the OnLoad script handler is a convenient location to register for the desired events when using XML.

If you no longer wish to receive event notifications for a particular event, use the frame:UnregisterEvent() function. If you wish to disable all event notifications currently delivered to a frame, use the frame:UnregisterAllEvents().

Examples Edit
Hello WorldEdit
The two implementations below are functionally identical: they print “Hello World! Hello PLAYER_ENTERING_WORLD” to the default chat frame when the character zones into the world. Note that the event variable is implicit in the XML OnEvent handler: it is supplied by the OnEvent closure signature.

Using XML

<Ui>
<Frame name=”FooAddonFrame”>
<Scripts>
<OnLoad> self:RegisterEvent(“PLAYER_ENTERING_WORLD”); </OnLoad>
<OnEvent> print(“Hello World! Hello ” .. event); </OnEvent>
</Scripts>
</Frame>
</Ui>
Using Lua

local frame = CreateFrame(“FRAME”, “FooAddonFrame”);
frame:RegisterEvent(“PLAYER_ENTERING_WORLD”);
local function eventHandler(self, event, …)
print(“Hello World! Hello ” .. event);
end
frame:SetScript(“OnEvent”, eventHandler);
XML-Specific Edit
You may bind an already declared Lua function to the OnEvent handler in XML directly, rather than creating another function by providing a function body within the <OnEvent></OnEvent> tags. Doing so will save you memory:

FooAddOn.lua

function FooHandler_OnEvent(self, event, …)
— insert event handling code here
end
FooAddOn.xml

<Ui>
<Script file=”FooAddon.lua”/>
<Frame name=”FooHandler”>
<Scripts>
<OnEvent function=”FooHandler_OnEvent”/>
</Scripts>
</Frame>
</Ui>
Lua-specific Edit
If your frame registers a large number of events, you could reduce the required number of if clauses, and generally simplify your design by doing:

local frame, events = CreateFrame(“Frame”), {};
function events:PLAYER_ENTERING_WORLD(…)
— handle PLAYER_ENTERING_WORLD here
end
function events:PLAYER_LEAVING_WORLD(…)
— handle PLAYER_LEAVING_WORLD here
end
frame:SetScript(“OnEvent”, function(self, event, …)
events[event](self, …); — call one of the functions above
end);
for k, v in pairs(events) do
frame:RegisterEvent(k); — Register all events for which handlers have been defined
end
Note that in the case of the events:XXX functions above, the variable self, implicitly defined by using the function table:functionName notation, will point to the frame handling the event rather than the events table.

The vararg expression Edit
The vararg expression (…) may contain additional arguments supplied by the event. Arguments contained in … can be read by simply assigning them to other variables, possibly using the select function to skip forward to a specific argument in the list.

Consider the example of handling COMBAT_LOG_EVENT:

function eventHandler(self, event, …)
if event == “COMBAT_LOG_EVENT” then
local timestamp, combatEvent, sourceGUID, sourceName, sourceFlags, destGUID, destName, destFlags =
…; — Those arguments appear for all combat event variants.
local eventPrefix, eventSuffix = combatEvent:match(“^(.-)_?([^_]*)$”);
if eventSuffix == “DAMAGE” then
— Something dealt damage. The last 9 arguments in … describe how it was dealt.
— To extract those, we can use the select function:
local amount, overkill, school, resisted, blocked, absorbed, critical, glancing, crushing =
select(select(“#”, …)-8, …); — select(“#”, …) returns number of arguments in the vararg expression
— Do something with the damage details …
if eventPrefix == “RANGE” or eventPrefix:match(“^SPELL”) then
— The first three arguments after destFlags in … describe the spell or ability dealing damage.
— Extract this data using select as well:
local spellId, spellName, spellSchool = select(9, …); — Everything from 9th argument in … onward
— Do something with the spell details …
end
end
end
end
Notes Edit
The global this, event, and argX variables are being removed in Cataclysm[1]. Instead, use the arguments passed to the OnEvent script handler.
Relevant API Edit
CreateFrame(“widgetType”[, “name”[, parent[, “inherits”]]])
frame:SetScript(“handlerType”, func)
frame:HookScript(“handlerType”, func)
frame:RegisterEvent(“eventName”) (and possibly frame:RegisterAllEvents() )
frame:UnregisterEvent(“eventName”) (and possibly frame:UnregisterAllEvents() )
Events (API), a listing of events you may subscribe to.
References Edit
^ a b Preparing for Cataclysm
Categories:
Event APIAdd category
Community content is available under CC-BY-SA unless otherwise noted.

 

 

 

5 char multi boxing hotkey scripts and interface setting

 

Hotkeynet script 学习笔记

  • 窗口相关

a) 设置窗口别名 :

b) 改变窗口大小

 

  • movement

a)同步 movement

 


b) same key , not same movement  重要, 用来做出 formation , 和上一条同时使用可以在运动中保持 formation

 

 

 

 

 

  • action

all slaver char  have 2 actionbar , one use for solo , one use for team