Show
Ignore:
Timestamp:
06/30/08 15:35:13 (6 months ago)
Author:
james
Message:

tidy up

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/modules/system.tcl

    r908 r929  
    2323 
    2424 
    25 ### init our counters <<<1 
    26 bMotion_counter_init "system" "randomstuff" 
    27  
    28  
    29 ### Set up the binds <<<1 
    30  
    31 #General IRC events <<<2 
     25 
     26### Set up the binds  
     27 
     28#General IRC events  
    3229bind join - *!*@* bMotion_event_onjoin 
    3330bind mode - * bMotion_event_mode 
     
    3835bind ctcp - ACTION bMotion_event_action 
    3936 
    40 #bMotion IRC events <<<2 
     37#bMotion IRC events  
    4138bind pub - "!mood" pubm_moodhandler 
    4239bind pub - "!bminfo" bMotionInfo 
     
    4744bind pub - .bmotion bMotionAdminHandler2 
    4845 
    49 #DCC commands <<<2 
     46#DCC commands  
    5047bind dcc m mood moodhandler 
    5148bind dcc m bmotion* bMotion_dcc_command 
     
    5653bind time - "* * * * *" bMotion_check_tired2 
    5754 
    58 ### bMotion_update_chanlist <<<1 
     55# 
    5956# rebuilds our channel list based on which channels are +bmotion 
    6057proc bMotion_update_chanlist { } { 
     
    6865        } 
    6966} 
    70 ### Initalise some variables per channel <<<1 
     67 
     68# 
     69# Initalise some variables per channel  
    7170bMotion_update_chanlist 
     71 
    7272foreach chan $bMotionChannels { 
    7373        set bMotionLastEvent($chan) [clock seconds] 
     
    7676        #used to make the bot a bit more intelligent (perhaps) at conversations 
    7777        set bMotionCache($chan,last) 0 
    78         #channel mood tracker 
    79         #set bMotionCache($chan,mood) 0 
    80 } 
    81  
    82 ### bMotionStats <<<1 
     78} 
     79 
     80# bMotionStats  
     81# TODO: retire this 
    8382proc bMotionStats {nick host handle channel text} { 
    8483        global bMotionInfo botnicks bMotionSettings cvsinfo botnick 
     
    113112 
    114113 
    115  
     114# 
    116115# check if a channel is active enough for randomy things 
    117116proc bMotion_is_active_enough { channel { limit 0 } } { 
     
    143142} 
    144143 
     144# 
    145145# check if every channel we can see is idle enough for us to go away 
    146146proc bMotion_random_away {} { 
     
    193193} 
    194194 
     195# 
    195196# periodically sprout randomness (or go /away if idle enough) 
    196197proc doRandomStuff {} { 
     
    265266} 
    266267 
    267 ### bMotionSaySomethingRandom <<<1 
     268# 
     269# Output random gibberish 
    268270proc bMotionSaySomethingRandom {channel {busy 0}} { 
    269271        global randomStuff stonedRandomStuff mood bMotionInfo bMotionCache 
     
    303305 
    304306 
    305 ### bMotionSetRandomAway <<<1 
     307# 
     308#set myself away with a random message 
    306309proc bMotionSetRandomAway {} { 
    307         #set myself away with a random message 
    308310        global randomAways bMotionInfo bMotionSettings bMotionChannels 
    309311 
     
    321323} 
    322324 
    323 ### bMotionSetRandomBack <<<1 
     325# 
     326# set myself back 
    324327proc bMotionSetRandomBack {} { 
    325328        #set myself back 
     
    343346} 
    344347 
    345 ### bMotionTalkingToMe <<<1 
     348# 
     349# check if a line looks like it's addressed to me 
    346350proc bMotionTalkingToMe { text } { 
    347351        global botnicks 
     
    367371} 
    368372 
    369 ### bMotionSilence <<<1 
    370 # Makes the bot shut up 
     373# 
     374# We need to shut up 
    371375proc bMotionSilence {nick host channel} { 
    372376        global bMotionInfo silenceAways bMotionSettings 
     
    384388} 
    385389 
    386 ### bMotionUnSilence <<<1 
    387 # Undoes the shut up command 
     390# 
     391# Enough shutting up for now 
    388392proc bMotionUnSilence {} { 
    389393        # Timer for silence expires 
     
    395399} 
    396400 
    397 ### bMotionLike <<<1 
     401### bMotionLike  
    398402proc bMotionLike {nick { host "" }} { 
    399403        global bMotionInfo mood bMotionSettings 
     
    463467} 
    464468 
    465 ### bMotionGetGender <<<1 
     469### bMotionGetGender  
    466470proc bMotionGetGender { nick host } { 
    467471        set host "$nick!$host" 
     
    474478} 
    475479 
    476 ### getHour <<<1 
     480### getHour  
    477481proc getHour {} { 
    478482        return [clock format [clock seconds] -format "%H"] 
     
    480484 
    481485 
    482 ### bMotion_dcc_command <<<1 
     486### bMotion_dcc_command  
    483487proc bMotion_dcc_command { handle idx arg } { 
    484488        global bMotionInfo 
     
    564568} 
    565569 
    566 ### bMotion_dcc_help <<<1 
     570### bMotion_dcc_help  
    567571proc bMotion_dcc_help { handle idx arg } { 
    568572        putidx $idx "Please use .bmotion help" 
     
    572576 
    573577### new admin plugins ("management") 
    574 ### bMotionAdminHandler2 <<<1 
     578### bMotionAdminHandler2  
    575579proc bMotionAdminHandler2 {nick host handle channel text} { 
    576580        global botnicks bMotionInfo botnick bMotionSettings 
     
    631635 
    632636 
    633 ### bMotion_putadmin <<<1 
     637### bMotion_putadmin  
    634638proc bMotion_putadmin { text } { 
    635639 
     
    656660} 
    657661 
    658 ### bMotionAdminHandler <<<1 
     662### bMotionAdminHandler  
    659663#TODO: is this ever used now? 
    660664proc bMotionAdminHandler {nick host handle channel text} { 
     
    765769} 
    766770 
    767 ### msg_bmotioncommand <<<1 
     771### msg_bmotioncommand  
    768772proc msg_bmotioncommand { nick host handle cmd } { 
    769773        bMotion_plugins_settings_set "admin" "type" "" "" "irc" 
     
    808812} 
    809813 
    810 ### bMotion_get_number <<<1 
     814### bMotion_get_number  
    811815proc bMotion_get_number { num } { 
    812816        if {$num <= 0} { 
     
    817821} 
    818822 
    819 ### bMotion_rand_nonzero <<<1 
     823### bMotion_rand_nonzero  
    820824proc bMotion_rand_nonzero { limit } { 
    821825        if {$limit <= 0} { 
     
    829833} 
    830834 
    831 ### bMotion_startTimers <<<1 
     835### bMotion_startTimers  
    832836proc bMotion_startTimers { } { 
    833837        global mooddrifttimer 
     
    842846} 
    843847 
    844 ### bMotion_cleanNick <<<1 
     848### bMotion_cleanNick  
    845849proc bMotion_cleanNick { nick { handle "" } } { 
    846850        #attempt to clean []s etc out of nicks 
     
    865869} 
    866870 
    867 ### bMotion_uncolen <<<1 
     871### bMotion_uncolen  
    868872# clean out $£(($ off the end 
    869873proc bMotion_uncolen { line } { 
     
    872876} 
    873877 
    874 ### bMotion_setting_get <<<1 
     878### bMotion_setting_get  
    875879# get a setting out of the two variables that commonly hold them 
    876880proc bMotion_setting_get { setting } {