Page 1 of 1
Why does this event trigger twice?
Posted: Sat May 15, 2004 7:16 am
by LamahHerder
Why does this event trigger twice?
test.mac
Code: Select all
#event ToggleNinja "[MQ2] nl#*#"
Sub Main
/declare NinjaLewt outer
:loop
/doevents
/delay 1
/goto :loop
/end
Sub event_ToggleNinja
/echo event
/if (${NinjaLewt}==0) {
/varset NinjaLewt 1
/goto :endToggleNinja
}
/if (${NinjaLewt}==1) {
/varset NinjaLewt 0
/goto :endToggleNinja
}
:endToggleNinja
/return
Re: Why does this event trigger twice?
Posted: Sat May 15, 2004 7:27 am
by wassup
Well, for one thing... read up on what a variable type defaults to if it's type isn't declared.
Then look at your /if statements. YOu will see something wrong.
m0nk wrote:Why does this event trigger twice?
test.mac
Code: Select all
#event ToggleNinja "[MQ2] nl#*#"
Sub Main
/declare NinjaLewt outer
:loop
/doevents
/delay 1
/goto :loop
/end
Sub event_ToggleNinja
/echo event
/if (${NinjaLewt}==0) {
/varset NinjaLewt 1
/goto :endToggleNinja
}
/if (${NinjaLewt}==1) {
/varset NinjaLewt 0
/goto :endToggleNinja
}
:endToggleNinja
/return
Posted: Sat May 15, 2004 2:10 pm
by LamahHerder
Still dont understand why it is triggering 2x 8*(
Code: Select all
#event ToggleNinja "[MQ2] nl#*#"
Sub Main
/declare NinjaLewt int outer
:loop
/doevents
/delay 1
/goto :loop
/end
Sub event_ToggleNinja
/echo event
/if (${NinjaLewt}<1) {
/varset NinjaLewt 1
} else {
/varset NinjaLewt 0
}
/return
Posted: Sat May 15, 2004 2:23 pm
by Lax
Do you have mq2telnet loaded, and it's not the latest version of it (or mq2chatwnd same story)? The events handling was moved into MQ2Main. There was previously an event handling call in both MQ2ChatWnd and MQ2Telnet. There's a few scenarios where it would get run twice. a) New MQ2Main, old [MQ2ChatWnd or MQ2Telnet]. b) Old MQ2Main, old MQ2ChatWnd and old MQ2Telnet both loaded.
Posted: Sat May 15, 2004 2:26 pm
by LamahHerder
Yea found that after my 2nd post
I have MQ2-20040514
Plug list
Code: Select all
[Plugins]
mq2labels=mq2labels
mq2itemdisplay=mq2itemdisplay
mq2custombinds=mq2custombinds
mq2hud=mq2hud
mq2fps=mq2fps
mq2map=mq2map
mq2mapfix=mq2mapfix
mq2bzsrch=mq2bzsrch
mq2eqbugfix=mq2eqbugfix
mq2chat=mq2chat
With mq2chat it will trigger twice
If i change mq2chat to mq2chatwnd it will trigger once.