mIRC Home    About    Download    Register    News    Help

Print Thread
Joined: Dec 2002
Posts: 417
O
Othello Offline OP
Fjord artisan
OP Offline
Fjord artisan
O
Joined: Dec 2002
Posts: 417
Which is better for exicuting a command on reconnect?

on 1:CONNECT:/echo Connected to $server at $time with nickname $nick

or

on 1:START:/echo Performing regular initialization for this script!




Intelligence: It's better to ask a stupid question, then to prove it by not asking....
Joined: Jul 2006
Posts: 53
O
Babel fish
Offline
Babel fish
O
Joined: Jul 2006
Posts: 53
When you reconnect to a server while mirc is already open, the On Start event will not work. The On Start event only works when you first open mirc. So in this case the obvious choice would be to use the on Connect event along with the On Disconnect event.

Of course, you could make it so that when your mirc disconnects, you exit mirc and reopen it and then that would make you able to use the On Start event once again. The choice is yours.

Last edited by oblivious; 15/07/06 01:20 AM.
Joined: Dec 2002
Posts: 417
O
Othello Offline OP
Fjord artisan
OP Offline
Fjord artisan
O
Joined: Dec 2002
Posts: 417
Thanks for that input. it helps but another problem still exists.

Is there a command that can identify if I am connected or disconnected to any server?

What I am trying to figure out is if I disconnect from one server
and I am still connected to another server. I don't want my script to stop if it is still connected to any server.




Intelligence: It's better to ask a stupid question, then to prove it by not asking....
Joined: Jul 2006
Posts: 53
O
Babel fish
Offline
Babel fish
O
Joined: Jul 2006
Posts: 53
//echo $status

as well as

directly from the helpfile
/help /scon
scroll down to the very bottom

The /scon command works in exactly the same way, except that N represents the Nth connection, not a connection id value.

The -a and -tM switches can only be used if you specify a command.

The -a switch performs the command on all connection ids.

The -tM switch limits the command to being performed only on servers with a certain connection status, where M is an or'd value of 1 = server connected, 2 = not connected, 4 = connecting, 8 = not connecting. The command is only performed if M matches the connect status of the connection id.

The -s makes any called commands or identifiers show their results.

Last edited by oblivious; 15/07/06 01:58 AM.
Joined: Dec 2002
Posts: 417
O
Othello Offline OP
Fjord artisan
OP Offline
Fjord artisan
O
Joined: Dec 2002
Posts: 417
Thank oblivious that works for me




Intelligence: It's better to ask a stupid question, then to prove it by not asking....

Link Copied to Clipboard