Plazmic - Timer help please

A forum for feature requests/discussions and user submitted patches that improve MQ2

Moderator: MacroQuest Developers

LordGiddion
a snow griffon
a snow griffon
Posts: 352
Joined: Sat Sep 13, 2003 6:12 pm
Contact:

Plazmic - Timer help please

Post by LordGiddion » Sat Oct 11, 2003 6:48 pm

Plazmic,
You posted this code in one of the other threads as a way to handle timing multiple buffs. Pseudo-code:
Code:

Code: Select all

/declare BuffTimer0 timer 
/declare BuffTimer1 timer 
/declare BuffTimer2 timer 
/declare BuffTimer3 timer 
/declare BuffTimer4 timer 
/declare BuffTimer5 timer 
/declare BuffIndex local 

/for BuffIndex 0 to 5 
   /if n @BuffTimer@BuffIndex==0 /call rebuff @BuffIndex 
/next BuffIndex 
This seems like it will work ok for the check but how can we set the timers?
I tried:

Code: Select all


/declare BuffTimer0 timer 
/declare BuffTimer1 timer 
/declare BuffTimer2 timer 
/declare BuffTimer3 timer 
/declare BuffTimer4 timer 
/declare BuffTimer5 timer 
/declare BuffIndex local 

/varset BuffIndex  1

/varset BuffTimer@BuffIndex $spell("@BuffName",duration)s

But it errors me out with "bad variable in /var function on the line setting the timer. Is there a way to set variable timers like this?

User avatar
grimjack
Macro Author
Macro Author
Posts: 525
Joined: Thu Nov 07, 2002 6:51 am
Contact:

Post by grimjack » Sat Oct 11, 2003 7:57 pm

I'm not sure if it's fixed yet but /for had a prob with variables that where not all lower case.

Try

Code: Select all

/declare BuffTimer0 timer
/declare BuffTimer1 timer
/declare BuffTimer2 timer
/declare BuffTimer3 timer
/declare BuffTimer4 timer
/declare BuffTimer5 timer 
/declare buffindex local 

/for buffindex 0 to 5
   /if n @BuffTimer@BuffIndex==0 /call rebuff @BuffIndex
/next BuffIndex 
Thanks
When they come to me, they're in trouble, or they want some. I bust people out of prison, hunt down vampires, fight alien gods -- All the fun jobs people are too squeamish or too polite to do themselves.

Call me a mercenary. Call me an assassin. Call me a villain. I am all that and more.

My name's John Gaunt, but out on the streets of Cynosure, I am called...
GrimJack

LordGiddion
a snow griffon
a snow griffon
Posts: 352
Joined: Sat Sep 13, 2003 6:12 pm
Contact:

Post by LordGiddion » Sat Oct 11, 2003 9:00 pm

The problem isn't the /for loop it's in starting the timers right now the only way I see to do it is:

Code: Select all

/if n @BuffIndex==1 /varset BuffTimer1 $spell("@BuffName",duration)s 
/if n @BuffIndex==2 /varset BuffTimer2 $spell("@BuffName",duration)s
/if n @BuffIndex==3 /varset BuffTimer3 $spell("@BuffName",duration)s 
/if n @BuffIndex==4 /varset BuffTimer4 $spell("@BuffName",duration)s
/if n @BuffIndex==5 /varset BuffTimer5 $spell("@BuffName",duration)s