Quote:


On *:START:{
if ($isfile($+(",$mircdir,mIRCisrunning")) { exit }
else { write $+(",$mircdir,mIRCisrunning") loaded | set %thismirc $window(-2).hwnd }
}



On *:EXIT:{
if (%thismirc == $window(-2).hwnd) { unset %thismirc | .remove $+(",$mircdir,mIRCisrunning") }
}



the %thismirc is set, saved so exists at the second run, thus triggering the exit event.

this way you check if you are the right mIRC instance

also the $mircdir makes it installtion dir dependend (so you can run mirc1\ and mirc2\ both at the same time, but not more then 1 instance)

(I hope :-P didn't test it ;-] )

only problem is if mIRC crashed and didn't remove the file you need to do it by hand... else it won't boot anymore


If it ain't broken, don't fix it!