mIRC Home    About    Download    Register    News    Help

Print Thread
Joined: Jan 2004
Posts: 1
bendelo Offline OP
Mostly harmless
OP Offline
Mostly harmless
Joined: Jan 2004
Posts: 1
The current implementation of CTCP PING uses the $ctime variable which results in a ping reply accurate to the second. However given that a high number of users are on fast digital connections, having a ping of 0sec when < 1000ms is not very useful.

I propose that CTCP PINGs be more accurate, perhaps to the millisecond by using a modified timestamp. I have implemented with mIRC script a new /ping command with the $ticks variable. This gives a less 'blunt' ping reply.

Aliases: (aliases.ini)
/ping raw -q PRIVMSG $$1 $+(:,$chr(1),PING $ticks,$chr(1))

Remote: (scripts.ini)
on 1:CTCPREPLY:PING*:{
echo 4 -a $+([,$nick PING reply]: $calc($ticks - $2),ms)
halt
}

This could of course be refined to use $asctime to format ping replies > 1000ms like mIRC's native implementation.

Hopefully this feature will be useful to people, and possibly included in future versions of mIRC.

Joined: Feb 2003
Posts: 2,812
Hoopy frood
Offline
Hoopy frood
Joined: Feb 2003
Posts: 2,812
Indeed, many of us write our own PING methods using "$ctime $ticks" like yours. Though, I'm happy with it the way it is, personally. Gives people something to do. And besides, $ticks is only accurate to about 100ms.

Btw, you may want to check if $2 exists, if not, then use $1. Some clients will only reply with your first parameter.


Well. At least I won lunch.
Good philosophy, see good in bad, I like!
Joined: Aug 2003
Posts: 1,831
I
Hoopy frood
Offline
Hoopy frood
I
Joined: Aug 2003
Posts: 1,831
$2 IS the 1st paramter smile $1 is "PING"

Joined: Aug 2003
Posts: 1,831
I
Hoopy frood
Offline
Hoopy frood
I
Joined: Aug 2003
Posts: 1,831
Just a little shorter code:
Code:
alias ping { .msg $$1 PING $ticks $+  }

Joined: Feb 2003
Posts: 2,812
Hoopy frood
Offline
Hoopy frood
Joined: Feb 2003
Posts: 2,812
Ah, DOH! smirk

And for some reason I read $ctime $ticks in his example, when $ctime isn't even there. crazy

* Raccoon goes to have his eyes checked.


Well. At least I won lunch.
Good philosophy, see good in bad, I like!
Joined: Aug 2003
Posts: 1,831
I
Hoopy frood
Offline
Hoopy frood
I
Joined: Aug 2003
Posts: 1,831
Quote:
* Raccoon goes to have his eyes checked.
There are optometrists for raccoons? laugh

Joined: Dec 2002
Posts: 1,541
L
Hoopy frood
Offline
Hoopy frood
L
Joined: Dec 2002
Posts: 1,541
A simple new option could allow for us to designate this; giving the default in black text near the checkbox for customizing etc and an editbox to enter in the mirc $identifyer to use for it (only allowing time identifyers and nothing else so it couldnt be used to attack)


Those who fail history are doomed to repeat it

Link Copied to Clipboard