Replacement for AltAbilityReady?

Need some help with that macro you're working on or aren't quite sure how to get your macro to do something? Ask here!

Moderator: MacroQuest Developers

TheAFKBard
a ghoul
a ghoul
Posts: 133
Joined: Tue Dec 30, 2003 9:48 pm

Replacement for AltAbilityReady?

Post by TheAFKBard » Sun Jul 18, 2004 4:20 pm

A key feature of a macro I'm using is firing off boastful bellow every time it comes up (18 sec). I used to use /if (${Me.AltAbilityReady[Boastful Bellow]}) /alt activate 199
What I want to do is have a sub called every 18 seconds regardless of what else is going on in the macro to call this function. Or any other determination of the readiness of this ability. I could just have the macro turboclick, but it's spammy.

Me.Name
a lesser mummy
a lesser mummy
Posts: 56
Joined: Thu Mar 11, 2004 11:49 pm
Location: ${Me.Bound}

Post by Me.Name » Sun Jul 18, 2004 4:57 pm

Just as a temporary fix. Here is a quick idea, assuming your ability timer is constant. I'm just using pseudocode here:

Code: Select all

Sub Main
    set abilityTimer = current time + refresh delay for ability
    :loop
    if (current time > abilityTimer) {
        do ability
        set abilityTimer = current time + refresh delay for ability
    }
    do other stuff
    /goto :loop
/return
This just saves the time when your ability should be ready again and checks in each loop if that time has passed. If it has, it triggers ability and saves time for next occurance.

Of course this will break if you trigger ability manually, but this will hit your ability after refresh delay and allow macro to do other stuff. You could have multiple variables and "if"s for other abilities too.

I'm assuming your macro needs to do other things otherwise you could just use /delay 18s

TheAFKBard
a ghoul
a ghoul
Posts: 133
Joined: Tue Dec 30, 2003 9:48 pm

Post by TheAFKBard » Mon Jul 19, 2004 12:20 am

Here's how I went about fixing it

Code: Select all

/if (!${Target.ID}) {
/squelch /target npc radius 250
/alt activate 199}
dumb, but works

zanomo
a hill giant
a hill giant
Posts: 285
Joined: Thu Jun 24, 2004 11:21 pm

Post by zanomo » Mon Jul 19, 2004 2:01 am

In addition, you can use timer:

Code: Select all

Sub Main
| Setting the timer to 18.5 sec just in case
/declare ALT199Timer  timer     outer  185

:Mainloop
.
.
/if (!{ALT199Timer}) {
    /alt activate 199
    /varset ALT199Timer 185
}
.
.
/return