Ignore:
Timestamp:
04/28/09 19:23:31 (3 years ago)
Author:
james
Message:

Add new away admin plugin
Add some debug to randomstuff/away code
Include away status in .bmotion status
Fix .bmotion help being broken

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/plugins/admin_general.tcl

    r963 r1004  
    11# bMotion admin plugins 
    22# 
    3 # 
    4 # $Id$ 
    5 # 
    63 
    74############################################################################### 
    85# This is a bMotion plugin 
    9 # Copyright (C) James Michael Seward 2000-2002 
     6# Copyright (C) James Michael Seward 2000-2009 
    107# 
    118# This program is covered by the GPL, please refer the to LICENCE file in the 
     
    2421bMotion_plugin_add_management "interbot" "^interbot" n bMotion_plugin_management_interbot "any" bMotion_plugin_management_interbot_help 
    2522bMotion_plugin_add_management "flux" "^flux capacitors?" n bMotion_plugin_management_flux "any" 
     23bMotion_plugin_add_management "away" "^away" n bMotion_plugin_management_away "any" bMotion_plugin_management_away_help 
    2624 
    2725################################################################################################################################# 
     
    6765        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." 
    6866        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." 
    7071        } 
    7172 
     
    313314                } 
    314315} 
     316 
     317proc 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 
     339proc 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.