Code: Select all
proc ping_send {hand idx text} {
global pingidx tcl_version
set pingidx $idx
set bots [string tolower [bots]]
set pingbot [string tolower [lindex $text 0]]
if {$tcl_version >= 8.3} {
set time [clock clicks -milliseconds]
} else {
set time [unixtime]
}
if {$pingbot != ""} {
if {[lsearch $bots $pingbot] != "-1"} {
putbot $pingbot "BOTPING $time"
putdcc $idx "Pinging $pingbot."
} else {
putdcc $idx "That bot isn't on the botnet."
return 0
}
} else {
putallbots "BOTPING $time"
putdcc $idx "Pinging the entire botnet."
}
return 1
}
proc ping_echo {bot command text} {
global replied_ping
if {$command == "BOTPING" && ![info exists replied_ping]} {
set replied_ping yes
utimer 20 {unset replied_ping}
putbot $bot "BOTPING_RPLY $text"
putlog "Pinged by $bot"
}
}
proc ping_reply {bot command text} {
global pingidx tcl_version
if {$command == "BOTPING_RPLY"} {
if {$tcl_version >= 8.3} {
set replytime [expr [expr [clock clicks -milliseconds] - [split $text]] / 1000.0]
} else {
set replytime [expr [unixtime] - [split $text]]
}
putdcc $pingidx "Ping reply from $bot\: $replytime secs"
}
}
bind time - "?0 * * * *" ping_send
bind time - "?5 * * * *" ping_send
bind dcc m bping ping_send
bind bot - BOTPING ping_echo
bind bot - BOTPING_RPLY ping_reply
Code: Select all
[09:35] Tcl error [ping_send]: wrong # args: should be "ping_send hand idx text"
[09:35] #Nor7on# set errorInfo
Currently: wrong # args: should be "ping_send hand idx text"
Currently: while executing
Currently: "ping_send $_time1 $_time2 $_time3 $_time4 $_time5"
so, whats wrong?
Thanks