!Ping, !Time and !Version

By Siddhant on Dec 22, 2007

!Ping: CTCP's the nick to get the ping reply.
!Time: CTCP's the nick to get the time reply.
!Version: CTCP's the nick to get the version reply.

Syntax:

  • !Ping
  • !Time
  • !Version
/*
!Ping, !Time and !Version
Written by: Siddhant Sutar
Email: siddhantsutar@yahoo.com
IRC: irc.DuelZone.org/irc.netstable.net
*/

on *:TEXT:*:#:{
  if ($1 == !Ping) || ($1 == !Time) || ($1 == !Version) {
    if ($2 != $null) {
      set %ctcp.chan $chan
      set %ctcp.nick $2
      set %ctcp.cmd $remove($1,!)
      ctcp %ctcp.nick %ctcp.cmd
    }
  }
}

on *:CTCPREPLY:$($+(%ctcp.cmd,*)):{
  if ($nick == %ctcp.nick) {
    if (%ctcp.cmd == Ping) { msg %ctcp.chan %ctcp.nick $+ 's ping reply is: $+($duration($calc($ctime - $2-)),.) }
    if (%ctcp.cmd == Time) { msg %ctcp.chan It is $2- at the place where %ctcp.nick lives. }
    if (%ctcp.cmd == Version) { msg %ctcp.chan %ctcp.nick is using: $+($2-,.) }
  }  
  unset %ctcp.*
}  

raw 401:*:{
  msg %ctcp.chan %ctcp.nick is not online.
  unset %ctcp.*
  halt
} 

Comments

Sign in to comment.
deejay8   -  Jul 08, 2009

@Claus999 works for me good

!time Alex * Received a CTCP TIME from Alex|mIRC It is Wed Jul 08 12:04:57 at the place where Alex lives. !version Alex * Received a CTCP VERSION from Alex|mIRC Alex is using: xchat 2.8.7e Windows 6.0 [i686/2.16GHz]. !ping Alex * Received a CTCP PING 1247076313 from Alex|mIRC Alex's ping reply is: 1sec.
 Respond  
Claus999   -  May 03, 2009

hmm !ping wont work propperly for me. when using !ping my bot gets the ping time but never sends it to me..

 Respond  
Are you sure you want to unfollow this person?
Are you sure you want to delete this?
Click "Unsubscribe" to stop receiving notices pertaining to this post.
Click "Subscribe" to resume notices pertaining to this post.