Changeset 868
- Timestamp:
- 11/03/07 19:31:06 (14 months ago)
- Location:
- trunk
- Files:
-
- 3 modified
-
modules/interbot.tcl (modified) (9 diffs)
-
modules/settings.sample.tcl (modified) (1 diff)
-
plugins/admin_general.tcl (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/modules/interbot.tcl
r832 r868 22 22 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 23 23 ############################################################################### 24 25 # allow people to turn off the interbot stuff if they don't want it 26 # these values should be set in the settings file, but we'll define 27 # some defaults here 28 29 if {![info exists bMotion_interbot_enable]} { 30 set bMotion_interbot_enable 1 31 } 24 32 25 33 # Elect a new bot to speak for each channel … … 31 39 32 40 global bMotionInfo bMotion_interbot_timer bMotionChannels 41 global bMotion_interbot_enable 42 43 if {!$bMotion_interbot_enable} { 44 return 45 } 46 33 47 catch { 34 48 foreach chan $bMotionChannels { … … 112 126 #another bot is forcing an election 113 127 global bMotion_interbot_nextbot_score bMotion_interbot_nextbot_nick botnick bMotionInfo 114 global BMOTION_SLEEP bMotionSettings 128 global BMOTION_SLEEP bMotionSettings bMotion_interbot_enable 129 130 if {![info exists bMotion_interbot_enable]} { 131 return 132 } 133 115 134 bMotion_putloglev 1 * "bMotion: Incoming election from $bot" 116 135 … … 167 186 proc bMotionSendSayChan { channel text thisBot} { 168 187 #replace all ¬ with % 188 global bMotion_interbot_enable 189 190 if {!$bMotion_interbot_enable} { 191 return "" 192 } 193 169 194 set text [bMotionInsertString $text "¬" "%"] 170 195 bMotion_putloglev 1 * "bMotion: pushing command say ($channel $text) to $thisBot" … … 208 233 proc bMotion_interbot_me_next { channel } { 209 234 global bMotion_interbot_nextbot_nick bMotion_interbot_nextbot_score botnick 235 global bMotion_interbot_enable 210 236 211 237 set channel [string tolower $channel] 238 239 if {!$bMotion_interbot_enable} { 240 # if interbot stuff is turned off, we'll have to assume we should respond 241 # else we'd never say anything... 242 return 1 243 } 212 244 213 245 bMotion_putloglev 2 * "checking interbot_me_next for $channel" … … 287 319 proc bMotion_interbot_hay { bot channels } { 288 320 #we've met another bmotion bot, we need to tell it what channels we're on 289 global bMotion_interbot_otherbots network bMotionChannels 321 global bMotion_interbot_otherbots network bMotionChannels bMotion_interbot_enable 322 323 if {!$bMotion_interbot_enable} { 324 return 325 } 326 290 327 bMotion_update_chanlist 291 328 if [regexp -nocase {(.+) network:(.+)} $channels matches chans nw] { … … 307 344 proc bMotion_interbot_sup { bot channels } { 308 345 #we've met another bmotion bot 309 global bMotion_interbot_otherbots 346 global bMotion_interbot_otherbots bMotion_interbot_enable 347 348 if {!$bMotion_interbot_enable} { 349 return 350 } 351 310 352 set bMotion_interbot_otherbots($bot) $channels 311 353 bMotion_putloglev d * "bMotion: bMotion bot $bot on channels $channels" … … 320 362 proc bMotion_interbot_resync { } { 321 363 #let's find out who's on the botnet 322 global bMotion_interbot_otherbots network bMotionChannels 364 global bMotion_interbot_otherbots network bMotionChannels bMotion_interbot_enable 365 366 utimer [expr [rand 900] + 300] bMotion_interbot_resync 367 368 if {$bMotion_interbot_enable != 1} { 369 return 370 } 371 323 372 bMotion_update_chanlist 324 373 unset bMotion_interbot_otherbots … … 327 376 putloglev d * "bMotion: Resyncing with botnet for bMotion bots" 328 377 putallbots "bmotion HAY $bMotionChannels ($network)" 329 utimer [expr [rand 900] + 300] bMotion_interbot_resync330 378 } 331 379 -
trunk/modules/settings.sample.tcl
r834 r868 142 142 set bMotionSettings(typingSpeed) 0.05 143 143 144 # use the interbot stuff? 145 # by default, bMotion will broadcast on the botnet to find other bMotions 146 # so that it can talk to them (when they're in the same channel) 147 set bMotion_interbot_enable 1 144 148 145 149 -
trunk/plugins/admin_general.tcl
r847 r868 22 22 bMotion_plugin_add_management "settings" "^settings" n bMotion_plugin_management_settings "any" 23 23 bMotion_plugin_add_management "global" "^global" n bMotion_plugin_management_global "any" 24 bMotion_plugin_add_management "interbot" "^interbot" n bMotion_plugin_management_interbot "any" 24 bMotion_plugin_add_management "interbot" "^interbot" n bMotion_plugin_management_interbot "any" bMotion_plugin_management_interbot_help 25 25 bMotion_plugin_add_management "flux" "^flux capacitors?" n bMotion_plugin_management_flux "any" 26 26 … … 244 244 bMotion_putadmin [bMotion_interbot_otherbots $chan] 245 245 } 246 247 if [regexp -nocase "enable" $text] { 248 global bMotion_interbot_enable 249 250 if {$bMotion_interbot_enable} { 251 bMotion_putadmin "Interbot stuff is already enabled." 252 return 253 } else { 254 set bMotion_interbot_enable 1 255 bMotion_putadmin "Interbot stuff enabled." 256 return 257 } 258 } 259 260 if [regexp -nocase "disable" $text] { 261 global bMotion_interbot_enable 262 263 if {!$bMotion_interbot_enable} { 264 bMotion_putadmin "Interbot stuff is already disabled." 265 return 266 } else { 267 set bMotion_interbot_enable 0 268 bMotion_putadmin "Interbot stuff disabled." 269 return 270 } 271 } 272 } 273 274 proc bMotion_plugin_management_interbot_help { } { 275 bMotion_putadmin "Manage the interbot communication stuff." 276 bMotion_putadmin " .bmotion interbot next #channel" 277 bMotion_putadmin " Report the next bot for #channel" 278 bMotion_putadmin " .bmotion interbot elect #channel" 279 bMotion_putadmin " Force an election for #channel" 280 bMotion_putadmin " .bmotion interbot bots #channel" 281 bMotion_putadmin " Report bots discovered in #channel" 282 bMotion_putadmin " .bmotion interbot enable" 283 bMotion_putadmin " .bmotion interbot disable" 284 bMotion_putadmin " Enable/disable interbot stuff entirely" 246 285 } 247 286
