From: ijackson Date: Thu, 14 Feb 2002 18:14:29 +0000 (+0000) Subject: Merge up from trunk. cvs up -j branchpoint-2001-10-09-tell -j mergeup-1-2001-10... X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ijackson/git?a=commitdiff_plain;h=937a16343a8e2c9050eb3758ee650c794681bb2d;p=ircbot.git Merge up from trunk. cvs up -j branchpoint-2001-10-09-tell -j mergeup-1-2001-10-09-tell --- 937a16343a8e2c9050eb3758ee650c794681bb2d diff --cc bot.tcl index ac5714b,1060027..b5abdda --- a/bot.tcl +++ b/bot.tcl @@@ -86,23 -108,6 +111,26 @@@ proc showtime {when} return [showinterval [expr {[clock seconds] - $when}]] } +proc parse_interval {specified min} { + if {![regexp {^([0-9]+)([a-z]+)$} $specified dummy value unit]} { + error "invalid syntax for interval" + } + switch -exact $unit { + s { set u 1 } + ks { set u 1000 } + m { set u 60 } + h { set u 3600 } ++ mb { set u 0.0864 } ++ b { set u 86.4 } ++ kb { set u 86400 } + default { error "unknown unit of time $unit" } + } + if {$value > 86400*21/$u} { error "interval too large" } - set result [expr {$value*$u}] ++ set result [expr {round($value*$u)}] + if {$result < $min} { error "interval too small (<${min}s)" } + return $result +} + proc def_msgproc {name argl body} { proc msg_$name "varbase $argl" "\ upvar #0 msg/\$varbase/dest d\n\ diff --cc helpinfos index 2359e88,2444f93..9d920d2 --- a/helpinfos +++ b/helpinfos @@@ -10,11 -10,11 +10,11 @@@ General commands: Registratio !help [||] !register [insecure|delete] !seen !set [ []] who [] !summon (See `help !identify', `help !blight-id') -- !invite [] ... Channel settings (see `help channel'): -- !op [] !channel [] [....] -- !leave [] Additional help topics: -- !ping [] !identify !identpass !invite !blight-id - !tell - !kill [] ++ !invite [] ... For channel managers (see `help channel'): ++ !leave [] !channel [] [....] ++ !ping [] !op [] ++ !tell Additional help topics: ++ !kill [] !identify !identpass !invite !blight-id Send commands to me by /msg, or say them in channel with \! in front. To get me on a channel, invite me. To become channel manager, op me. @@@ -204,8 -174,8 +210,9 @@@ register insecure register your nick set show your current settings set