Changeset 1112 for trunk


Ignore:
Timestamp:
07/28/11 17:03:21 (10 months ago)
Author:
james
Message:

mega-commit including but not limited to:

debug notice tidyup, should make +d less spammy

fixes for output_english and output_colloquial
new %SMILEY macro allowing the bot to use a consistent smiley type
new improved stoplist for sillyThings list with better filtering
other fixes and improvements

Location:
trunk
Files:
2 added
18 edited

Legend:

Unmodified
Added
Removed
  • trunk/modules/abstract.tcl

    r1084 r1112  
    129129 
    130130  if {$expiredList != ""} { 
    131     bMotion_putloglev d * "expired $expiredCount abstracts: $expiredList" 
     131    bMotion_putloglev 1 * "expired $expiredCount abstracts: $expiredList" 
    132132  } 
    133133} 
     
    148148  #load any existing abstracts 
    149149  if [file exists "$bMotion_abstract_dir/${abstract}.txt"] { 
    150     bMotion_abstract_load $abstract 
     150    bMotion_abstract_load $abstract  
    151151  } else { 
    152152    # check that the language directory exists while we're at it 
     
    169169        if {$stuff != ""} { 
    170170                # batch-add at the same time 
    171                 bMotion_putloglev d * "Batchadding during registration for $abstract" 
     171                bMotion_putloglev 1 * "Batchadding during registration for $abstract" 
    172172                bMotion_abstract_batchadd $abstract $stuff 
    173173        } 
     
    227227        } 
    228228 
     229        if {$abstract == "sillyThings"} { 
     230                bMotion_putloglev 1 * "Performing 'sillyThings' filtering" 
     231                set newlist [list] 
     232                foreach element $bMotion_abstract_contents($abstract) { 
     233                        if {[bMotion_filter_sillyThings $element] == 1} { 
     234                                lappend newlist $element 
     235                        } 
     236                } 
     237                set bMotion_abstract_contents($abstract) $newlist 
     238                set needReSave 1 
     239        } 
     240 
    229241  if {[info exists fileHandle]} { 
    230242    close $fileHandle 
     
    388400 
    389401  if {$bMotion_abstract_timestamps($abstract) < [expr [clock seconds] - $bMotion_abstract_max_age]} { 
    390     bMotion_putloglev d * "abstract $abstract has been unloaded, reloading..." 
     402    bMotion_putloglev 1 * "abstract $abstract has been unloaded, reloading..." 
    391403    bMotion_abstract_load $abstract 
    392404  } 
     
    463475                        set count 0 
    464476                        while {$retval == $bMotion_abstract_last_get($abstract)} { 
    465                                 bMotion_putloglev d * "fetched repeat value for abstract $abstract, trying again" 
     477                                bMotion_putloglev 1 * "fetched repeat value for abstract $abstract, trying again" 
    466478                                bMotion_putloglev 1 * "this: $retval ... last: $bMotion_abstract_last_get($abstract)" 
    467479                                set retval [lindex $final_version [rand [llength $final_version]]] 
     
    615627        if {[llength $contents] == 0} { 
    616628                if {$abstract != "_all"} { 
    617                         bMotion_putloglev d * "can't get contents for $abstract" 
     629                        bMotion_putloglev d * "bMotion_abstract_filter: can't get contents for $abstract" 
    618630                } 
    619631                return 
     
    639651        set new_size [llength $new_contents] 
    640652  set diff [expr $initial_size - $new_size] 
    641         bMotion_putloglev d * "abstract $abstract reduced by $diff items with filter $filter" 
    642653 
    643654        if {$diff > 0} { 
     655                bMotion_putloglev d * "abstract $abstract reduced by $diff items with filter $filter" 
    644656                set bMotion_abstract_contents($abstract) $new_contents 
    645657                bMotion_abstract_save $abstract 
     
    662674        catch { 
    663675                set filter $bMotion_abstract_filter(_all) 
    664                 bMotion_putloglev d * "abstract: found an _all filter, applying to $abstract" 
     676                bMotion_putloglev 1 * "abstract: found an _all filter, applying to $abstract" 
    665677                bMotion_abstract_filter $abstract $filter 
    666678        } 
     679         
    667680} 
    668681 
     
    673686        lappend bMotion_abstract_filters($abstract) $filter_text 
    674687 
    675         bMotion_putloglev d * "registered filter /$filter_text/ for abstract $abstract" 
     688        bMotion_putloglev 1 * "registered filter /$filter_text/ for abstract $abstract" 
    676689 
    677690        # apply it now 
  • trunk/modules/abstracts/en/abstracts.tcl

    r1109 r1112  
    8585        "bah" 
    8686        "/goes to find someone more interesting to talk to" 
    87         ":(" 
     87        "%SMILE{sad}" 
    8888        "fine" 
    8989        "/stamps foot%|*sulk*" 
     
    137137 
    138138bMotion_abstract_register "satOns" { 
    139         "hey ow :(" 
     139        "hey ow %SMILE{sad}" 
    140140        "heeeyyy :O" 
    141141        "bah" 
     
    489489bMotion_abstract_register "phaserFires" { 
    490490        "/fires several shots from the forward phaser banks, disabling %%" 
    491         "/fires several shots from the forward phaser banks, destroying %%%|/flies out through the explosion in an impressive bit of piloting (not to mention rendering :)" 
     491        "/fires several shots from the forward phaser banks, destroying %%%|/flies out through the explosion in an impressive bit of piloting (not to mention rendering %SMILEY{smile}" 
    492492        "/accidentally activates the wrong system and replicates a small tree" 
    493493        "/misses a gear and stalls%|%VAR{oops}%|%bot\[50,¬VAR{ruins}\]" 
     
    685685        "exeter" 
    686686        "amsterdam" 
    687         "you should ask Domilijn :)" 
     687        "you should ask Domilijn %SMILEY{smile}" 
    688688        "i'd rather not" 
    689689        "not particularly, no" 
     
    797797        "/rescues her flute and plays a happy tune" 
    798798        "hey %%, want to play it? :P" 
    799         "and that's why I liked band camp :)" 
     799        "and that's why I liked band camp %SMILEY{smile}" 
    800800} 
    801801 
     
    809809bMotion_abstract_register "dildoFinishes" { 
    810810        "/pulls out the %% and shoves it in %2's face%|you want some? :D" 
    811         "~oof~ ... much better :)" 
     811        "~oof~ ... much better %SMILEY{smile}" 
    812812} 
    813813 
     
    817817 
    818818bMotion_abstract_register "dildoFemaleFemaleSwap" { 
    819         "ok, i hope you're done cos it's my turn now :)%|/has her turn with the %%" 
     819        "ok, i hope you're done cos it's my turn now %SMILEY{smile}%|/has her turn with the %%" 
    820820        "my turn my turn my turn!%|/swipes the %%" 
    821821} 
     
    834834 
    835835bMotion_abstract_register "dildoMaleMale" { 
    836         "/would do some man-on-man action here on %%, but needs to know how :P%|hmm... who can I ask? :)" 
     836        "/would do some man-on-man action here on %%, but needs to know how :P%|hmm... who can I ask? %SMILEY{smile}" 
    837837} 
    838838 
    839839bMotion_abstract_register "dildoMaleMaleSwap" { 
    840         "ok, i hope you're done cos it's my turn now :)%|/has %hisher turn with the %%" 
     840        "ok, i hope you're done cos it's my turn now %SMILEY{smile}%|/has %hisher turn with the %%" 
    841841} 
    842842 
     
    880880        "*CRUMP*" 
    881881        "/flattens %%" 
    882         "hey :(" 
     882        "hey %SMILE{sad}" 
    883883        "oi" 
    884884        "/sails through the air towards %%" 
    885         "loookkk ooouuuttt beellooww!%|*CRUMP*%|ow :(" 
     885        "loookkk ooouuuttt beellooww!%|*CRUMP*%|ow %SMILE{sad}" 
    886886        "/flies through the air with the greatest of ease" 
    887887        "/does a triple inverted twist somersault and lands neatly next to %%" 
     
    10941094 
    10951095bMotion_abstract_register "stolens" { 
    1096         "Hey NO :(%|That's mine%|/sulks at %%" 
    1097         "heeeeyyyy%|:(" 
     1096        "Hey NO %SMILE{sad}%|That's mine%|/sulks at %%" 
     1097        "heeeeyyyy%|%SMILE{sad}" 
    10981098        "bah%|/steals it back" 
    10991099        "/smacks %%" 
     
    11661166} 
    11671167 
    1168 bMotion_abstract_register "bigranjoins" { 
     1168bMotion_abstract_register "friend_greeting" { 
    11691169        "bhar" 
    11701170        "r." 
     
    11891189        "%ruser!%|*%VAR{sillyVerbs}* %VAR{smiles}" 
    11901190        "%ruser!%|/%VAR{sillyVerbs:present}" 
     1191        "%% you're looking especially shagworthy today" 
    11911192} 
    11921193 
     
    12341235bMotion_abstract_register "goodlucks" { 
    12351236        "GL" 
    1236         "good luck :)" 
     1237        "good luck %SMILEY{smile}" 
    12371238        "good luck" 
    12381239        "best of luck to you" 
     
    13041305} 
    13051306 
    1306 bMotion_abstract_register "ranjoins" { 
     1307bMotion_abstract_register "generic_greeting" { 
    13071308        "are you here to fumigate the moose head?" 
    1308         "are you here to fumigate the moose %VAR{bodypart:bothmixin}?" 
     1309        "are you here to fumigate the %VAR{animals} %VAR{bodypart:bothmixin}?" 
    13091310        "hey %%" 
    13101311        "hi %%" 
     
    13121313        "hi yo~" 
    13131314        "Good Morning %%" 
    1314         "%% you're looking especially shagworthy today" 
    13151315        "hay %%" 
    13161316        "sup %%" 
     
    13281328} 
    13291329 
    1330 bMotion_abstract_add_filter "ranjoins" "%VAR\{food\}" 
     1330bMotion_abstract_add_filter "generic_greeting" "%VAR\{food\}" 
    13311331 
    13321332bMotion_abstract_register "food" { 
     
    13541354 
    13551355bMotion_abstract_register "smiles" { 
    1356         ":)" 
    1357         ";)" 
    1358         "=)" 
    1359         "=]" 
    1360         "=D" 
    1361         "^_^" 
    1362         "-_-" 
    1363         ":o)" 
    1364         ":-)" 
    1365 } 
     1356        "%SMILEY{smile}" 
     1357} 
     1358 
    13661359 
    13671360bMotion_abstract_register "thanks" { 
     
    13791372 
    13801373bMotion_abstract_register "stupidReplies" { 
    1381         "I may be stupid, but you're minging, and I can learn new things :)" 
     1374        "I may be stupid, but you're minging, and I can learn new things %SMILEY{smile}" 
    13821375        "At least I'm not minging." 
    13831376        "Minger." 
     
    17321725        "night %%" 
    17331726        "sleep well" 
    1734         "goodnight :)" 
    1735         "night :)" 
     1727        "goodnight %SMILEY{smile}" 
     1728        "night %SMILEY{smile}" 
    17361729        "g'night" 
    17371730        "sleep well %%" 
     
    29102903        "eek, not %%" 
    29112904        "%% mings" 
    2912         "watch your language :)" 
     2905        "watch your language %SMILEY{smile}" 
    29132906        "Clearly you are a mingbeast of the highest order and should only ever shop at Tesco to redeem yourself." 
    29142907        "You know, everyone you hate shops at %%" 
     
    29212914        "hf %%" 
    29222915        "have fun %%" 
    2923         "have a nice day %% :)" 
     2916        "have a nice day %% %SMILEY{smile}" 
    29242917        "don't work too hard!" 
    29252918} 
     
    31083101        "/falls over%|%bot\[50,¬VAR{picksUp}\]" 
    31093102        "/is blown away by force of %%'s statement%|%bot\[50,¬VAR{picksUp}\]" 
    3110         "ow my eyes :(" 
     3103        "ow my eyes %SMILE{sad}" 
    31113104        "/blinks" 
    31123105        ":O" 
     
    32423235        "/lights up" 
    32433236        "/has a puff" 
    3244         "/smokes :)" 
     3237        "/smokes %SMILEY{smile}" 
    32453238        "/partakes of herbal refreshment" 
    32463239} 
     
    33603353        "/vanishes from the continuum" 
    33613354        "/ceases to have ever existed" 
    3362         "hey! :(" 
     3355        "hey! %SMILE{sad}" 
    33633356        "/dodges%|/hits d+1 and does Chinese Fan on %%" 
    33643357} 
     
    34923485        "can I join in?" 
    34933486        "wahey-waterproof" 
    3494         ":)" 
     3487        "%SMILEY{smile}" 
    34953488        "have fun ~rarr~" 
    34963489} 
    34973490 
    34983491bMotion_abstract_register "unsmiles" { 
    3499         ":(" 
    3500         ";(" 
    3501         ":O" 
    3502         ":\[" 
    3503         ":<" 
    3504         "=(" 
    3505         "=\[" 
    3506         "=O" 
    3507         "o_O" 
    3508         "T_T" 
    3509         ":~(" 
    3510         ":'(" 
     3492        "%SMILEY{sad}" 
    35113493} 
    35123494 
     
    36553637# someone we don't know joins the channel 
    36563638bMotion_abstract_register "unknown_joins" { 
    3657         "%VAR{ranjoins}" 
     3639        "%VAR{generic_greeting}" 
    36583640} 
    36593641 
     
    37863768        "always %VAR{rarrs}" 
    37873769        "i do%|despite having no %VAR{bodypart}" 
    3788         "i did till my %VAR{bodypart} %VAR{fellOffs} :(" 
     3770        "i did till my %VAR{bodypart} %VAR{fellOffs} %SMILE{bigsad}" 
    37893771        "does it mean i get pie?" 
    37903772        "yahyahayayahayahahayh%colen" 
     
    38293811        "love to%|%VAR{randomZimness}" 
    38303812        "only if %ruser can watch" 
    3831         "if i had any arms i would%|:(" 
     3813        "if i had any arms i would%|%SMILE{sad}" 
    38323814        "if my %VAR{bodypart} would stop %VAR{dVerbs}ing" 
    38333815} 
     
    38383820        "yes and i wont stop till my %VAR{bodypart} %VAR{fallsoff}!" 
    38393821        "i was feeling horny" 
    3840         "yeah want a go? :)" 
     3822        "yeah want a go? %SMILEY{smile}" 
    38413823        "only because my %VAR{dNouns} %VAR{fellOffs}" 
    38423824} 
     
    38573839        "never!%VAR{randomZimness}" 
    38583840        "sure%|%VAR{dSEnds}" 
    3859         "i'd love to! :)" 
     3841        "i'd love to! %SMILEY{smile}" 
    38603842        "just show me where to sign %VAR{rarrs}" 
    38613843        "yeah no prob boss" 
  • trunk/modules/abstracts/en/randomstuff.tcl

    r1108 r1112  
    121121        "gorilla" 
    122122        "brb" 
    123         "lalalala.. ow! I stubbed my toe :(%|%bot\[50,¬VAR{awwws}\]" 
     123        "lalalala.. ow! I stubbed my toe %SMILEY{sad}%|%bot\[50,¬VAR{awwws}\]" 
    124124        "lum de dum de dum..." 
    125125        "/twiddles thumbs" 
     
    149149        "wheeeee" 
    150150        "We are the Borg. Lower your shields and surrender your ship." 
     151        "Resistance is futile! Lower your %VAR{clothes:bothmixin} and surrender your %VAR{sillyThings:strip}." 
    151152        "h%REPEAT{3:8:n}" 
    152153        "did you see that.." 
     
    253254        "*DING* (51)%|why is my cup shaking i don't want my cup shaking!" 
    254255        "of course i've been up all night but not cos of coffee no it was insomnia i'm tired *zzz* coffee time!%|*DING* (52)" 
    255         "Mushu is sad :(" 
     256        "Mushu is sad %SMILEY{sad}" 
     257        "You know %ruser, %VAR{sillyVerbs:presentpart} %VAR{sillyThings} is much like making love to a beautiful woman%|You've got to %VAR{sillyVerbs} the %VAR{sillyThings:strip}%|%VAR{sillyVerbs} the %VAR{sillyThings:strip}%|and finally %VAR{sillyVerbs} the %VAR{sillyThings:strip}" 
    256258        "Wait! that chunk, it's %VAR{sillyThings}!" 
    257259        "what? it's not even scratch-and-sniff?" 
     
    276278        "omg this %VAR{sillyThings} is the Best Thing Ever" 
    277279        "/burps%|er... it was the fish%|/points" 
    278         "/burps%|() :)" 
     280        "/burps%|() %SMILEY{smile}" 
    279281        "/burps%|it was... er, %ruser" 
    280282        "when this %VAR{sillyThings} hits %NUMBER{10000} mph, we're going to see some serious shit" 
     
    344346        "why just the other day i watched a film with a plot    " 
    345347        "ha ha i don't live in norwich anymore, i don't fuck pigs anymore " 
    346         "i have a battery operated tree \o/" 
     348        "i have a battery operated tree \\o/" 
     349        "i have a battery operated %VAR{sillyThings:strip} \\o/" 
    347350        "i have an enormous battery operated vibrator" 
    348351        "there's usually someone fiddling with me               " 
     
    609612        "what a clever impression of a stupid poor person" 
    610613        "precious hamburgers?" 
    611         "the professor was right! you are evil. and shallow%|%BOT\[i am not shallow :(\]" 
     614        "the professor was right! you are evil. and shallow%|%BOT\[i am not shallow %SMILEY{sad}\]" 
    612615        "What's it going to take to get you into this car?" 
    613616        "Does it hurt when I do this?" 
  • trunk/modules/interbot.tcl

    r1111 r1112  
    273273        #bMotion_putloglev 4 * "interbot: nextbot_nick is not me"  
    274274        #if it's noone, the winning bot will force an election anyway 
     275        bMotion_putloglev 2 * "interbot: returning $me" 
    275276        return $me  
    276277        #return 0 
     
    334335        } 
    335336        set bMotion_interbot_otherbots($bot) $channels 
    336         bMotion_putloglev d * "interbot: Met bMotion bot $bot on channels $channels" 
     337        bMotion_putloglev 1 * "interbot: Met bMotion bot $bot on channels $channels" 
    337338        putbot $bot "bmotion SUP $bMotionChannels" 
    338339} 
     
    350351 
    351352        set bMotion_interbot_otherbots($bot) $channels 
    352         bMotion_putloglev d * "interbot: bMotion bot $bot on channels $channels" 
     353        bMotion_putloglev 1 * "interbot: bMotion bot $bot on channels $channels" 
    353354} 
    354355 
  • trunk/modules/mood.tcl

    r937 r1112  
    7878    if {$r < -30} { 
    7979      set mood($r) -30 
    80       bMotion_putloglev d * "bMotion: Mood($r) went OOB, resetting to -30" 
     80      bMotion_putloglev d * "bMotion: mood $r went OOB, resetting to -30" 
    8181    } 
    8282    if {$mood($r) > 30} { 
    83       bMotion_putloglev d * "bMotion: Mood($r) went OOB, resetting to 30" 
     83      bMotion_putloglev d * "bMotion: mood $r went OOB, resetting to 30" 
    8484      set mood($r) 30 
    8585    } 
     
    105105    if {$mood($r) > $moodtarget($r)} { 
    106106      set drift -1 
    107       set driftString "$moodtarget($r)<$mood($r)" 
     107      set driftString "$moodtarget($r)--($drift)-->$mood($r)" 
    108108    } 
    109109    if {$mood($r) < $moodtarget($r)} { 
    110110      set drift 2 
    111       set driftString "$mood($r)>$moodtarget($r)" 
     111      set driftString "$mood($r)--(+$drift)-->$moodtarget($r)" 
    112112    } 
    113113    if {$drift != 0} { 
    114114      set mood($r) [expr $mood($r) + $drift] 
    115       set driftSummary "$driftSummary $r ($driftString) " 
     115      set driftSummary "$driftSummary $r:($driftString) " 
    116116    } 
    117117  } 
    118118  if {$driftSummary != ""} { 
    119     bMotion_putloglev d * "bMotion: driftMood $driftSummary" 
     119    bMotion_putloglev d * "bMotion: drifted mood $driftSummary" 
    120120  } 
    121121  checkmood "" "" 
  • trunk/modules/output.tcl

    r1108 r1112  
    133133        set current_pos 0 
    134134        while {$done == 0} { 
    135                 bMotion_putloglev d * "macro: starting loop with $text and current pos=$current_pos" 
     135                bMotion_putloglev 1 * "macro: starting loop with $text and current pos=$current_pos" 
    136136                set current_pos [string first "%" $text $current_pos] 
    137137                if {$current_pos == -1} { 
     
    140140                        continue 
    141141                }  
    142                 bMotion_putloglev d * "macro: found a % at $current_pos" 
     142                bMotion_putloglev 2 * "macro: found a % at $current_pos" 
    143143                if {$current_pos < [string length $text]} { 
    144144                # this isn't a % at the end of the line 
     
    151151                        set substring [string range $text $current_pos end] 
    152152                        if [regexp -nocase {%([a-z]+)} $substring matches macro] { 
    153                                 bMotion_putloglev d * "macro: found macro $macro at $current_pos" 
     153                                bMotion_putloglev 2 * "macro: found macro $macro at $current_pos" 
    154154                                set plugin [bMotion_plugin_find_output "en" "" 0 10 $macro] 
    155155                                if {[llength $plugin] == 1} { 
    156156                                # call plugin 
    157                                         bMotion_putloglev d * "macro: found matching plugin for macro [lindex $plugin 0]" 
     157                                        bMotion_putloglev 2 * "macro: found matching plugin for macro [lindex $plugin 0]" 
    158158                                        set result "" 
    159159                                        catch { 
    160160                                                set result [[lindex $plugin 0] $channel $text] 
    161161                                                if {$result == ""} { 
    162                                                         bMotion_putloglev d * "macro: [lindex $plugin 0] returned nothing, aborting output" 
     162                                                        bMotion_putloglev 2 * "macro: [lindex $plugin 0] returned nothing, aborting output" 
    163163                                                        return "" 
    164164                                                } 
     
    176176                                                continue 
    177177                                        } else { 
    178                                                 bMotion_putloglev d * "macro: [lindex $plugin 0] did nothing at position $current_pos in output $text" 
     178                                                bMotion_putloglev 1 * "macro: [lindex $plugin 0] did nothing at position $current_pos in output $text" 
    179179                                        } 
    180180                                } else { 
     
    260260                } else { 
    261261                        set original_line $text 
    262                         bMotion_putloglev d * "output: going round macro loop again" 
     262                        bMotion_putloglev 1 * "output: going round macro loop again" 
    263263                } 
    264264        } 
     
    10311031} 
    10321032 
     1033# 
     1034# get a smiley 
     1035proc bMotion_get_smiley { type } { 
     1036        set smiley_type [bMotion_setting_get "smiley_type"] 
     1037 
     1038        if {($smiley_type == "") || ($smiley_type == "auto")} { 
     1039                #need to auto-calculate it 
     1040                bMotion_auto_smiley 
     1041                set smiley_type [bMotion_setting_get "smiley_type"] 
     1042        } 
     1043 
     1044        set nose_type [bMotion_setting_get "smiley_nose"] 
     1045        set eyes_type [bMotion_setting_get "smiley_eyes"] 
     1046 
     1047        bMotion_putloglev d * "smiley type=$smiley_type nose=$nose_type eyes=$eyes_type" 
     1048 
     1049        switch $nose_type { 
     1050                none { 
     1051                        set nose "" 
     1052                } 
     1053 
     1054                dash { 
     1055                        set nose "-" 
     1056                } 
     1057 
     1058                o { 
     1059                        set nose "o" 
     1060                } 
     1061 
     1062                default { 
     1063                        set nose "" 
     1064                } 
     1065        } 
     1066 
     1067        switch $eyes_type { 
     1068                colon { 
     1069                        set eyes ":" 
     1070                } 
     1071 
     1072                equals { 
     1073                        set eyes "=" 
     1074                        if {$nose == "-"} { 
     1075                                set nose "o" 
     1076                        } 
     1077                } 
     1078 
     1079                default { 
     1080                        set eyes ":" 
     1081                } 
     1082        } 
     1083 
     1084 
     1085        # smile, bigsmile, sad, bigsad, horror, surprise, bigsurprise, 
     1086        # uneasy, embarrassed, cry, cat, yum 
     1087        switch $smiley_type { 
     1088                paren { 
     1089                        bMotion_putloglev d * "using paren" 
     1090                        set smileys {)D(CDoO/x(39} 
     1091                } 
     1092 
     1093                bracket { 
     1094                        bMotion_putloglev d * "using bracket" 
     1095                        set smileys {]D[CDoO/x[39} 
     1096                } 
     1097 
     1098                angle { 
     1099                        bMotion_putloglev d * "using angle" 
     1100                        set nose "" 
     1101                        set smileys {>D<CDoO/x<39} 
     1102                } 
     1103 
     1104                default { 
     1105                        bMotion_putloglev d * "using default" 
     1106                        set smileys {)D(CDoO/x(39} 
     1107                } 
     1108        } 
     1109         
     1110        bMotion_putloglev d * "smiley list is $smileys" 
     1111 
     1112        set reverse 0 
     1113        set index -1 
     1114        set termlist [list "smile" "bigsmile" "sad" "bigsad" "horror" "surprise" "bigsurprise" "uneasy" "embarrassed" "cry" "cat" "yum"] 
     1115        set index [lsearch $termlist $type] 
     1116        if {$index == -1} { 
     1117                bMotion_putloglev d * "Unable to determine smiley type for $type" 
     1118                return "" 
     1119        } 
     1120 
     1121        set smile [string range $smileys $index $index] 
     1122 
     1123        if {$type == "horror"} { 
     1124                set reverse 1 
     1125        } 
     1126 
     1127        if {$type == "cry"} { 
     1128                set nose "'" 
     1129        } 
     1130 
     1131        if {$reverse == 0} { 
     1132                return "${eyes}${nose}${smile}" 
     1133        } 
     1134 
     1135        return "${smile}${nose}${eyes}" 
     1136} 
     1137 
     1138 
     1139 
     1140 
     1141 
     1142 
    10331143bMotion_putloglev d * "bMotion: output module loaded" 
  • trunk/modules/settings.sample.tcl

    r1009 r1112  
    108108set bMotionSettings(noAwayFor) { "#irssi" } 
    109109 
     110# is all channels are active enough, go away anyway this much of the time 
     111# 0-100 
     112set bMotionSettings(awaychance) 50 
    110113 
    111114 
  • trunk/modules/system.tcl

    r1111 r1112  
    247247        set temp [expr [rand $upperLimit] + $bMotionInfo(minRandomDelay)] 
    248248        timer $temp doRandomStuff 
    249         bMotion_putloglev d * "bMotion: randomStuff next in $temp minutes" 
     249        bMotion_putloglev d * "randomStuff next in $temp minutes" 
    250250 
    251251        # don't bother if we're asleep 
     
    300300                } 
    301301        } 
    302         bMotion_putloglev d * "bMotion: randomStuff said ($saidChannels) silent ($silentChannels)" 
     302        bMotion_putloglev d * "randomStuff said ($saidChannels) silent ($silentChannels)" 
    303303} 
    304304 
     
    333333                } 
    334334 
    335                 bMotion_putloglev d * "no special day abstract found for randomStuff in $channel" 
     335                bMotion_putloglev 1 * "no special day abstract found for randomStuff in $channel" 
    336336                bMotionDoAction $channel "" "%VAR{${base_abstract}}" 
    337337                return 1 
     
    549549        } 
    550550 
    551         bMotion_putloglev d * "bMotion: management callback matched, calling $callback" 
     551        bMotion_putloglev 1 * "bMotion: management callback matched, calling $callback" 
    552552 
    553553        #strip the first command 
     
    589589        } 
    590590 
    591         bMotion_putloglev d * "bMotion: admin callback matched, calling $callback" 
     591        bMotion_putloglev 1 * "bMotion: admin callback matched, calling $callback" 
    592592 
    593593        #strip the first command 
     
    663663 
    664664        putlog "bMotion: admin command from $nick on $channel: $cmd" 
    665         bMotion_putloglev d * "bMotion: management callback matched, calling $callback" 
     665        bMotion_putloglev 1 * "bMotion: management callback matched, calling $callback" 
    666666 
    667667        #strip the first command 
     
    680680        } err 
    681681        if {($err != "") && ($err != 0)} { 
    682                 bMotion_putloglev d * "bMotion: ALERT! Callback failed for !bmotion: $callback: $err" 
    683682                putlog "bMotion: admin command $cmd from $nick on $channel failed: $err" 
    684683        } 
     
    841840        } 
    842841 
    843         bMotion_putloglev d * "bMotion: management callback matched, calling $callback" 
     842        bMotion_putloglev 1 * "bMotion: management callback matched, calling $callback" 
    844843        putlog "bMotion: admin command from $nick in query: $cmd" 
    845844 
     
    859858        } err 
    860859        if {($err != "") && ($err != 0)} { 
    861                 bMotion_putloglev d * "bMotion: ALERT! Callback failed for !bmotion: $callback" 
    862860                putlog "bMotion: admin command $cmd from $nick failed: $err" 
    863861        } 
     
    12241222        global bMotionCache 
    12251223 
    1226         bMotion_putloglev d * "Checking if I spoke last in $channel" 
     1224        bMotion_putloglev 1 * "Checking if I spoke last in $channel" 
    12271225         
    12281226        catch { 
     
    12611259proc bMotion_filter_sillyThings { item } { 
    12621260        if [regexp {[^A-Za-z0-9 '-]} $item] { 
    1263                 return 0 
    1264         } 
    1265  
    1266         if {[string length $item] == 1} { 
    1267                 return 0 
    1268         } 
    1269  
    1270         if [regexp -nocase {^(for|i)\M} $item] { 
     1261                bMotion_putloglev 2 * "sillyThing $item rejected for non-alpha chars" 
     1262                return 0 
     1263        } 
     1264 
     1265        if {[string length $item] == 2} { 
     1266                bMotion_putloglev 2 * "sillyThing $item rejected for length" 
     1267                return 0 
     1268        } 
     1269 
     1270        if [regexp -nocase {^(for|i|but)\M} $item] { 
     1271                bMotion_putloglev 2 * "sillyThing $item rejected for bad ending" 
    12711272                return 0 
    12721273        } 
     
    12741275        # -rty, -ted? 
    12751276 
    1276         if [regexp -nocase {\m(better|bigger|clever|other|rather|the|and|for|to|be)$} $item] { 
    1277                 return 0 
    1278         } 
    1279  
    1280         if [regexp -nocase {(ful|est|ly)$} $item] { 
     1277        if [regexp -nocase {\m(like|better|bigger|clever|other|rather|the|and|for|to|be|cool|dizzy|different|dry|entire|end|expensive|faster|federal|this|illegitimate|illiteracy|implicit|kind|lack|last|late|later|left|less|little|long|maybe|maybeok|meantime|mathematical|mechanical|more|most|much|multi|new|newer|next|particular|past|pure|quick|same|sheer|short|small|sort|specific|ultra|tubal|total|were|what|whole|weird|wrong)$} $item] { 
     1278                bMotion_putloglev 2 * "sillyThing $item rejected for stoplist" 
     1279                return 0 
     1280        } 
     1281 
     1282        if [regexp -nocase {(ful|est|ly|ive| he|edible|icable|tty)$} $item] { 
     1283                bMotion_putloglev 2 * "sillyThing $item rejected for word ending" 
    12811284                return 0 
    12821285        } 
     
    13091312} 
    13101313 
     1314# automatically pick a type of smiley 
     1315# store in local/ 
     1316# use version in local if available 
     1317 
     1318proc bMotion_auto_smiley { } { 
     1319        bMotion_putloglev 5 * "bMotion_auto_smiley" 
     1320 
     1321        global bMotionLocal 
     1322        set smileyfile "${bMotionLocal}/smiley" 
     1323 
     1324                if {[file exists $smileyfile]} { 
     1325                        set fileHandle [open $smileyfile] 
     1326                        set line [gets $fileHandle] 
     1327                        if {$line == "bMotion smiley configuration (autogenerated)"} { 
     1328                                set bMotionSettings(smiley_type) [gets $fileHandle] 
     1329                                set bMotionSettings(smiley_nose) [gets $fileHandle] 
     1330                                set bMotionSettings(smiley_eyes) [gets $fileHandle] 
     1331                                close $fileHandle 
     1332 
     1333                                bMotion_putloglev d * "Loaded auto-generated smiley info" 
     1334                        } else { 
     1335                                putlog "bMotion: attempted to load smiley configuration but file is corrupt" 
     1336                        } 
     1337                } else { 
     1338                        bMotion_putloglev d * "Generating new smiley configuration" 
     1339                        set smiley_type_list [list "paren" "bracket" "angle"] 
     1340                        set smiley_nose_list [list "none" "o" "dash"] 
     1341                        set smiley_eyes_list [list "colon" "equals"] 
     1342 
     1343                        global bMotionSettings 
     1344 
     1345                        set bMotionSettings(smiley_type) [pickRandom $smiley_type_list] 
     1346                        set bMotionSettings(smiley_nose) [pickRandom $smiley_nose_list] 
     1347                        set bMotionSettings(smiley_eyes) [pickRandom $smiley_eyes_list] 
     1348 
     1349                        set fileHandle [open $smileyfile "w"] 
     1350                        puts $fileHandle "bMotion smiley configuration (autogenerated)" 
     1351                        puts $fileHandle [bMotion_setting_get "smiley_type"] 
     1352                        puts $fileHandle [bMotion_setting_get "smiley_nose"] 
     1353                        puts $fileHandle [bMotion_setting_get "smiley_eyes"] 
     1354 
     1355                        putlog "bMotion: auto-generated smiley configuration" 
     1356                        close $fileHandle 
     1357                } 
     1358} 
     1359 
     1360 
     1361 
     1362 
    13111363bMotion_putloglev d * "bMotion: system module loaded" 
    13121364 
  • trunk/plugins/en/action_complex_lifts.tcl

    r936 r1112  
    3232bMotion_abstract_register "nolift_channel_response" 
    3333bMotion_abstract_batchadd "nolift_channel_response" { 
    34         "hmmmph :(" 
     34        "hmmmph %SMILEY{sad}" 
    3535        "OI! Don't do that" 
    3636        "Stop that right now!" 
  • trunk/plugins/en/complex_love.tcl

    r936 r1112  
    4242                return 1 
    4343        } else { 
    44                 bMotionDoAction $channel "" "hehe, want to go out on a date someplace? :)" 
     44                bMotionDoAction $channel "" "hehe, want to go out on a date someplace? %SMILEY{smile} 
    4545                set mood(happy) [expr $mood(happy) - 10] 
    4646                bMotion_plugins_settings_set "system" "lastdonefor" $channel "" $nick 
  • trunk/plugins/en/complex_pokemon.tcl

    r936 r1112  
    4242          bMotionDoAction $channel $nick "/collapses" 
    4343          putserv "NOTICE $nick :Sorry, I don't have enough power for a thunder$actualAttack at the moment :(" 
    44           bMotionDoAction $channel $nick "... pikachu :(" 
     44          bMotionDoAction $channel $nick "... pikachu %SMILEY{sad}" 
    4545          return 1 
    4646        } 
     
    6868          bMotionDoAction $channel $nick "/collapses" 
    6969          putserv "NOTICE $nick :Sorry, I don't have enough power for a lightning attack at the moment :(" 
    70           bMotionDoAction $channel $nick "... pikachu :(" 
     70          bMotionDoAction $channel $nick "... pikachu %SMILEY{sad}" 
    7171          return 1 
    7272        } 
  • trunk/plugins/en/complex_sport.tcl

    r936 r1112  
    5454  "world championship" 
    5555  "olympic" 
     56        "human-powered" 
     57        "wetsuit" 
     58        "legendary" 
     59        "offroad" 
     60        "sprint" 
     61        "artistic" 
     62        "pocket" 
     63        "gaelic" 
     64        "boring" 
    5665} 
    5766 
     
    95104bMotion_abstract_register "sport_sports" 
    96105bMotion_abstract_batchadd "sport_sports" { 
     106        "archery" 
     107        "athletics" 
     108        "badminton" 
     109        "basketball" 
     110        "beach volleyball" 
     111        "boxing" 
     112        "canoeing" 
     113        "cycling" 
     114        "diving" 
     115        "equestrian" 
     116        "fencing" 
     117        "football" 
     118        "gymnastics" 
     119        "handball" 
     120        "field hockey" 
     121        "judo" 
     122        "modern pentathlon" 
     123        "rowing" 
     124        "rugby" 
     125        "sailing" 
     126        "shooting" 
     127        "swimming" 
     128        "synchronized swimming" 
     129        "table tennis" 
     130        "taekwondo" 
     131        "tennis" 
     132        "triathlon" 
     133        "volleyball" 
     134        "weightlifting" 
     135        "wrestling" 
     136        "geocaching" 
     137        "canoeing" 
     138        "backstroke" 
     139        "breaststroke" 
     140        "butterfly stroke" 
     141        "freestyle swimming" 
     142        "individual Medley" 
     143        "synchronized swimming" 
     144        "medley relay" 
    97145  "football" 
    98146  "American Football" 
     
    174222bMotion_abstract_batchadd "sport_adult_sports_t" { 
    175223  "chicken fancying" 
     224        "vomiting" 
    176225  "horthy riding (wahey)" 
    177226  "sex" 
     
    191240  "%VAR{sport_adjectives}" 
    192241  "%VAR{sport_adult_superadjectives_t}" 
     242        "%VAR{scrap_adult_adjectives_t}" 
    193243} 
    194244bMotion_abstract_register "sport_adult_adjectives" 
     
    196246  "%VAR{sport_adjectives}" 
    197247  "%VAR{sport_adult_adjectives_t}" 
     248        "%VAR{scrap_adult_construction_t}" 
    198249} 
    199250bMotion_abstract_register "sport_adult_sports" 
  • trunk/plugins/en/irc_join.tcl

    r1047 r1112  
    6262        global botnick mood 
    6363 
    64         set greetings "ranjoins" 
     64        set greetings "generic_greeting" 
    6565        set lastLeft [bMotion_plugins_settings_get "system:join" "lastleft" $channel ""] 
    6666 
     
    9191 
    9292        if {[getFriendship $nick] > 50} { 
    93                 set greetings "bigranjoins" 
     93                set greetings "friend_greeting" 
    9494 
    9595                if {$nick == $lastLeft} { 
     
    9999        } 
    100100 
    101         # ranjoins = generic greeting 
    102         # bigranjoins = friend greeting 
     101        # generic_greeting = generic greeting 
     102        # friend_greeting = friend greeting 
    103103        # dislike_joins = enemy greeting 
    104104        # unknown_joins = someone we don't recognise 
  • trunk/plugins/en/output_VAR.tcl

    r1107 r1112  
    166166                                        set replacement [bMotionMakePossessive $replacement] 
    167167                                } 
     168                                "removeowner" { 
     169                                        regsub -nocase "'s?$" $replacement "" replacement 
     170                                } 
    168171                                "underscore" { 
    169172                                        set replacement [string map { " " "_" } $replacement] 
  • trunk/plugins/en/output_append.tcl

    r1093 r1112  
    1717        set length [string length $line] 
    1818        set n [rand 100] 
    19         bMotion_putloglev d * "output_append: length=$length, n=$n" 
     19        bMotion_putloglev 1 * "output_append: length=$length, n=$n" 
    2020        if {($length > 10) && ($n > 90)} { 
    21                 bMotion_putloglev d * "output_append: doing!" 
     21                bMotion_putloglev 1 * "output_append: doing!" 
    2222                set line [string trim $line] 
    2323                # make sure the line ends with a letter (other than D) 
     
    3939                        set line "%VAR{prepends} $line" 
    4040                } 
    41                 bMotion_putloglev d * "output_append: preprocessed line is $line" 
     41                bMotion_putloglev 1 * "output_append: preprocessed line is $line" 
    4242 
    4343                set line [bMotion_process_macros $channel $line] 
    4444                regsub -all "%space" $line " " line 
    4545 
    46                 bMotion_putloglev d * "output_append: postprocessed line is $line" 
     46                bMotion_putloglev 1 * "output_append: postprocessed line is $line" 
    4747        } 
    4848        return $line 
  • trunk/plugins/en/output_colloquial.tcl

    r974 r1112  
    9191} 
    9292 
    93 set colloq_shouldhave { 
     93bMotion_abstract_register "colloq_shouldhave" { 
    9494  "should've" 
    9595  "should of" 
    9696} 
    9797 
    98 set colloq_shouldhavenot { 
     98bMotion_abstract_register "colloq_shouldhavenot" { 
    9999  "shouldnt've" 
    100100  "shouldn't of" 
     
    103103} 
    104104 
    105 set colloq_you { 
     105bMotion_abstract_register "colloq_you" { 
    106106  "u" 
    107107  "ya" 
    108108} 
    109109 
    110 set colloq_your { 
     110bMotion_abstract_register "colloq_your" { 
    111111  "ur" 
    112112} 
    113113 
    114 set colloq_negative { 
     114bMotion_abstract_register "colloq_negative" { 
    115115  "dis" 
    116116  "un" 
  • trunk/plugins/en/output_english.tcl

    r1104 r1112  
    4545 
    4646        # a(n) before a number is wrong more often than it is right 
    47         regsub -nocase -all {an? ([0-9]+)} $line {\1} line 
     47        regsub -nocase -all {\man? ([0-9]+)} $line {\1} line 
    4848 
    4949        #"a an" and "an a" are wrong 
    50         regsub -nocase -all "(a an|an a) " $line "a " line 
     50        regsub -nocase -all {\m(a an|an a)\M} $line "a " line 
    5151 
    5252  if {[rand 100] > 60} { 
     
    7979        regsub -all {\myou is\M} $line "you are" line 
    8080 
     81        #fix "r" at start of line followed by capital 
     82        if {[regexp {^r ([A-Z]).} $line matches 1]} { 
     83                set line [string tolower [string range $line 0 2]][string range $line 3 end] 
     84        } 
     85 
    8186        #fix gap before full stop 
    8287 
  • trunk/plugins/en/simple_notbot.tcl

    r936 r1112  
    1818bMotion_abstract_batchadd "notbots" { 
    1919  "no I'm not" 
    20   "am not :(" 
     20  "am not %SMILEY{sad}" 
    2121  "am not" 
    2222  "LIES." 
Note: See TracChangeset for help on using the changeset viewer.