Well, you could do this by simply setting a %var and increase it whenever you start mIRC, but this way is a little bit cooler, IMHO
The principle behind this is that you start and name a DDE Server whenever you open up mIRC. If you then already are running an instance of mIRC, it will shut down the newly opened program.
I just made it simple and it may be malfuntioning every now and then, but hopefully it will give you an idea of how to do it
Your'n
on *:START:{
inc %i
DDESERVER ON $+(mIRC,%i)
[color:green];We start the DDE Server and name it mIRC2 for example[/color]
if ($dde($+(mIRC,$calc(%i - 1)),connected)) {
[color:green];if $dde(mIRC1,connected) returns something, there is another instance of mIRC running. [/color]
[color:green];You could use $ddename instead, but this would give people an idea of how to use $dde.[/color]
dde mirc1 command "" /ECHO -ag * The other instance of mIRC has been shut down
[color:green];Let us echo to our first instance that we shut down the newly opened mIRC[/color]
exit
[color:green];And here we exit that instance.[/color]
}
}
on *:EXIT:dec %i
[color:green];And then we need to decrease %i whenever we exit mIRC[/color]