Skip to content
MSN

Heelp d;

A TG007 community discussion started by endlessdx.

Discussion 4 posts
Page 1 of 1
Open
Topic #5961 · 4 published posts · 692 views

on *:TEXT:.lag:#: { ctcp $nick ping } | var %ping = $calc($ctcp ping) | msg # $nick : $duration(%ping)

Oh kay' I have a problem with this code.. it does MSG the user but it always says 0secs.. never changes when it needs to so.. what did I do wrong?

Hmm ive seen these they show the users lag or something.. anyway i think it should be

 

ctcpreply *:PING:*: {

then add the msg code here

}

on *:TEXT:!ping*:*:{ 
  if ($2) && (!% [ $+ ping. [ $+ [ $2 ] ] ] ) { 
    .ctcp $2 ping 
    set -u5 % [ $+ ping. [ $+ [ $2] ] ] $ticks 
    set -u5 %pingnick $nick 
  } 
  elseif (!% [ $+ ping. [ $+ [ $nick ] ] ] ) { 
    .ctcp $nick ping 
    set -u5 % [ $+ ping. [ $+ [ $nick ] ] ] $ticks 
  } 
} 
on *:ctcpreply:ping*:{ 
  if (% [ $+ ping. [ $+ [ $nick ] ] ] ) /privmsg  $comchan($nick,1)  (ap) $+ $nick $+ 's lagged by $calc(($ticks - % [ $+ ping. [ $+ [ $nick ] ] ] ) / 1000)) secs. (ap) 
  elseif (%pingnick) .ctcpreply %pingnick TIME $nick $+ 's lagged by $calc(($ticks - % [ $+ ping. [ $+ [ $nick ] ] ] ) / 1000)) secs. 
}

on *:TEXT:.lag*:#: { 
  ctcp $nick ping 
} 
on !*:ctcpreply:ping*: { 
  var %ping = $calc($ctime - $2) 
  privmsg $comchan($nick,1) $nick : $duration(%ping) 
} 

Thanks guys. D; I got it working I just had to make the code into that.