chiark / gitweb /
Merge up from trunk. cvs up -j branchpoint-2001-10-09-tell -j mergeup-1-2001-10...
authorijackson <ijackson>
Thu, 14 Feb 2002 18:14:29 +0000 (18:14 +0000)
committerijackson <ijackson>
Thu, 14 Feb 2002 18:14:29 +0000 (18:14 +0000)
1  2 
bot.tcl
helpinfos
parsecmd.tcl
test.tcl

diff --cc bot.tcl
index ac5714b3d4de991892eaad3b7e343aa2d7056008,106002708e1908a693d779855e8499338aa75af2..b5abdda4a8798fda7988c81127fb120934c50abd
+++ b/bot.tcl
@@@ -86,23 -108,6 +111,26 @@@ proc showtime {when} 
      return [showinterval [expr {[clock seconds] - $when}]]
  }
  
-     set result [expr {$value*$u}]
 +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 {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 2359e88b55ed7ab20756dfa7690529435af542c8,2444f93d9a9f2e469670b8441cde1948abc628d8..9d920d2d114c2033d4811a139dec1f35cd58d2a7
+++ b/helpinfos
@@@ -10,11 -10,11 +10,11 @@@ General commands:           Registratio
   !help [<cmd>|<opt>|<topic>]  !register [insecure|delete]
   !seen <nick>                 !set [<opt> [<value>]]      who [<nick>]
   !summon <username>           (See `help !identify', `help !blight-id')
-- !invite [<chan>] <nick>...  Channel settings (see `help channel'):
-- !op [<chan>]                 !channel [<chan>] <setting> [....]
-- !leave [<chan>]             Additional help topics:
-- !ping [<stuff ...>]          !identify !identpass !invite !blight-id
-  !tell <nick> <message ...>
 - !kill <nick> [<reason>]
++ !invite [<chan>] <nick>...  For channel managers (see `help channel'):
++ !leave [<chan>]              !channel [<chan>] <setting> [....]
++ !ping [<stuff ...>]          !op [<chan>]                          
++ !tell <nick> <message ...>  Additional help topics:                 
++ !kill <nick> [<reason>]      !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 <option>         show the current setting of <option>
  set <option> <value> set <option> to <value>
-  Options:   !timeformat ks|hms   !marktime off|once|<!interval>
-             !tellme ...
+  Options:  !timeformat ks|hms|beat
+            !marktime off|once|<n>[k]s|<n>m|<n>h
++           !tellme ...
   See also `help <option>', `help !register' and `help !identify'
  
  :timeformat
diff --cc parsecmd.tcl
Simple merge
diff --cc test.tcl
index 993a1aa0ed50105cba300a30a8f33cd65e02c4a5,269e2be163248a2b21e9e9b68a6012db07e25810..9ba46a7d569f5e62592b62c43ddc915170400fe1
+++ b/test.tcl
@@@ -5,6 -5,6 +5,7 @@@ set nick testbo
  set ownfullname confused
  set socketargs {}
  set marktime_min 10
 +set ownmailaddr ijackson@chiark.greenend.org.uk
  
  source bot.tcl
+ source botpass.tcl