Jump to content

eXonyte's ping script


Stormy

Recommended Posts

Zandor said:
Sep 28th, 2008, 11:43am
; Millisecond Pinger by eXonyte
; Type /mping <nickname> to ping someone in milliseconds instead of seconds.
; Also attempts to maintain compatibility with normal /ctcp <nick> PING replies,
; and will display the text if someone's script replies with text instead of a number.

; Alias to send a millisecond ping
alias mping {

; Sends the actual ping as a raw
.raw PRIVMSG $$1 : $+ $chr(1) $+ PING $ticks $+ $chr(1)

; Echoes a CTCP PING lookalike to the active window
echo $colour(ctcp) -t $+ $iif($active == Status Window,se,a) -> [[ $+ $$1 $+ ]] PING
}

; Handles CTCP PING replies
on *:CTCPREPLY:*PING*: {

; If the reply isn't a number, let mIRC handle it
if ($2 !isnum) { return }

; If the current $ticks minus the reply is greater than 0
if ($calc($ticks - $2) > 0) {

; Echo the ping reply to the active window
echo $colour(ctcp) -at $+ $iif($active == Status Window,e) [[ $+ $nick PING reply]: $calc($ticks - $2) $+ ms

; And halt so that mIRC doesn't show its own ping reply
halt
}
}

Link to comment
Share on other sites

  • 2 years later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...