bind pub - !ping pub:ping
bind ctcr - PING pub:pingr
set pub_pingchan "#here.you.set.chan"
proc pub:ping {nick uhost hand chan args} {
if {![auth:check $hand]} {return 0}
set args [split [cleanarg $args]]
if {[llength $args]<1} {
set who $nick
} else {
set who [lindex $args 0]
}
global pub_pingchan
set time [unixtime]
say $who "\001PING $time\001"
set pub_pingchan $chan
}
proc pub:pingr {nick uhost hand dest keyword args} {
global pub_pingchan
set temp [unixtime]
set time [expr $temp - $args]
say $pub_pingchan "PING reply from $nick: $time seconds"
}
bind pub - !ping pub:ping
bind ctcr - PING pub:pingr
proc say {who what} {
puthelp "PRIVMSG $who :$what"
}
proc cleanarg {arg} {
set temp ""
for {set i 0} {$i < [string length $arg]} {incr i} {
set char [string index $arg $i]
if {($char != "\12") && ($char != "\15")} {
append temp $char
}
set pub_pingchan "#here.you.set.chan"
proc pub:ping {nick uhost hand chan args} {
set args [split [cleanarg $args]]
if {[llength $args]<1} {
set who $nick
} else {
set who [lindex $args 0]
}
global pub_pingchan
set time [unixtime]
say $who "\001PING $time\001"
set pub_pingchan $chan
}
proc pub:pingr {nick uhost hand dest keyword args} {
global pub_pingchan
set temp [unixtime]
set time [expr $temp - $args]
say $pub_pingchan "PING reply from $nick: $time seconds"
}
bind pub - !ping pub:ping
bind ctcr - PING pub:pingr
proc say {who what} {
puthelp "PRIVMSG $who :$what"
}
set pub_pingchan "#here.you.set.chan"
proc pub:ping {nick uhost hand chan args} {
set args [split [cleanarg $args]]
if {[llength $args]<1} {
set who $nick
} else {
set who [lindex $args 0]
}
global pub_pingchan
set time [unixtime]
say $who "\001PING $time\001"
set pub_pingchan $chan
}
proc pub:pingr {nick uhost hand dest keyword args} {
global pub_pingchan
set temp [unixtime]
set time [expr $temp - $args]
say $pub_pingchan "PING reply from $nick: $time seconds"
}