Changeset 929 for trunk/modules/system.tcl
- Timestamp:
- 06/30/08 15:35:13 (6 months ago)
- Files:
-
- 1 modified
-
trunk/modules/system.tcl (modified) (30 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/modules/system.tcl
r908 r929 23 23 24 24 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 32 29 bind join - *!*@* bMotion_event_onjoin 33 30 bind mode - * bMotion_event_mode … … 38 35 bind ctcp - ACTION bMotion_event_action 39 36 40 #bMotion IRC events <<<237 #bMotion IRC events 41 38 bind pub - "!mood" pubm_moodhandler 42 39 bind pub - "!bminfo" bMotionInfo … … 47 44 bind pub - .bmotion bMotionAdminHandler2 48 45 49 #DCC commands <<<246 #DCC commands 50 47 bind dcc m mood moodhandler 51 48 bind dcc m bmotion* bMotion_dcc_command … … 56 53 bind time - "* * * * *" bMotion_check_tired2 57 54 58 # ## bMotion_update_chanlist <<<155 # 59 56 # rebuilds our channel list based on which channels are +bmotion 60 57 proc bMotion_update_chanlist { } { … … 68 65 } 69 66 } 70 ### Initalise some variables per channel <<<1 67 68 # 69 # Initalise some variables per channel 71 70 bMotion_update_chanlist 71 72 72 foreach chan $bMotionChannels { 73 73 set bMotionLastEvent($chan) [clock seconds] … … 76 76 #used to make the bot a bit more intelligent (perhaps) at conversations 77 77 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 83 82 proc bMotionStats {nick host handle channel text} { 84 83 global bMotionInfo botnicks bMotionSettings cvsinfo botnick … … 113 112 114 113 115 114 # 116 115 # check if a channel is active enough for randomy things 117 116 proc bMotion_is_active_enough { channel { limit 0 } } { … … 143 142 } 144 143 144 # 145 145 # check if every channel we can see is idle enough for us to go away 146 146 proc bMotion_random_away {} { … … 193 193 } 194 194 195 # 195 196 # periodically sprout randomness (or go /away if idle enough) 196 197 proc doRandomStuff {} { … … 265 266 } 266 267 267 ### bMotionSaySomethingRandom <<<1 268 # 269 # Output random gibberish 268 270 proc bMotionSaySomethingRandom {channel {busy 0}} { 269 271 global randomStuff stonedRandomStuff mood bMotionInfo bMotionCache … … 303 305 304 306 305 ### bMotionSetRandomAway <<<1 307 # 308 #set myself away with a random message 306 309 proc bMotionSetRandomAway {} { 307 #set myself away with a random message308 310 global randomAways bMotionInfo bMotionSettings bMotionChannels 309 311 … … 321 323 } 322 324 323 ### bMotionSetRandomBack <<<1 325 # 326 # set myself back 324 327 proc bMotionSetRandomBack {} { 325 328 #set myself back … … 343 346 } 344 347 345 ### bMotionTalkingToMe <<<1 348 # 349 # check if a line looks like it's addressed to me 346 350 proc bMotionTalkingToMe { text } { 347 351 global botnicks … … 367 371 } 368 372 369 # ## bMotionSilence <<<1370 # Makes the botshut up373 # 374 # We need to shut up 371 375 proc bMotionSilence {nick host channel} { 372 376 global bMotionInfo silenceAways bMotionSettings … … 384 388 } 385 389 386 # ## bMotionUnSilence <<<1387 # Undoes the shut up command390 # 391 # Enough shutting up for now 388 392 proc bMotionUnSilence {} { 389 393 # Timer for silence expires … … 395 399 } 396 400 397 ### bMotionLike <<<1401 ### bMotionLike 398 402 proc bMotionLike {nick { host "" }} { 399 403 global bMotionInfo mood bMotionSettings … … 463 467 } 464 468 465 ### bMotionGetGender <<<1469 ### bMotionGetGender 466 470 proc bMotionGetGender { nick host } { 467 471 set host "$nick!$host" … … 474 478 } 475 479 476 ### getHour <<<1480 ### getHour 477 481 proc getHour {} { 478 482 return [clock format [clock seconds] -format "%H"] … … 480 484 481 485 482 ### bMotion_dcc_command <<<1486 ### bMotion_dcc_command 483 487 proc bMotion_dcc_command { handle idx arg } { 484 488 global bMotionInfo … … 564 568 } 565 569 566 ### bMotion_dcc_help <<<1570 ### bMotion_dcc_help 567 571 proc bMotion_dcc_help { handle idx arg } { 568 572 putidx $idx "Please use .bmotion help" … … 572 576 573 577 ### new admin plugins ("management") 574 ### bMotionAdminHandler2 <<<1578 ### bMotionAdminHandler2 575 579 proc bMotionAdminHandler2 {nick host handle channel text} { 576 580 global botnicks bMotionInfo botnick bMotionSettings … … 631 635 632 636 633 ### bMotion_putadmin <<<1637 ### bMotion_putadmin 634 638 proc bMotion_putadmin { text } { 635 639 … … 656 660 } 657 661 658 ### bMotionAdminHandler <<<1662 ### bMotionAdminHandler 659 663 #TODO: is this ever used now? 660 664 proc bMotionAdminHandler {nick host handle channel text} { … … 765 769 } 766 770 767 ### msg_bmotioncommand <<<1771 ### msg_bmotioncommand 768 772 proc msg_bmotioncommand { nick host handle cmd } { 769 773 bMotion_plugins_settings_set "admin" "type" "" "" "irc" … … 808 812 } 809 813 810 ### bMotion_get_number <<<1814 ### bMotion_get_number 811 815 proc bMotion_get_number { num } { 812 816 if {$num <= 0} { … … 817 821 } 818 822 819 ### bMotion_rand_nonzero <<<1823 ### bMotion_rand_nonzero 820 824 proc bMotion_rand_nonzero { limit } { 821 825 if {$limit <= 0} { … … 829 833 } 830 834 831 ### bMotion_startTimers <<<1835 ### bMotion_startTimers 832 836 proc bMotion_startTimers { } { 833 837 global mooddrifttimer … … 842 846 } 843 847 844 ### bMotion_cleanNick <<<1848 ### bMotion_cleanNick 845 849 proc bMotion_cleanNick { nick { handle "" } } { 846 850 #attempt to clean []s etc out of nicks … … 865 869 } 866 870 867 ### bMotion_uncolen <<<1871 ### bMotion_uncolen 868 872 # clean out $£(($ off the end 869 873 proc bMotion_uncolen { line } { … … 872 876 } 873 877 874 ### bMotion_setting_get <<<1878 ### bMotion_setting_get 875 879 # get a setting out of the two variables that commonly hold them 876 880 proc bMotion_setting_get { setting } {
