mIRC Home    About    Download    Register    News    Help

Topic Options
#134702 - 04/11/05 02:41 AM PING reply to ms
synth7 Offline
Babel fish

Registered: 18/07/04
Posts: 59
How can I convert my ctcp PING reply to others from seconds to milliseconds?
_________________________


Top
#134703 - 04/11/05 02:56 AM Re: PING reply to ms
FiberOPtics Offline
Hoopy frood

Registered: 05/02/04
Posts: 2019
Loc: Leuven, Belgium
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.

Top
#134704 - 04/11/05 05:50 AM Re: PING reply to ms
MikeChat Offline
Hoopy frood

Registered: 12/12/02
Posts: 1245
Loc: California, doooood
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

Top
#134705 - 11/12/05 06:33 PM Re: PING reply to ms
FiberOPtics Offline
Hoopy frood

Registered: 05/02/04
Posts: 2019
Loc: Leuven, Belgium
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.

Top