Page 1 of 1

Changing variables on the fly?

Posted: Thu Jun 03, 2004 11:28 am
by Diazepam
I don't have EQ handy atm, so I can't test this myself right now. I'm hoping one of you knows this off the top of your head.

I have a brain-dead cleric alt that I want to be part of a CH chain. Here's the code I have for the CH part now:

Code: Select all

#include SpellCast.inc 

Sub Main 
   /declare CastTime int outer
   /varset CastTime 126
   /echo Starting CH chain
   :HealLoop
   /call cast "Complete Heal" 
   /delay CastTime
   /goto :HealLoop 
/return
Real simple. At some point, though, I want to change CastTime in the script above (pushing it out to 160 or 180). If I created a hotkey that just had:

Code: Select all

/varset CastTime 160
...would hitting that hotkey while this macro was running change CastTime appropriately?

If not, can you think of easy ways to change a variable like this while the macro is running?

Posted: Thu Jun 03, 2004 11:53 am
by dman
That would work yes, although, in your code it should be.

Code: Select all

/delay ${CastTime}
You could also set up an event that looks for echoes to screen and use those to change the variable.

Posted: Thu Jun 03, 2004 12:42 pm
by s16z
Actually, if scoping is done right, it will not work. Change the declare to

Code: Select all

/declare CastTime int global
Of course you should also get rid of CastTime as a delcared variable sometime or MQ will complain.

Posted: Thu Jun 03, 2004 1:02 pm
by dman
The variable does not have to be global to change it while the macro is running.....