Page 1 of 1

"Unravel" variables in /timed

Posted: Thu Sep 09, 2004 2:47 am
by Vaft
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.

Posted: Thu Sep 09, 2004 4:50 am
by Chill
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?

Posted: Thu Sep 09, 2004 3:35 pm
by Vaft
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.

Posted: Thu Sep 09, 2004 6:48 pm
by Rusty~
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 
    } 

Posted: Thu Sep 09, 2004 7:02 pm
by dman
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]}
    } 

Posted: Thu Sep 09, 2004 7:18 pm
by blueninja
Try this..

Code: Select all

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

Posted: Thu Sep 09, 2004 10:25 pm
by Vaft
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.

Posted: Thu Sep 09, 2004 11:12 pm
by Vaft
actually it just needed some tweaking :

Code: Select all

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

Posted: Fri Sep 10, 2004 8:28 pm
by motd2k
/dragonpunch