mIRC Home    About    Download    Register    News    Help

Print Thread
on load activating each time #190796 26/11/07 12:49 PM
Joined: Mar 2003
Posts: 612
B
billythekid Offline OP
Fjord artisan
OP Offline
Fjord artisan
B
Joined: Mar 2003
Posts: 612
how do you get an on load event to execute every time a script is loaded and not just the first time?

I'm not talking about on start but instead, i have a script which alters itsself and re-loads but the on load event doesn't activate on these loads.

It's not a problem for this script but I could see where it would be useful to re-initialise a script on each loading.

btk


billythekid
Re: on load activating each time [Re: billythekid] #190799 26/11/07 01:09 PM
Joined: Dec 2002
Posts: 2,016
R
RoCk Offline
Hoopy frood
Offline
Hoopy frood
R
Joined: Dec 2002
Posts: 2,016

Use /load instead of /reload.

Re: on load activating each time [Re: RoCk] #190803 26/11/07 03:29 PM
Joined: Mar 2003
Posts: 612
B
billythekid Offline OP
Fjord artisan
OP Offline
Fjord artisan
B
Joined: Mar 2003
Posts: 612
i do use load (i didn't know about reload blush )

Code:
    if $input(Button Created!,o) { .load -rs $qt($script) }


billythekid
Re: on load activating each time [Re: billythekid] #190810 26/11/07 06:49 PM
Joined: Jan 2007
Posts: 1,156
D
DJ_Sol Offline
Hoopy frood
Offline
Hoopy frood
D
Joined: Jan 2007
Posts: 1,156
I believe I ran into this issue when I built my auto updater. It's been a while so I don't remember the specifics, but I solved it by using the start event. Now all I had to do is write an ini entry so it was no big deal. I didn't mind it being rewritten everytime I started mIRC.

How about setting a variable.

Code:
if $input(Button Created!,o) { set %load | .load -rs $qt($script) }

on *:load:{
if (%load) { unset %load | <whatever you want do> }
}