mIRC Home    About    Download    Register    News    Help

Print Thread
Joined: Dec 2002
Posts: 33
Ameglian cow
OP Offline
Ameglian cow
Joined: Dec 2002
Posts: 33
At least in my attempts, the following scripts don't show anything if the connection attempt has timed out (and possibly for other disconnection types like this, haven't found the time to test for them all)

[11:23:12 pm] * Connecting to 195.50.191.12 (7000)
[11:23:33 pm] * Unable to connect (Connection timed out)

Script snippet:
on *:CONNECTFAIL:{
echo -a $time Connect Failed: $server $network
}
on *:DISCONNECT:{
echo -a $time Disconnect: $server $network
}

Last edited by Edward_K; 09/01/03 04:31 AM.
Joined: Dec 2002
Posts: 699
N
Fjord artisan
Offline
Fjord artisan
N
Joined: Dec 2002
Posts: 699
The on CONNECTFAIL event uses the same as above and triggers when a connection attempt (including all retries) has failed.
Of course you did know that, right? smile

Joined: Dec 2002
Posts: 33
Ameglian cow
OP Offline
Ameglian cow
Joined: Dec 2002
Posts: 33
I am using the connectfail event, but on the timeout retries, it does not echo anything. The exact scriptlets I used are shown in my first post.

Edit:
It would also be nice if I could get the failure reason, perhaps in $1-.
Eg,
Code:
on *:CONNECTFAIL:{
if ($1- == Connection Timed out) { 
echo -a This server has timed out
do_other_stuff 
}
}

Last edited by Edward_K; 09/01/03 05:34 PM.
Joined: Dec 2002
Posts: 699
N
Fjord artisan
Offline
Fjord artisan
N
Joined: Dec 2002
Posts: 699
(including all retries)
My point is that it does work. As the line I posted from the helpfile says, it only triggers after ALL retries have failed. Not on every single failure, but only when the client has failed to connect. Which makes sense to me. smile

on *:connectfail:echo -st Connect Failed: $server $network

-
[00:12] * Connect retry #19 195.50.191.12 (6668)
-
[00:12] * Unable to connect (Connection timed out)
-
[00:12] Connect Failed: DALnet
-

Joined: Dec 2002
Posts: 33
Ameglian cow
OP Offline
Ameglian cow
Joined: Dec 2002
Posts: 33
Then I stand corrected.

Still, being able to get the failure message would be nice for logging purposes. (without using $line() on the status window)

Joined: Dec 2002
Posts: 25
V
Ameglian cow
Offline
Ameglian cow
V
Joined: Dec 2002
Posts: 25
Quote:
Still, being able to get the failure message would be nice for logging purposes. (without using $line() on the status window)


Yes, being able to choose when you want it to trigger would be nice.

For example, an identifier could be added just for this event:

on *:CONNECTFAIL: {
echo -ate Total Retries: $retries(0)
if ($retries == 1) { echo -ate Connection Failed: $retries attempts remaining. }
if ($retries == 0) { echo -ate Connection Failed: Halting Connection. }
}

Of course, this example isn't very useful, but useful things could be made from this added option.


Link Copied to Clipboard