This is the new home of the egghelp.org community forum.
All data has been migrated (including user logins/passwords) to a new phpBB version.
For more information, see this announcement post . Click the X in the top right-corner of this box to dismiss this message.
Old posts that have not been replied to for several years.
Sir_Fz
Revered One
Posts: 3794 Joined: Sun Apr 27, 2003 3:10 pm
Location: Lebanon
Contact:
Post
by Sir_Fz » Sun Sep 07, 2003 5:27 am
Code: Select all
proc validnum {num} {
return [expr [scan $num "%f%s" a b] == 1]
}
proc pub_ping {nick uhost hand chan arg} {
global channel
if {![isbotnick $nick]} { puthelp "PRIVMSG $nick :[list \001PING CHECK [clock clicks] $chan \001]" }
set channel $chan
}
proc ctcr_ping {nick uhost hand dest keyword arg} {
global channel
if {([lindex $arg 0] == "CHECK") && ([validnum [set time [lindex $arg 1]]])} {
puthelp "PRIVMSG $channel :\[\002$nick\002 PING reply\]: [expr abs([clock clicks] - $time) / 1000000.0] seconds" }
unset channel
}
bind pub -|- !ping pub_ping
bind pub -|- !pingme pub_ping
bind ctcr - PING ctcr_ping
it looks fine to me, but why doesn't it reply the ping on channel unless its me who's requesting !ping.
I noticed that it doesn't get a ping reply from anyone except me.
strikelight
Owner
Posts: 708 Joined: Mon Oct 07, 2002 10:39 am
Contact:
Post
by strikelight » Sun Sep 07, 2003 5:31 am
Sir_Fz wrote: Code: Select all
proc validnum {num} {
return [expr [scan $num "%f%s" a b] == 1]
}
proc pub_ping {nick uhost hand chan arg} {
global channel
if {![isbotnick $nick]} { puthelp "PRIVMSG $nick :[list \001PING CHECK [clock clicks] $chan \001]" }
set channel $chan
}
proc ctcr_ping {nick uhost hand dest keyword arg} {
global channel
if {([lindex $arg 0] == "CHECK") && ([validnum [set time [lindex $arg 1]]])} {
puthelp "PRIVMSG $channel :\[\002$nick\002 PING reply\]: [expr abs([clock clicks] - $time) / 1000000.0] seconds" }
unset channel
}
bind pub -|- !ping pub_ping
bind pub -|- !pingme pub_ping
bind ctcr - PING ctcr_ping
it looks fine to me, but why doesn't it reply the ping on channel unless its me who's requesting !ping.
I noticed that it doesn't get a ping reply from anyone except me.
I don't know where you pulled "CHECK" from, but most clients respond to
"PING" alone (and/or followed by a unix time).
Sir_Fz
Revered One
Posts: 3794 Joined: Sun Apr 27, 2003 3:10 pm
Location: Lebanon
Contact:
Post
by Sir_Fz » Sun Sep 07, 2003 6:18 am
yes, I compared it to another script, I noticed that the CHECK thing is extra.. so I changed it to \001ping [clock clicks]\001
now it works
thanx