- Timestamp:
- 02/17/08 18:54:27 (11 months ago)
- Location:
- trunk
- Files:
-
- 10 modified
-
modules/abstract.tcl (modified) (1 diff)
-
modules/abstracts/en/abstracts.tcl (modified) (2 diffs)
-
modules/friendship.tcl (modified) (2 diffs)
-
modules/output.tcl (modified) (48 diffs)
-
modules/system.tcl (modified) (5 diffs)
-
plugins/en/action_complex_attack.tcl (modified) (1 diff)
-
plugins/en/action_complex_fucks.tcl (modified) (1 diff)
-
plugins/en/action_complex_hands.tcl (modified) (6 diffs)
-
plugins/en/complex_love.tcl (modified) (1 diff)
-
plugins/en/complex_nightmare.tcl (modified) (7 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/modules/abstract.tcl
r862 r891 344 344 } 345 345 346 } 347 348 # look to see if an abstract contains an item (warning: could be slow) 349 proc bMotion_abstract_contains { abstract item } { 350 bMotion_putloglev 4 * "abstract: bMotion_abstract_contains $abstract $item" 351 352 set contents [bMotion_abstract_all $abstract] 353 putlog $contents 354 355 if {[llength $contents] == 0} { 356 return 0 357 } 358 359 set location [lsearch $contents $item] 360 if {$location > -1} { 361 return 1 362 } else { 363 return 0 364 } 346 365 } 347 366 -
trunk/modules/abstracts/en/abstracts.tcl
r882 r891 1028 1028 bMotion_abstract_register "lols" 1029 1029 bMotion_abstract_register "lostPlot" 1030 bMotion_abstract_register "loveresponses"1031 1030 bMotion_abstract_register "makeItSos" 1032 1031 bMotion_abstract_register "mingreplies" … … 1124 1123 bMotion_abstract_batchadd "sorryoks" [list "ok" "that's ok" "alright then" "i forgive you" "/spanks %%%|%BOT\[¬VAR{rarrs}\]" "That's ok then. I suppose. Don't think this makes me like you again though" "humph" ] 1125 1124 1126 bMotion_abstract_batchadd "loveresponses" [list "awww thanks" "i love you too" "i wuv you too" "and i love you" "and i wuv you" "aww wuv you too" "awww *giggle*" "i love you just as much" "i want to have your babies" "/blushes" "hehe thanks" "you know, I've always loved you the most" ":*" ":x" ] 1125 bMotion_abstract_register "loveresponses" { 1126 "awww thanks" 1127 "i love you too" 1128 "i wuv you too" 1129 "and i love you" 1130 "and i wuv you" 1131 "aww wuv you too" 1132 "awww *giggle*" 1133 "i love you just as much" 1134 "i want to have your babies" 1135 "/blushes" 1136 "hehe thanks" 1137 "you know, I've always loved you the most" 1138 ":*" 1139 ":x" 1140 "and i love you th%REPEAT{3:7:i}s much: <%REPEAT{10:50:-}>" 1141 } 1142 1143 bMotion_abstract_register "loveresponses_male" { 1144 "and i love you th%REPEAT{3:7:i}s much:%|*schwing*%|%VAR{oops}" 1145 } 1127 1146 1128 1147 bMotion_abstract_batchadd "hugs" [list "*hugs %%*" "/huggles %%" "/snuggles %%" "*snuggles %%*" "/huggles with %%" "/squeezes %%" "/snoofles %%" ] -
trunk/modules/friendship.tcl
r889 r891 63 63 proc setFriendshipHandle { handle friendship } { 64 64 if {$friendship > 100} { 65 bMotion_putloglev 2 * "friendship: friendship for $ nickwent over 100, capping back to 90"65 bMotion_putloglev 2 * "friendship: friendship for $handle went over 100, capping back to 90" 66 66 set friendship 90 67 67 } 68 68 69 69 if {$friendship < 1} { 70 bMotion_putloglev 2 * "friendship: friendship for $ nickwent under 1, capping back to 10"70 bMotion_putloglev 2 * "friendship: friendship for $handle went under 1, capping back to 10" 71 71 set friendship 10 72 72 } … … 85 85 if {![validuser $nick]} { 86 86 bMotion_putloglev 1 * "friendship: couldn't find a handle for $nick to set friendship." 87 return 5087 return 0 88 88 } 89 89 set handle $nick 90 90 } 91 91 92 93 if {$friendship > 100} { 94 bMotion_putloglev 2 * "friendship: friendship for $nick went over 100, capping back to 9" 95 set friendship 99 96 } 97 98 if {$friendship < 0} { 99 bMotion_putloglev 2 * "friendship: friendship for $nick went under 0, capping back to 1" 100 set friendship 1 101 } 102 103 104 catch { 105 setuser $handle XTRA friend $friendship 106 } 92 setFriendshipHandle $handle $friendship 107 93 } 108 94 -
trunk/modules/output.tcl
r882 r891 31 31 32 32 proc pickRandom { list } { 33 bMotion_putloglev 5 * "pickRandom ($list)"33 bMotion_putloglev 5 * "pickRandom ($list)" 34 34 return [lindex $list [rand [llength $list]]] 35 35 } 36 36 37 37 proc getPronoun {} { 38 bMotion_putloglev 5 * "getPronoun"38 bMotion_putloglev 5 * "getPronoun" 39 39 global bMotionInfo 40 40 if {$bMotionInfo(gender) == "male"} { return "himself" } … … 44 44 45 45 proc getHisHers {} { 46 bMotion_putloglev 5 * "getHisHers"46 bMotion_putloglev 5 * "getHisHers" 47 47 global bMotionInfo 48 48 if {$bMotionInfo(gender) == "male"} { return "his" } … … 52 52 53 53 proc getHisHer {} { 54 bMotion_putloglev 5 * "getHisHer"54 bMotion_putloglev 5 * "getHisHer" 55 55 global bMotionInfo 56 56 if {$bMotionInfo(gender) == "male"} { return "his" } … … 61 61 62 62 proc getHeShe {} { 63 bMotion_putloglev 5 * "getHeShe"63 bMotion_putloglev 5 * "getHeShe" 64 64 global bMotionInfo 65 65 if {$bMotionInfo(gender) == "male"} { return "he" } … … 70 70 71 71 proc mee {channel action {urgent 0} } { 72 bMotion_putloglev 5 * "mee ($channel, $action, $urgent)"72 bMotion_putloglev 5 * "mee ($channel, $action, $urgent)" 73 73 set channel [chandname2name $channel] 74 74 if {$urgent} { … … 84 84 bMotion_putloglev 5 * "bMotionDoAction($channel,$nick,$text,$moreText,$noTypo)" 85 85 global bMotionInfo bMotionCache bMotionOriginalInput 86 global bMotion_output_delay bMotionSettings BMOTION_SLEEP87 88 set bMotion_output_delay 086 global bMotion_output_delay bMotionSettings BMOTION_SLEEP 87 88 set bMotion_output_delay 0 89 89 90 90 set bMotionCache($channel,last) 1 … … 96 96 } 97 97 98 # check if we're asleep99 if {$bMotionSettings(asleep) == $BMOTION_SLEEP(ASLEEP)} {100 return 0101 }98 # check if we're asleep 99 if {$bMotionSettings(asleep) == $BMOTION_SLEEP(ASLEEP)} { 100 return 0 101 } 102 102 103 103 if [regexp "^\[#!\].+" $channel] { 104 104 set channel [string tolower $channel] 105 if {![channel get $channel bmotion]} {105 if {![channel get $channel bmotion]} { 106 106 bMotion_putloglev d * "bMotion: aborting bMotionDoAction ... $channel not allowed" 107 107 return 0 … … 137 137 138 138 while {[string match "*%|*" $text]} { 139 set origtext $text139 set origtext $text 140 140 set sentence [string range $text 0 [expr [string first "%|" $text] -1]] 141 141 if {$sentence != ""} { … … 148 148 } 149 149 set text [string range $text [expr [string first "%|" $text] + 2] end] 150 if {$text == $origtext} {150 if {$text == $origtext} { 151 151 putlog "bMotion ALERT! Bailed in bMotionDoAction with $text. Lost output." 152 152 return 0 … … 341 341 342 342 proc bMotionInterpolation2 { line } { 343 bMotion_putloglev 5 * "bMotionInterpolation2 ($line)"343 bMotion_putloglev 5 * "bMotionInterpolation2 ($line)" 344 344 #owners 345 345 set loops 0 … … 348 348 set BOOM [string map {\\ \\\\ [ \\\[ ] \\\] \{ \\\{ \} \\\} $ \\\$ \" \\\" | \\\|} $BOOM] 349 349 350 incr loops351 if {$loops > 10} {352 putlog "bMotion: ALERT! looping too much in %OWNER code with $line"353 set line "/has a tremendous error while trying to sort something out :("354 }355 # set line [bMotionInsertString $line "%OWNER\{$BOOM\}" [bMotionMakePossessive $BOOM]]356 regsub -nocase "%OWNER\{$BOOM\}" $line [bMotionMakePossessive $BOOM] line357 regsub -all "\\\\" $line "" line358 }359 360 set loops 0361 while {[regexp -nocase "%VERB\{(.*?)\}" $line matches BOOM]} {362 incr loops363 if {$loops > 10} {364 putlog "bMotion: ALERT! looping too much in %VERB code with $line"365 set line "/has a tremendous error while trying to sort something out :("366 }367 # set line [bMotionInsertString $line "%VERB\{$BOOM\}" [bMotionMakeVerb $BOOM]]368 regsub -nocase "%VERB\{$BOOM\}" $line [bMotionMakeVerb $BOOM] line369 }370 371 set loops 0372 while {[regexp -nocase "%PLURAL\{(.*?)\}" $line matches BOOM]} {373 incr loops374 if {$loops > 10} {375 putlog "bMotion: ALERT! looping too much in %PLURAL code with $line"376 set line "/has a tremendous error while trying to sort something out :("377 }378 # set line [bMotionInsertString $line "%PLURAL\{$BOOM\}" [bMotionMakePlural $BOOM]]379 regsub -nocase "%PLURAL\{$BOOM\}" $line [bMotionMakePlural $BOOM] line380 }381 382 set loops 0383 while {[regexp -nocase "%REPEAT\{(.+?)\}" $line matches BOOM]} {384 incr loops385 if {$loops > 10} {386 putlog "bMotion: ALERT! looping too much in %REPEAT code with $line"387 set line "/has a tremendous error while trying to sort something out :("388 }389 set replacement [bMotionMakeRepeat $BOOM]390 regsub -nocase "%REPEAT\\{$BOOM\\}" $line $replacement line391 }392 393 return $line350 incr loops 351 if {$loops > 10} { 352 putlog "bMotion: ALERT! looping too much in %OWNER code with $line" 353 set line "/has a tremendous error while trying to sort something out :(" 354 } 355 # set line [bMotionInsertString $line "%OWNER\{$BOOM\}" [bMotionMakePossessive $BOOM]] 356 regsub -nocase "%OWNER\{$BOOM\}" $line [bMotionMakePossessive $BOOM] line 357 regsub -all "\\\\" $line "" line 358 } 359 360 set loops 0 361 while {[regexp -nocase "%VERB\{(.*?)\}" $line matches BOOM]} { 362 incr loops 363 if {$loops > 10} { 364 putlog "bMotion: ALERT! looping too much in %VERB code with $line" 365 set line "/has a tremendous error while trying to sort something out :(" 366 } 367 # set line [bMotionInsertString $line "%VERB\{$BOOM\}" [bMotionMakeVerb $BOOM]] 368 regsub -nocase "%VERB\{$BOOM\}" $line [bMotionMakeVerb $BOOM] line 369 } 370 371 set loops 0 372 while {[regexp -nocase "%PLURAL\{(.*?)\}" $line matches BOOM]} { 373 incr loops 374 if {$loops > 10} { 375 putlog "bMotion: ALERT! looping too much in %PLURAL code with $line" 376 set line "/has a tremendous error while trying to sort something out :(" 377 } 378 # set line [bMotionInsertString $line "%PLURAL\{$BOOM\}" [bMotionMakePlural $BOOM]] 379 regsub -nocase "%PLURAL\{$BOOM\}" $line [bMotionMakePlural $BOOM] line 380 } 381 382 set loops 0 383 while {[regexp -nocase "%REPEAT\{(.+?)\}" $line matches BOOM]} { 384 incr loops 385 if {$loops > 10} { 386 putlog "bMotion: ALERT! looping too much in %REPEAT code with $line" 387 set line "/has a tremendous error while trying to sort something out :(" 388 } 389 set replacement [bMotionMakeRepeat $BOOM] 390 regsub -nocase "%REPEAT\\{$BOOM\\}" $line $replacement line 391 } 392 393 return $line 394 394 } 395 395 … … 397 397 bMotion_putloglev 5 * "bMotionSayLine: channel = $channel, nick = $nick, line = $line, moreText = $moreText, noTypo = $noTypo" 398 398 global mood botnick bMotionInfo bMotionCache bMotionOriginalInput 399 global bMotion_output_delay399 global bMotion_output_delay 400 400 401 401 set line [bMotionInterpolation2 $line] … … 408 408 set dobreak 0 409 409 if {$botcmd == "bot"} { 410 #random410 #random 411 411 bMotion_putloglev 1 * "bMotion: %bot detected" 412 412 regexp {%bot\[([[:digit:]]+),(@[^,]+,)?(.+)\]} $line matches chance condition cmd … … 420 420 } 421 421 } else { 422 #non-random423 regexp {%BOT\[(@[^,]+,)?(.+)\]} $line matches condition cmd422 #non-random 423 regexp {%BOT\[(@[^,]+,)?(.+)\]} $line matches condition cmd 424 424 } 425 425 … … 452 452 453 453 if [regexp {%DELAY\{([0-9]+)\}} $line matches delay] { 454 set bMotion_output_delay $delay455 bMotion_putloglev d * "Changing output delay to $delay"456 set line ""454 set bMotion_output_delay $delay 455 bMotion_putloglev d * "Changing output delay to $delay" 456 set line "" 457 457 } 458 458 … … 482 482 } 483 483 if {$result == ""} { 484 return 0484 return 0 485 485 } 486 486 set line $result … … 494 494 } 495 495 496 if {[string index $line end] == " "} {497 set line [string range $line 0 end-1]498 }496 if {[string index $line end] == " "} { 497 set line [string range $line 0 end-1] 498 } 499 499 500 500 #check if this line matches the last line said on IRC … … 504 504 return 0 505 505 } 506 507 #protect this block - it'll generate an error if noone's talked yet, and then 508 #we try an admin plugin 509 if [info exists bMotionOriginalInput] { 510 if [string match -nocase $bMotionOriginalInput $line] { 511 bMotion_putloglev 1 * "my output matches the trigger, dropping" 512 return 0 513 } 514 } 515 516 set line [bMotionInsertString $line "%slash" "/"] 517 518 global bMotion_output_delay 519 520 if [regexp "^/" $line] { 521 #it's an action 522 mee $channel [string range $line 1 end] $urgent 506 507 #protect this block - it'll generate an error if noone's talked yet, and then 508 #we try an admin plugin 509 if [info exists bMotionOriginalInput] { 510 if [string match -nocase $bMotionOriginalInput $line] { 511 bMotion_putloglev 1 * "my output matches the trigger, dropping" 512 return 0 513 } 514 } 515 516 set line [bMotionInsertString $line "%slash" "/"] 517 518 global bMotion_output_delay 519 520 if [regexp "^/" $line] { 521 #it's an action 522 mee $channel [string range $line 1 end] $urgent 523 } else { 524 if {$urgent} { 525 bMotion_queue_add_now [chandname2name $channel] $line 523 526 } else { 524 if {$urgent} { 525 bMotion_queue_add_now [chandname2name $channel] $line 526 } else { 527 bMotion_queue_add [chandname2name $channel] $line $bMotion_output_delay 528 } 529 } 530 return 0 527 bMotion_queue_add [chandname2name $channel] $line $bMotion_output_delay 528 } 529 } 530 return 0 531 531 } 532 532 533 533 proc bMotionInsertString {line swapout toInsert} { 534 bMotion_putloglev 5 * "bMotionInsertString ($line, $swapout, $toInsert)"534 bMotion_putloglev 5 * "bMotionInsertString ($line, $swapout, $toInsert)" 535 535 set loops 0 536 536 set inputLine $line … … 548 548 549 549 proc bMotionGetColenChars {} { 550 bMotion_putloglev 5 * "bMotionGetColenChars"550 bMotion_putloglev 5 * "bMotionGetColenChars" 551 551 set randomChar "!£$%^*@#~" 552 552 … … 569 569 570 570 proc makeSmiley { mood } { 571 bMotion_putloglev 5 * "makeSmiley"571 bMotion_putloglev 5 * "makeSmiley" 572 572 if {$mood > 30} { 573 573 return ":D" … … 592 592 # 593 593 proc bMotionWashNick { nick } { 594 bMotion_putloglev 5 * "bMotionWashNick ($nick)"594 bMotion_putloglev 5 * "bMotionWashNick ($nick)" 595 595 #remove leading 596 596 regsub {^[|`_\[]+} $nick "" nick … … 620 620 set handle [finduser $host] 621 621 if {$handle == "*"} { 622 #not in bot622 #not in bot 623 623 bMotion_putloglev 2 * "bMotion: no match, washing nick" 624 624 return [bMotionWashNick $nick] … … 633 633 set realname [getuser $handle XTRA irl] 634 634 if {$realname == ""} { 635 #not set635 #not set 636 636 return [bMotionWashNick $nick] 637 637 } … … 653 653 654 654 if [validuser $nick] { 655 #it's a handle already655 #it's a handle already 656 656 set handle $nick 657 657 } else { 658 #try to figure it out658 #try to figure it out 659 659 set handle [nick2hand $nick] 660 660 if {($handle == "") ||($handle == "*")} { 661 #not in bot661 #not in bot 662 662 bMotion_putloglev 2 * "bMotion: no match, using nick" 663 663 return $nick … … 670 670 set realname [getuser $handle XTRA irl] 671 671 if {$realname == ""} { 672 #not set672 #not set 673 673 bMotion_putloglev 2 * "no IRL set, using nick" 674 674 return $nick … … 679 679 680 680 proc bMotionTransformNick { target nick {host ""} } { 681 bMotion_putloglev 5 * "bMotionTransformNick($target, $nick, $host)"681 bMotion_putloglev 5 * "bMotionTransformNick($target, $nick, $host)" 682 682 set newTarget [bMotionTransformTarget $target $host] 683 683 if {$newTarget == "me"} { … … 688 688 689 689 proc bMotionTransformTarget { target {host ""} } { 690 bMotion_putloglev 5 * "bMotionTransformTarget($target, $host)"690 bMotion_putloglev 5 * "bMotionTransformTarget($target, $host)" 691 691 global botnicks 692 692 if {$target != "me"} { … … 718 718 # * prev - return previously chosen user/bot 719 719 proc bMotion_choose_random_user { channel bot condition } { 720 bMotion_putloglev 5 * " bMotion_choose_random_user ($channel, $bot, $condition)"720 bMotion_putloglev 5 * "ruser: bMotion_choose_random_user ($channel, $bot, $condition)" 721 721 global bMotionCache 722 722 set users [chanlist $channel] … … 729 729 set what [array get bMotionCache "lastruser$bot"] 730 730 } 731 bMotion_putloglev 4 * " accept: prev ($what)"731 bMotion_putloglev 4 * "ruser: accept: prev ($what)" 732 732 return [lindex $what 1] 733 733 } 734 734 735 735 foreach user $users { 736 bMotion_putloglev 4 * " eval user $user"736 bMotion_putloglev 4 * "ruser: eval user $user" 737 737 #is it me? 738 if [isbotnick $user] { continue } 738 if [isbotnick $user] { 739 bMotion_putloglev 4 * "ruser: that's me" 740 continue 741 } 739 742 740 743 if {[bMotion_setting_get "bitlbee"] && ($user == "root")} { 741 bMotion_putloglev 4 * " --reject: bitlbee root user"744 bMotion_putloglev 4 * "ruser: reject: bitlbee root user" 742 745 continue 743 746 } … … 746 749 #get their handle 747 750 set handle [nick2hand $user $channel] 748 bMotion_putloglev 4 * " handle: $handle"751 bMotion_putloglev 4 * "ruser: handle: $handle" 749 752 750 753 # some people don't like interacting with the bot 751 754 if [matchattr $handle J] { 752 bMotion_putloglev 4 * " --reject: user is +J"755 bMotion_putloglev 4 * "ruser: reject: user is +J" 753 756 continue 754 757 } … … 756 759 #unless we're looking for any old user, we'll need handle 757 760 if {(($handle == "") || ($handle == "*")) && ($condition != "")} { 758 bMotion_putloglev 4 * " --reject: no handle"761 bMotion_putloglev 4 * "ruser: reject: no handle" 759 762 continue 760 763 } … … 763 766 #we don't want a bot, then use nick 764 767 if {(($handle == "") || ($handle == "*")) && ($condition == "") && ($bot == 0)} { 765 bMotion_putloglev 4 * " ++accept: $user (no handle)"768 bMotion_putloglev 4 * "ruser: accept: $user (no handle)" 766 769 lappend acceptable $user 767 770 continue … … 771 774 if {$bot == 1} { 772 775 if {![matchattr $handle b]} { 773 bMotion_putloglev 4 * " --reject: not a bot"776 bMotion_putloglev 4 * "ruser: reject: not a bot" 774 777 continue 775 778 } … … 777 780 global bMotion_interbot_otherbots 778 781 if {[lsearch [array names bMotion_interbot_otherbots] $handle] == -1} { 779 bMotion_putloglev 4 * " --reject: not a bmotion bot"782 bMotion_putloglev 4 * "ruser: reject: not a bmotion bot" 780 783 continue 781 784 } 782 785 #else add them 783 786 lappend acceptable $user 784
