return "funcs5to8 2 $value"
}
-proc maybechange {thing} {
+proc maybechange {thing force} {
global $thing ch
upvar #0 ${thing}_fixed fixed
if {![info exists fixed]} {
- set rb 0x[randbyte][randbyte]
- if {
- $rb / 65536.0 >
- 1.0 / (($ch(${thing}every) - $ch(minint)*0.001) * $ch(scale))
- } {
- debug "maybechange $thing rb=$rb no"
- return 0
+ if {$force} {
+ debug "maybechange $thing forced ..."
+ } else {
+ set rb 0x[randbyte][randbyte]
+ if {
+ $rb / 65536.0 >
+ 1.0 / (($ch(${thing}every) - $ch(minint)*0.001) * $ch(scale))
+ } {
+ debug "maybechange $thing rb=$rb no"
+ return 0
+ }
+ debug "maybechange $thing rb=$rb yes ..."
}
- debug "maybechange $thing rb=$rb yes ..."
set l [new$thing]
} else {
debug "fixed $thing $fixed"
proc changewhat {} {
global ch chwa
catch { after cancel $chwa }
- if {[maybechange speeddirn] || [maybechange funcs]} {
+ if {[maybechange speeddirn 0] || [maybechange funcs 0]} {
set interval $ch(minint)
} else {
set interval 1000
#----------
# for keyboard control
-proc ask_fast {} {
- global speeddirn_fixed; set speeddirn_fixed {speed126 2 126 0}
-}
-proc ask_slow {} {
- global speeddirn_fixed; set speeddirn_fixed {speed126 2 10 0}
+proc ask_speed_now {l} {
+ global speeddirn_fixed
+ set speeddirn_fixed $l
+ maybechange speeddirn 1
}
+
+proc ask_fast {} { ask_speed_now {speed126 2 126 0} }
+proc ask_slow {} { ask_speed_now {speed126 2 10 0} }
proc ask_randspeed {} {
global speeddirn_fixed; catch { unset speeddirn_fixed }
+ maybechange speeddirn 1
}
proc ask_manual {rightp} { global pointasked; set pointasked M$rightp }