mIRC Home    About    Download    Register    News    Help

Print Thread
Joined: Mar 2003
Posts: 612
B
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
Joined: Dec 2002
Posts: 2,031
R
Hoopy frood
Offline
Hoopy frood
R
Joined: Dec 2002
Posts: 2,031

Use /load instead of /reload.

Joined: Mar 2003
Posts: 612
B
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
Joined: Jan 2007
Posts: 1,156
D
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> }
} 


Link Copied to Clipboard