chiark
/
gitweb
/
~mdw
/
ircbot
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
9bfc258
)
Beats, but not displayed properly.
author
Ian Jackson
<ijackson@chiark.greenend.org.uk>
Sun, 27 Jan 2002 22:13:05 +0000
(22:13 +0000)
committer
Ian Jackson
<ijackson@chiark.greenend.org.uk>
Sun, 27 Jan 2002 22:13:05 +0000
(22:13 +0000)
bot.tcl
patch
|
blob
|
blame
|
history
diff --git
a/bot.tcl
b/bot.tcl
index e021af774f92c1c3ecca647b42331b362427c177..eb65a0efaa48844e20889903e5d369cb826a357d 100755
(executable)
--- a/
bot.tcl
+++ b/
bot.tcl
@@
-23,6
+23,10
@@
proc showintervalsecs {howlong abbrev} {
return [showintervalsecs/[opt timeformat] $howlong $abbrev]
}
return [showintervalsecs/[opt timeformat] $howlong $abbrev]
}
+proc showintervalsecs/beat {howlong abbrev} {
+ return [format "%g B" [expr {$howlong/86.4}]]
+}
+
proc showintervalsecs/ks {howlong abbrev} {
if {$howlong < 1000} {
return "${howlong}s"
proc showintervalsecs/ks {howlong abbrev} {
if {$howlong < 1000} {
return "${howlong}s"
@@
-1042,6
+1046,7
@@
proc timeformat_desc {tf} {
switch -exact $tf {
ks { return "Times will be displayed in seconds or kiloseconds." }
hms { return "Times will be displayed in hours, minutes, etc." }
switch -exact $tf {
ks { return "Times will be displayed in seconds or kiloseconds." }
hms { return "Times will be displayed in hours, minutes, etc." }
+ beat { return "Times will be displayed in beats (1000B = 1d)." }
default { error "invalid timeformat: $v" }
}
}
default { error "invalid timeformat: $v" }
}
}
@@
-1098,11
+1103,13
@@
def_setting marktime {
s { set u 1 }
ks { set u 1000 }
m { set u 60 }
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 "marktime interval too large" }
default { error "unknown unit of time $unit" }
}
if {$value > 86400*21/$u} { error "marktime interval too large" }
- set mt [expr {
$value*$u
}]
+ set mt [expr {
round($value*$u)
}]
if {$mt < $marktime_min} { error "marktime interval too small" }
} else {
error "invalid syntax for marktime"
if {$mt < $marktime_min} { error "marktime interval too small" }
} else {
error "invalid syntax for marktime"