set e_life 120
set tint_switch 90
+set bell_again 60
set tint_switched [expr { exp( -($tint_switch+0.0) / $e_life ) }]
proc retint {} {
lappend newprtimes {}
} elseif {$age < 60} {
lappend newprtimes [format "%3ds" $age]
- } else {
+ } elseif {$age < 3600} {
lappend newprtimes [format "%3dm" [expr {$age/60}]]
+ } else {
+ lappend newprtimes [format "%3dh" [expr {$age/3600}]]
}
set latest [expr { $time > $latest ? $time : $latest }]
set tint [expr { exp( (-($age >= 0 ? $age : 0) + 0.0) / $e_life ) }]
proc message {pirate msg} {
global times pirates messages height
- global lw_ls lw_ws
+ global lw_ls lw_ws bell_again
set ix [lsearch -exact $pirates $pirate]
set now [clock seconds]
+
+ if {$bell_again > -2 &&
+ ($ix<0 || [lindex $times $ix] < $now-$bell_again)} {
+ bell -nice
+ }
if {$ix < 0} {
set cix 0
set oldest $now
foreach arg $argv {
if {![string compare $arg --test-tints]} {
showtints
+ } elseif {![string compare $arg --no-bell]} {
+ set bell_again -2
} else {
error "unknown option $arg"
}