WoWInterface

WoWInterface (https://www.wowinterface.com/forums/index.php)
-   Macro Help (https://www.wowinterface.com/forums/forumdisplay.php?f=140)
-   -   Classic wow warrior charge/stance change macro (https://www.wowinterface.com/forums/showthread.php?t=58702)

add1ct1v3 04-21-21 02:27 PM

Classic wow warrior charge/stance change macro
 
Hello,

I have 2 macros that I use on my warrior and they both require perfect range/timing otherwise they fail.
An example :

#showtooltip
/cast Charge
/cast Berserker Stance

The problem is that if the target is not in range and/or I spam it too soon, the "/cast Charge" will fail and it will move to the next one.
I want to know if there's a way to add a condition in between, a condition of any kind. Like "if cooldown => 1 then cast Berserker Stance". I am sure it cannot be that easy or how I present it because I just started into programing 2 months ago and I have no idea what so ever on how to write in Lua, although it looks really similar to python at some of the basic aspects.
Looking forward to some advice. Thank you very much.

Kanegasi 04-21-21 02:40 PM

As a disclaimer, WoW Classic uses the same macro system as main WoW.

There is no option in the macro system that allows checking for cooldowns. Macros aren't Lua, they're a simple set of conditions processed by a C function within WoW's UI. An arbitrary system made by Blizzard that's effectively just feeding a string into a parser. You won't be able to do anything related to casting in combat with Lua.

Concerning your specific issue, you can make a castsequence, but that would require two key presses.

Check out this old version of the Macro_conditionals article on Wowpedia:
https://wowpedia.fandom.com/wiki/Mac...?oldid=5632549

I'm linking an old version because someone completely gutted the article into a sterile environment of tables just listing conditionals, while this old version contains a ton of great explanations and examples to help you out.

You can also check out the Making_a_macro article:
https://wowpedia.fandom.com/wiki/Making_a_macro

add1ct1v3 04-21-21 03:16 PM

Hello and thank you for the info. I will take a look at that website and I will try to find something useful, but as I stated above, my knowledge about coding/scripting are minimal at best.
The "cooldown" condition was just an example, I just need something to use to condition it , if anything comes to mind. Like ... range maybe? or anything else. If anything comes to mind I would appreciate if you would spare the time to share it.
Thanks once more.

SDPhantom 04-21-21 05:14 PM

Quote:

Originally Posted by Kanegasi (Post 338957)
Macros aren't Lua, they're a simple set of conditions processed by a C function within WoW's UI. An arbitrary system made by Blizzard that's effectively just feeding a string into a parser.

Some clarification:

Yes, macros are fed into C code to run. The C code splits it into lines that are then fired back into the Lua environment using the EXECUTE_CHAT_LINE event. (See ChatFrame.lua)

The lines going through all the /cast commands actually do get run, but the block is in CastSpellByName()'s C code, not the macro "parser".


All times are GMT -6. The time now is 03:36 AM.

vBulletin © 2021, Jelsoft Enterprises Ltd
© 2004 - 2020 MMOUI