Navigation menu
Personal tools
Not logged in
Talk
Contributions
Create account
Log in
Namespaces
WoW
Talk
English
Views
Read
Edit
History
More
Search
Navigation
Home
Random page
Help using wiki
Editions
for WoW
for WildStar
for Solar2D
Documentation
for WoW
for WildStar
Reference
WoW
⦁ FrameXML
⦁ AddOns
⦁ API
⦁ WoW Lua
WildStar
⦁ AddOns
⦁ API
⦁ WildStar Lua
Engine
Tools
What links here
Related changes
Special pages
Page information
Site
Recent Changes
Editing
WoW:API and scripting quirks
(section)
Jump to navigation
Jump to search
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
== World of Warcraft Scripting Quirks == * [[Macros]] ** Can only cast spells from a hotkey or mouse click ** [[Macros]] cannot cast spells on a delay ** /cast only works in [[Macros]] ** only one spell or action can be triggered per button press * [[Slash Command]] ** Can be use single in the Text Mode ** Can be used in [[Macros]] * [[Frames]] ** OnUpdate handlers are only called when the frame is visible. ** OnUpdate handles are called ''every'' frame. Use with care. ** When nesting frames, you can access the parent frame name in XML names with $parent, this is a textual substitution and cannot be used in Lua. The Lua equivalent to $parent is the GetParent() method of the frame (e.g. getglobal(Frame:GetParent():GetName().."Button") is the same as $parentButton). ** All [[Frames]] have a GetID() function which will obtain the ID specified in the XML. ID's must be positive integers enclosed in quotes: ie. id="1" or id="20" ** If you don't specify parent="UIParent" in your top-level frames, your frames won't be scaled according to the currently active UI scale. This can lead to some hair-pulling as you try to figure out why your fonts are so huge. (But, in some cases, not having that scaling might be desirable.) ** If you get no error output, but your addon is simply not being loaded, make sure you don't have a syntax error in your .xml file. A simple way to ensure that your xml is well-formed is to open it in Firefox; it will point out any XML structure errors to you. You can also check the contents of your Logs directory for errors. * Output to the outside world ** The only file output allowed is when the UI engine saves variables before it exits or reloads. Addons use the "<tt>## [[SavedVariables]]:</tt>" header to indicate which data they wish to save. * [[World of Warcraft API|Functions]] ** x,y = GetCursorPosition(); will return the current position of the mouse '''with respect to the object it currently is in'''. This means x will be 0 if the mouse is at the left edge of a frame or button, regardless of where that frame or button is. ** x,y = GetCursorPosition(UIParent); will return the current position of the mouse with respect to the entire UI. This can be considered the absolute position.. * [[ChatFrame]] ** Trying to send colored text to other players will cause your client to disconnect. Not sure if Blizz's server is forcing the disconnect, or my client. *** Example: /tell Name |cFF00FF00Hello|r. The EditBox will show the text in green after replacing "||" with "|". Pressing enter to send the info to the server chat channel results in the following: **** "|r" causes the disconnect, **** "|c" doesn't have the same problem, but will cause the text after it not to show. * Variables ** If you declare a local variable inside an code block (such as an IF block), it is only available inside that code block. ** See [[Lua Scope]] for a complete description of the implications of Lua's variable scoping. [[Category:Interface customization]]
Summary:
Please note that all contributions to AddOn Studio are considered to be released under the Creative Commons Attribution-NonCommercial-ShareAlike (see
AddOn Studio Wiki:Copyrights
for details).
Submissions must be written by you, or copied from a public domain or similar free resource (see
AddOn Studio Wiki:Copyrights
for details).
Cancel
Editing help
(opens in new window)