Quantcast
Classic wow warrior charge/stance change macro - WoWInterface
 
Thread Tools Display Modes
04-21-21, 02:27 PM   #1
add1ct1v3
A Defias Bandit
Join Date: Apr 2021
Posts: 2
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.
  Reply With Quote
04-21-21, 02:40 PM   #2
Kanegasi
A Molten Giant
 
Kanegasi's Avatar
AddOn Author - Click to view addons
Join Date: Apr 2007
Posts: 565
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
  Reply With Quote
04-21-21, 05:14 PM   #3
SDPhantom
A Pyroguard Emberseer
 
SDPhantom's Avatar
AddOn Author - Click to view addons
Join Date: Jul 2006
Posts: 2,032
Originally Posted by Kanegasi View Post
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".
__________________
ESOUI AddOns | WoWInterface AddOns
"All I want is a pretty girl, a decent meal, and the right to shoot lightning at fools."
-Anders (Dragon Age: Origins - Awakening)
  Reply With Quote
04-21-21, 03:16 PM   #4
add1ct1v3
A Defias Bandit
Join Date: Apr 2021
Posts: 2
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.

Last edited by add1ct1v3 : 04-21-21 at 03:21 PM.
  Reply With Quote

WoWInterface » AddOns, Compilations, Macros » Macro Help » Classic wow warrior charge/stance change macro

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off