mIRC Home    About    Download    Register    News    Help

Print Thread
#134702 04/11/05 02:41 AM
Joined: Jul 2004
Posts: 59
S
synth7 Offline OP
Babel fish
OP Offline
Babel fish
S
Joined: Jul 2004
Posts: 59
How can I convert my ctcp PING reply to others from seconds to milliseconds?



#134703 04/11/05 02:56 AM
Joined: Feb 2004
Posts: 2,019
Hoopy frood
Offline
Hoopy frood
Joined: Feb 2004
Posts: 2,019
This is an example of what you could do:

; Usage: /ping <nick>

Code:
alias ping set -u100 %ping $+ $$1 $ticks | ctcp $1 ping
[color:red]  [/color] 
on *:ctcpreply:ping *:{
  if ($($+(%,ping,$nick),2)) {
    haltdef
    echo -atc ctcp [ $+ $nick PING reply]: $calc(($ticks - $v1)/1000) $+ secs
    unset %ping [ $+ [ $nick ] ]
  }
}


Gone.
#134704 04/11/05 05:50 AM
Joined: Dec 2002
Posts: 1,245
M
Hoopy frood
Offline
Hoopy frood
M
Joined: Dec 2002
Posts: 1,245
slightly different is this one, I got it from the board here before the fire
I wish I could remember who posted it..
Code:
alias ping .raw PRIVMSG $$1 : $+ $chr(1) $+ PING $ticks $+ $chr(1)
on *:CTCPREPLY:PING*: {
  var %ping = $calc(($ticks - $2) / 1000) Seconds
  echo -a $+($nick,'s) $1 is %ping
  .notice $nick Your $1 is %ping
  haltdef
}

make sure you dont have another "ping" alias anywhere

#134705 11/12/05 06:33 PM
Joined: Feb 2004
Posts: 2,019
Hoopy frood
Offline
Hoopy frood
Joined: Feb 2004
Posts: 2,019
That is indeed another alternative, but I would do a check for existance of parameter $2, because if you did a ping with /ctcp <nick> ping, it will not show correct results.


Gone.

Link Copied to Clipboard