WoW:Macro FAQ: Difference between revisions

1,839 bytes removed ,  15 August 2023
m
Move page script moved page Macro FAQ to WoW:Macro FAQ without leaving a redirect
m (Move page script moved page Macro FAQ to WoW:Macro FAQ without leaving a redirect)
 
(13 intermediate revisions by 11 users not shown)
Line 1: Line 1:
This is the place to ask any questions about UI Customization. For [[Cosmos]]-specific questions, please see the [[Cosmos Questions]] page.
{{Macronav}}[[Image:questionmark-large.png|left]]
Frequent questions and answers for [[macro]]s.
{{Clrl}}


==Macros==
{{faqq}}How do I write a Macro?
{{faqa}}See the [[Macros]] page.


; Q) How do I write a Macro?
{{faqq}}How do I write a Macro to do XXXX?
: A) See the [[Macros]] page.
{{faqa}}Check the [[Most Used Macros]] to see if someone has already done something like this. Check the question below "What can't a macro do?" to see if its going to be impossible. If neither of these help, try asking on the [http://forums.worldofwarcraft.com/board.html?forumId=11114&sid=1 World of Warcraft UI & Macros Forum].


; Q) How do I write a Macro to do XXXX?
{{faqq}}What can't a macro do?
: A) Check the [[Most Used Macros]] to see if someone has already done something like this. Check the question below "What can't a macro do?" to see if its going to be impossible. If neither of these help, try asking on the [http://www.cosmosui/forums CosmosUI forums].
{{faqa}}A Macro cannot:
 
; Q) What can't a macro do?
: A) A Macro cannot:
<!-- anyone know how to indent this but still keep the bullets? -->
*Use more than 255 characters
*Call another macro
*Cast a spell/ability without you pressing a button
*Cast a spell/ability without you pressing a button
*Cast more than one spell/ability per button press
*Cast more than one spell/ability per button press, unless using an ability that isn't affected by global cooldown, like feign death or judgement.
*Insert a pause before activating a spell/ability
*Wait or pause before activating a spell/ability
*Target another player's pet automatically (you can only automatically target your own pet)
*Target another player's pet automatically (you can only automatically target your own pet)
*Output anything to file other than saved variables
*Output anything to file other than saved variables
*Use more than 255 characters
*Call another macro


; Q) So what can a macro do?
{{faqq}}So what can a macro do?
: A) You can call [[World of Warcraft API|any script command]] (/script ''ScriptFunction''), any standard WoW /command such as /say or /attack, and any additional /commands made available by the AddOns you've installed, for example if you install [[Cosmos]] you can use the [[Cosmos Slash Commands]]. If you need to write a long macro, write it as an AddOn in a lua file and bind it to a slash command, just like the Cosmos ones. See the section on Lua and XML for more details.
{{faqa}}You can call [[World of Warcraft API|any script command]] (/script ''ScriptFunction''), any standard WoW /command such as /say or /attack, and any additional /commands made available by the AddOns you've installed. (If you need to write a long macro, write it as an AddOn in a lua file and bind it to a slash command. See the section on Lua and XML for more details.)
 
; Q) What's the real deal with pauses?
: A) You can't use a pause before a spell or ability. However... you can kinda do pauses in certain ways. Firstly, the [[Cosmos]] [[Cosmos Slash Commands|slash commands]] includes a /in option. This will NOT work with spells or abilities, but works fine with chat commands. For example: "/in 5 /say Heal on the way!". You can also use certain script commands based on time, such as the movement commands. See the [[World of Warcraft API]] for more on those.
 
=AddOns=
 
This section needs a lot more help :)
 
==Basic Questions==
 
; Q) Where do I start if I want to write an AddOn?
: A) Try the [[WoW UI Customization Guide]] as a starting point.
 
;Q) Where do I start with these XML files?
:A) Try the [[XML User Interface]] guide - its full of useful information!
 
; Q) How do I reload my UI?
: A) Type /console reloadui or /script ReloadUI();
 
;Q) What is Lua?
:A) See the [[Lua]] page for some basic details.
 
;Q) How do I know what verion number to use in the .toc files?
:A) When you launch the game, it's listed in parenthesis after the version number (e.g. <tt>Version 1.2.1 (4150)</tt>. If you dont have access to the game you could check on the [http://forums.worldofwarcraft.com/board.aspx?forumName=wow-interface-customization WoW Interface Customization forum] or the [http://cosmosui.org/forums CosmosUI forums] for the latest information. Alternatively, use WinMPQ to read the .mpq files, check the Patch.MPQ file and lookup the number in Interface\FrameXML\FrameXML.toc


==Function Questions==
{{faqq}}What's the real deal with pauses?
{{faqa}}You can't use a pause before a spell or ability. However... you can use certain script commands based on time, such as debug or movement commands.


;Q) Why doesn't [[API UnitDebuff|UnitDebuff]] accurately report the spell I just cast?
For example, the following script command inserted between other /commands will temporarily freeze all game input/output for the duration specified.  
:A) There is a ~0.5 second gap between the end of a spell being cast and its associated debuff texture showing up on the unit upon which it was cast. This gap causes problems for "Smart Cast" scripts which try to prevent a spell like Immolate from being run when the target already has the debuff on it. If there is a pause between casting, the script would work; however, if the script is triggered rapidly then it is likely to try to cast Immolate twice (since it does not yet see the debuff on the target unit). The workaround for this problem is to subscribe to the SPELLCAST_STOP event. Every time that event is triggered, store the [[API GetTime|current time]] in a variable. From then on, whenever you subtract the [[API GetTime|current time]] from the stored time of the last SPELLCAST_STOP event, you get the time (in seconds) since the last spell stopped. If that time is greater than 0.5, you can proceed to cast your spell. If not, do not cast your spell. Note: this is not an issue for instant cast spells (their debuffs seem to be immediately noticeable), therefore it would be inefficient to do this check on them.


==Questions on Specific AddOns==
''Where 500 is equal to a 0.5 second delay (250=0.25sec, 1000=1sec, 10000=10sec, etc.)''
/script debugprofilestart();while debugprofilestop()<500 do end;


===Census===
Though this technique does effectively pause your macro for the desired interval, there is a downside.
* ''Where can I get the census mod seperately?''
The game-freezing pause this script causes can be an unsettling and undesired side-effect for some players. The freeze can prevent the player from perceiving the visual results of the /command immediately preceding this script. So depending on the duration you specify, the greater the pause, the more background action you will miss.  
*:[http://www.pieragostini.com/ian/fun/wow/mods/Census.htm Here]
This effect is strictly local and does not impact the game server or other players in any way. Though you may partially or entirely miss the results, you ''can'' be assured that the preceding /command ''is'' in actuality transmitted to the server and executed before the localized freeze takes place.
*:[http://www.warcraftrealms.com/censusplus.php And updated version here]
* ''Where can I see information on other server's Census data?''
*:[http://www.warcraftrealms.com Warcraft Realms]


===Thottbot===
See the [[World of Warcraft API]] for more on time based script commands.


----
== See also ==
Go to [[Cosmos Questions]]<br>
* [[UI FAQ/Macros and Scripts]]
Go to [[Interface Customization]]<br>
* [[Most used macros]]
Go to [[Cosmos]]<br>
[[Category:FAQs]]
[[Category:Macros]]
Anonymous user