you gain experiance event fireing multiple times

Help section from before the user variable changes that broke all macros

Moderator: MacroQuest Developers

pxlpluker
a lesser mummy
a lesser mummy
Posts: 53
Joined: Tue Aug 27, 2002 12:20 pm

you gain experiance event fireing multiple times

Post by pxlpluker » Wed Oct 02, 2002 10:19 pm

you gain experiance event fireing multiple times.
why ?
usually from 4 to over 20 times in a row. i am right a mqlog line every time it fires. its will do them all in 1 to 2 seconds.
i get xp once every 10 min. so i dont think they are qued up. i wish i got that many kills

gingertips
a hill giant
a hill giant
Posts: 230
Joined: Wed Jun 26, 2002 3:47 am
Location: Tseu-Qorcam

Post by gingertips » Thu Oct 03, 2002 3:13 am

sorry u lost me on this one - what do you mean???

User avatar
DeathSpiral
a ghoul
a ghoul
Posts: 95
Joined: Thu Aug 22, 2002 6:31 pm

Post by DeathSpiral » Thu Oct 03, 2002 3:22 am

gingertips wrote:sorry u lost me on this one - what do you mean???
He means that he has something similar to this:

Code: Select all

#event GainXP "You have gained experience"
and that every time the message shows up, the sub Event_GainXP is called anywhere from 1-20 times. So, all the commands in the sub are performed 1-20 times.

pxlpluker, as a walkaround, I would suggest the following:

set aside a global variable. We'll call it v39, could be anything.

Then do something like this:

Code: Select all

sub Event_GainXP
   /if n $v39==1 /return
   /varset v39 1
   ...
/return
.

Then, elsewhere, before you do something that will make you gain xp, do

Code: Select all

/varset v39 0
. That way, the event can fire as often as it wants... should only execute the code once for each time you tell it to 'expect' it.

Another possibility would be something like this:

Code: Select all

 sub Event_GainXP
   /if n $v39==1 /return
   /varset v39 1
   /varset t19 150
   ...
/return

sub Event_Timer
   /if n $p0==19 /varset v39 0
/return
Kind of a hackish workaround, but it may be of some help.
I am orc pawn, hear me yell for centurians...

pxlpluker
a lesser mummy
a lesser mummy
Posts: 53
Joined: Tue Aug 27, 2002 12:20 pm

Post by pxlpluker » Thu Oct 03, 2002 11:53 am

thanks. i get the idea. right that is a LONG way around what i want to do, but i think i can make it work. thanks