Changeset 883 for trunk/modules/system.tcl
- Timestamp:
- 02/11/08 18:45:21 (11 months ago)
- Files:
-
- 1 modified
-
trunk/modules/system.tcl (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/modules/system.tcl
r882 r883 941 941 # go to sleep 942 942 proc bMotion_go_to_sleep { } { 943 # ok this is the plan944 # 1. announce we feel tired945 # 2. ???946 # 3. sleep943 # ok this is the plan 944 # 1. announce we feel tired 945 # 2. ??? 946 # 3. sleep 947 947 global bMotionSettings BMOTION_SLEEP bMotionChannels 948 948 bMotion_update_chanlist … … 951 951 bMotion_putloglev 3 * "considering awake -> bedtime" 952 952 if {[rand 10] > 3} { 953 # announce we're tired953 # announce we're tired 954 954 set bMotionSettings(asleep) $BMOTION_SLEEP(BEDTIME) 955 955 putlog "bMotion: preparing to go to bed" … … 970 970 bMotion_putloglev 3 * "considering bedtime -> sleep" 971 971 if {[rand 10] > 3} { 972 set bMotionSettings(asleep) $BMOTION_SLEEP(ASLEEP) 973 putserv "AWAY :ZzZz" 974 # go to sleep 975 foreach chan $bMotionChannels { 976 if [bMotion_is_active_enough $chan] { 977 bMotion_putloglev 3 * "sending sleeping output to $chan" 978 bMotionDoAction $chan "" "%VAR{go_sleeps}" 979 } 980 } 981 putlog "bMotion: gone to sleep" 972 # go to sleep 982 973 set hour [bMotion_setting_get "wakeytime_hour"] 983 974 set minute [bMotion_setting_get "wakeytime_minute"] 984 975 set bMotionSettings(sleepy_nextchange) [bMotion_sleep_next_event "$hour:$minute"] 976 catch { 977 foreach chan $bMotionChannels { 978 if [bMotion_is_active_enough $chan] { 979 bMotion_putloglev 3 * "sending sleeping output to $chan" 980 bMotionDoAction $chan "" "%VAR{go_sleeps}" 981 } 982 } 983 } 984 set bMotionSettings(asleep) $BMOTION_SLEEP(ASLEEP) 985 putserv "AWAY :ZzZz" 986 putlog "bMotion: gone to sleep" 985 987 return 986 988 } else { … … 1002 1004 set bMotionSettings(asleep) $BMOTION_SLEEP(AWAKE) 1003 1005 putserv "AWAY" 1006 1007 set hour [bMotion_setting_get "bedtime_hour"] 1008 set minute [bMotion_setting_get "bedtime_minute"] 1009 set bMotionSettings(sleepy_nextchange) [bMotion_sleep_next_event "$hour:$minute"] 1004 1010 1005 1011 foreach chan $bMotionChannels { … … 1012 1018 } 1013 1019 1014 set hour [bMotion_setting_get "bedtime_hour"]1015 set minute [bMotion_setting_get "bedtime_minute"]1016 set bMotionSettings(sleepy_nextchange) [bMotion_sleep_next_event "$hour:$minute"]1017 1020 return 1018 1021 } else {
