Changeset 1004
- Timestamp:
- 04/28/09 19:23:31 (3 years ago)
- Location:
- trunk
- Files:
-
- 3 edited
-
modules/plugins.tcl (modified) (1 diff)
-
modules/system.tcl (modified) (12 diffs)
-
plugins/admin_general.tcl (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/modules/plugins.tcl
r961 r1004 188 188 foreach key [array names bMotion_plugins_management] { 189 189 if [string match -nocase $name $key] { 190 set blah $bMotion_plugins_management($key) 190 191 set helpcallback [lindex $blah $BMOTION_PLUGIN_MANAGEMENT_HELPCALLBACK] 191 192 return $helpcallback -
trunk/modules/system.tcl
r1003 r1004 166 166 global bMotionChannels bMotionInfo 167 167 168 bMotion_putloglev 4 * "bMotion_random_away" 169 168 170 set timeNow [clock seconds] 169 171 … … 171 173 if {[bMotion_setting_get "bitlbee"]} { 172 174 #never go away in bitlbee 175 bMotion_putloglev "going away is disabled in bitlbee mode" 173 176 return 0 174 177 } … … 176 179 #override if we should never go away 177 180 if {[bMotion_setting_get "useAway"] != 1} { 181 bMotion_putloglev "going away is disabled" 178 182 return 0 179 183 } … … 196 200 197 201 if {($timeNow - $mostRecent) < $gapTime} { 202 bMotion_putloglev 1 * "most recent is busy enough, not going away" 198 203 return 0 199 204 } … … 201 206 if {$bMotionInfo(away) == 1} { 202 207 #away, don't do anything (and don't do randomstuff) 208 bMotion_putloglev d * "I'm already away, not going away again" 203 209 return 0 204 210 } … … 208 214 bMotionSetRandomAway 209 215 return 1 216 } else { 217 bMotion_putloglev d * "All channels are idle, not going away though" 210 218 } 211 219 … … 220 228 global BMOTION_SLEEP 221 229 230 bMotion_putloglev 4 * "doRandomStuff" 231 222 232 set saidChannels [list] 223 233 set silentChannels [list] … … 233 243 set temp [expr [rand $upperLimit] + $bMotionInfo(minRandomDelay)] 234 244 timer $temp doRandomStuff 235 bMotion_putloglev d * "bMotion: randomStuff next ($temp minutes)"245 bMotion_putloglev d * "bMotion: randomStuff next in $temp minutes" 236 246 237 247 # don't bother if we're asleep … … 244 254 245 255 if [bMotion_random_away] { 246 # we went away, so stop here 256 # we went away, so stop here 257 bMotion_putloglev d * "we went away, returning from doRandomStuff" 247 258 return 248 259 } 249 260 250 261 if {$bMotionInfo(away) == 1} { 251 #away and busy again, return 262 #away and busy again, return 263 bMotion_putloglev d * "was away, setting myself back" 252 264 bMotionSetRandomBack 253 265 } 254 266 255 267 if {[bMotion_setting_get "bitlbee"] == "1"} { 268 bMotion_putloglev d * "aborting randomstuff, don't do it in bitlbee mode" 256 269 return 0 257 270 } … … 329 342 proc bMotionSetRandomAway {} { 330 343 global randomAways bMotionInfo bMotionSettings bMotionChannels 344 bMotion_putloglev 4 * "bMotionSetRandomAway" 331 345 332 346 set awayReason [bMotion_abstract_get "randomAways"] … … 348 362 #set myself back 349 363 global bMotionInfo bMotionSettings bMotionChannels 364 bMotion_putloglev 4 * "bMotionSetRandomBack" 350 365 351 366 bMotion_update_chanlist … … 353 368 set bMotionInfo(away) 0 354 369 set bMotionInfo(silence) 0 370 bMotion_putloglev d * "No longer silent or away" 355 371 foreach channel $bMotionChannels { 356 372 if {[lsearch $bMotionSettings(noAwayFor) $channel] == -1} { -
trunk/plugins/admin_general.tcl
r963 r1004 1 1 # bMotion admin plugins 2 2 # 3 #4 # $Id$5 #6 3 7 4 ############################################################################### 8 5 # This is a bMotion plugin 9 # Copyright (C) James Michael Seward 2000-200 26 # Copyright (C) James Michael Seward 2000-2009 10 7 # 11 8 # This program is covered by the GPL, please refer the to LICENCE file in the … … 24 21 bMotion_plugin_add_management "interbot" "^interbot" n bMotion_plugin_management_interbot "any" bMotion_plugin_management_interbot_help 25 22 bMotion_plugin_add_management "flux" "^flux capacitors?" n bMotion_plugin_management_flux "any" 23 bMotion_plugin_add_management "away" "^away" n bMotion_plugin_management_away "any" bMotion_plugin_management_away_help 26 24 27 25 ################################################################################################################################# … … 67 65 bMotion_putadmin "Random stuff happens at least every [bMotion_setting_get minRandomDelay]min, at most every [bMotion_setting_get maxRandomDelay]min, and not if channel quiet for more than [bMotion_setting_get maxIdleGap]min. Active channels have a line in the last [bMotion_setting_get active_idle_sec]sec." 68 66 if [bMotion_setting_get silence] { 69 bMotion_putadmin "Running silent" 67 bMotion_putadmin "I am silent." 68 } 69 if [bMotion_setting_get "away"] { 70 bMotion_putadmin "I am away." 70 71 } 71 72 … … 313 314 } 314 315 } 316 317 proc bMotion_plugin_management_away { handle { text "" } } { 318 global bMotionInfo 319 320 if {$text == ""} { 321 if {$bMotionInfo(away)} { 322 bMotion_putadmin "I am currently away." 323 } else { 324 bMotion_putadmin "I am not away." 325 } 326 return 327 } 328 329 if {$text == "off"} { 330 bMotion_putadmin "Coming back from being away." 331 set bMotionInfo(away) 0 332 set bMotionInfo(silent) 0 333 return 334 } 335 336 bMotion_putadmin "Use: .bmotion away [off]" 337 } 338 339 proc bMotion_plugin_management_away_help { } { 340 bMotion_putadmin "Check and adjust the bot's away status" 341 bMotion_putadmin " .bmotion away" 342 bMotion_putadmin " Show if the bot is away or not" 343 bMotion_putadmin " .bmotion away off" 344 bMotion_putadmin " Make the bot be not-away" 345 } 346
Note: See TracChangeset
for help on using the changeset viewer.
