"Unravel" variables in /timed

Need help running MacroQuest2? Ask your questions about how to get things to work on your computer.

Moderator: MacroQuest Developers

Vaft
a lesser mummy
a lesser mummy
Posts: 69
Joined: Fri Mar 07, 2003 6:39 am

"Unravel" variables in /timed

Post by Vaft » Thu Sep 09, 2004 2:47 am

I have some code like this:

Code: Select all

/timed 240 /varset Quiescence[${lowhppc}] 0
What is going to happen there, is ${lowhppc} will be "unraveled" (sorry, the proper term for this is escaping me at the moment) in 24 seconds... The variable ${lowhppc} is very likely to change before the 24 second timed is triggered. So I would like for it to happen immediately, so that the command that REALLY gets sent to /timed would be something like this:

Code: Select all

/timed 240 /varset Quiescence[3] 0
Can we create some sort of solution for this? Because the only workaround I can think of for what I'm trying to do, is create 6 different variables for each group slot and add quite a few more /if statements.

Chill
Contributing Member
Contributing Member
Posts: 435
Joined: Fri May 07, 2004 5:06 pm
Location: Erie, PA

Post by Chill » Thu Sep 09, 2004 4:50 am

First, I think by "unraveled" you mean evaluated.

As for your question, I am not entirely sure what youre asking but if you want to capture the current value of ${lowhppc} and use it as the subscript 24 sec later, you might put it in a new variable before the timed statement:

Code: Select all

/varset quipc ${lowhppc}
/timed 240 /varset Quiescence[${quipc}] 0
you would, of course, have to declare the new variable somewhere up above.

If that doesnt do what you want, can you post the rest of the macro to give more of an idea of the context?

Vaft
a lesser mummy
a lesser mummy
Posts: 69
Joined: Fri Mar 07, 2003 6:39 am

Post by Vaft » Thu Sep 09, 2004 3:35 pm

Yeah, evaluated was the word I was trying to remember.. You understand exactly what my problem is, but making more variables is exactly what I was trying to avoid. And in your solution, nothing prevents the *new* variable from changing before the 24 seconds is over either. Here is an example:

Code: Select all

    /if (${lowesthp}<=75 && ${Me.SpellReady[Quiescence]}) {
      /if (${lowhppc}==1 && !${GrpHot1}) {
        /target pc ${Group[${lowhppc}].Name}
        /g Quiescence to --> ${Group[${lowhppc}].Name} <--
        /call Cast "Quiescence"
        /varset GrpHot1 1
        /timed 240 /varset GrpHot1 0
      }

      /if (${lowhppc}==2 && !${GrpHot2}) {
        /target pc ${Group[${lowhppc}].Name}
        /g Quiescence to --> ${Group[${lowhppc}].Name} <--
        /call Cast "Quiescence"
        /varset GrpHot2 1
        /timed 240 /varset GrpHot2 0
      }

      /if (${lowhppc}==3 && !${GrpHot3}) {
        /target pc ${Group[${lowhppc}].Name}
        /g Quiescence to --> ${Group[${lowhppc}].Name} <--
        /call Cast "Quiescence"
        /varset GrpHot3 1
        /timed 240 /varset GrpHot3 0
      }

      /if (${lowhppc}==4 && !${GrpHot4}) {
        /target pc ${Group[${lowhppc}].Name}
        /g Quiescence to --> ${Group[${lowhppc}].Name} <--
        /call Cast "Quiescence"
        /varset GrpHot4 1
        /timed 240 /varset GrpHot4 0
      }

      /if (${lowhppc}==5 && !${GrpHot5}) {
        /target pc ${Group[${lowhppc}].Name}
        /g Quiescence to --> ${Group[${lowhppc}].Name} <--
        /call Cast "Quiescence"
        /varset GrpHot5 1
        /timed 240 /varset GrpHot5 0
      }
    }
If I could force the variable to be evaluated immediately, then I could do somthing like:

Code: Select all

    /if (${lowesthp}<=75 && ${Me.SpellReady[Quiescence]} && !{HotArray[${lowhppc}]}) {
      /target pc ${Group[${lowhppc}].Name}
      /g Quiescence to --> ${Group[${lowhppc}].Name} <--
      /call Cast "Quiescence"
      /varset HotArray[${lowhppc}] 1
      /timed 240 /varset HotArray[${lowhppc}] 0
    }
Quite a bit smaller and simpler.

Rusty~
a hill giant
a hill giant
Posts: 244
Joined: Wed Apr 14, 2004 2:55 pm

Post by Rusty~ » Thu Sep 09, 2004 6:48 pm

i don't see why you couldn't use timers for this. example:

Code: Select all

    /if (${lowesthp}<=75 && ${Me.SpellReady[Quiescence]} && !${HotTimer${lowhppc}}) { 
      /target pc ${Group[${lowhppc}].Name} 
      /g Quiescence to --> ${Group[${lowhppc}].Name} <-- 
      /call Cast "Quiescence" 
      /varset HotTimer${lowhppc} 240 
    } 

dman
a hill giant
a hill giant
Posts: 181
Joined: Fri Dec 05, 2003 12:54 pm

Post by dman » Thu Sep 09, 2004 7:02 pm

While it isn't using timed, maybe something like this would do the trick as well and not mess with /timed at all.

Code: Select all

    /if (${lowesthp}<=75 && ${Me.SpellReady[Quiescence]} && (${Macro.Running}>=${HotArray[${lowhppc}]})) { 
      /target pc ${Group[${lowhppc}].Name} 
      /g Quiescence to --> ${Group[${lowhppc}].Name} <-- 
      /call Cast "Quiescence" 
      /varset HotArray[${lowhppc}] ${Math.Calc[${Macro.Running}+24]}
    } 

User avatar
blueninja
a grimling bloodguard
a grimling bloodguard
Posts: 541
Joined: Thu Aug 28, 2003 7:03 am
Location: Göteborg, Sweden

Post by blueninja » Thu Sep 09, 2004 7:18 pm

Try this..

Code: Select all

	/declare Command string local
	/varset Command /varset HotArray[${lowhppc}] 0
	/timed 240 /docommand ${Command}

Vaft
a lesser mummy
a lesser mummy
Posts: 69
Joined: Fri Mar 07, 2003 6:39 am

Post by Vaft » Thu Sep 09, 2004 10:25 pm

Thanks guys. I dont think your method will work ninja, but I'll test and see. Looks like it would suffer the same problem as the original method I posted.

Vaft
a lesser mummy
a lesser mummy
Posts: 69
Joined: Fri Mar 07, 2003 6:39 am

Post by Vaft » Thu Sep 09, 2004 11:12 pm

actually it just needed some tweaking :

Code: Select all

/varset command /timed 240 /varset GrpHot[${lowhppc}] 0
/docommand ${command}

motd2k
a ghoul
a ghoul
Posts: 141
Joined: Fri Oct 25, 2002 9:46 am

Post by motd2k » Fri Sep 10, 2004 8:28 pm

/dragonpunch