mIRC Homepage
Posted By: billythekid on load activating each time - 26/11/07 12:49 PM
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
Posted By: RoCk Re: on load activating each time - 26/11/07 01:09 PM

Use /load instead of /reload.
Posted By: billythekid Re: on load activating each time - 26/11/07 03:29 PM
i do use load (i didn't know about reload blush )

Code:
    if $input(Button Created!,o) { .load -rs $qt($script) }
Posted By: DJ_Sol Re: on load activating each time - 26/11/07 06:49 PM
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> }
} 
© mIRC Discussion Forums