• Dear Guest,

    You're browsing our forum as a Guest meaning you can only see a portion of the forum in read-only mode.
    To view all forum nodes and be able to create threads/posts please register or log-in with your existing account.

    TwinStar team

HP consumable macro, need help

dbargteil

New Member
Joined
Jun 23, 2016
I'm trying to write a macro that will try to use a healthstone, followed by a whipper root tuber, followed by a health potion, but once it successfully uses one of them I want it to stop (i.e. if the healthstone was used, don't use the tuber or health pot). Since none of these trigger the GCD nor share cooldowns, a simple fall-through macro doesn't work. I thought I had solved the problem with the following.

Code:
/script x=GetActionCount(healthstoneSlot)
/script UseAction(healthstoneSlot)
/script y=GetActionCount(healthStoneSlot) if x-y==0 then x=GetActionCount(tuberSlot) UseAction(tuberSlot)...

etc. (it's possible this code isn't factored correctly, I haven't done WoW API stuff in a long time)

The problem is that GetActionCount evaluates before the UI updates the fact that I used the healthstone, i.e. x and y are always the same even if I did in fact use a healthstone in between.

Does anyone know how to make a such a macro or generally how to make a macro that can register changes in item count (whether from the inventory or the action bar)?
 
Code:
/script function co(t) if(GetActionCount(t)>0) then return 1 end end function cd(t) if(GetActionCooldown(t)==0) then return 1 end end x=co(healthstoneSlot) y=cd(healthstoneSlot) if (x and y) then UseAction(healthstoneSlot) else x=co(whipperrootSlot) y=cd(whipperrootSlot) if (x and y) then UseAction(whipperrootSlot) else x=co(healthpotSlot) y=cd(healthpotSlot) if (x and y) then UseAction(healthpotSlot) end end end

Threw this together on the fly so haven't tested it in game, but something like this should work.
 
Top Bottom