Changeset 882 for trunk

Show
Ignore:
Timestamp:
02/11/08 17:53:53 (11 months ago)
Author:
james
Message:

added %daytime macro

Location:
trunk
Files:
6 modified

Legend:

Unmodified
Added
Removed
  • trunk/modules/abstracts/en/abstracts.tcl

    r877 r882  
    189189bMotion_abstract_register "answerWhos" 
    190190bMotion_abstract_batchadd "answerWhos" { 
     191        "Dr Beanturd Cake" 
    191192        "%ruser" 
    192193        "me" 
     
    318319        "tomorrow" 
    319320        "today" 
    320         "in 10 minutes" 
    321         "4:32" 
    322         "7:53" 
    323         "9:21" 
    324         "16:08" 
     321        "in %NUMBER{59} minutes" 
     322        "%NUMBER{12}:%NUMBER{5}%NUMBER{9}" 
    325323} 
    326324 
     
    11501148        "jizz" 
    11511149        "ass" 
     1150        "bum" 
     1151        "twat" 
    11521152} 
    11531153 
     
    13551355} 
    13561356 
    1357 bMotion_abstract_batchadd "sillyThings" [list "12 year old black metal kids" "14 US dollars" "1.5 pie" "20 minutes till lunch" "5 litres of Halfords 10W-40" "5 pints" "99 bicycle clips" "a 12-inch pianist" "a 1.44MB floppy disk" "a 1979 Aston Martin" "a 7MB Flash movie" "AA" "a backup" "a badger" "a bag" "a bagette" "a bank" "a barbecue" "a bath" "a baton" "a bazooka" "a beach" "a beard" "a beast" "a bed" "Aberystwyth" "a better computer" "a big stick with nails in it" "a bike" "a bird"                     "a biscuit tin" "a blanket" "a bloke" "a bog wallness" "a boiler" "a boob" "a book" "a bookshelf" "a bookstore" "a boot" "a bot" "a bottle" "a bottom" "a box" "a boy"  "a branch" "a brick" "a bridge" "a broken CD case" "a brother" "a brownie" "a bucket" "a budget" "a building" "a bullet" "a bunker" "a bus" "a business" "a button" "a cab"                     "a camara" "a camera" "a candidate" "a can of coke" "a can of diet coke (bleh)" "a capital" "a Cappucino" "a captain" "a car" "a car park" "a carrot" "a cartoon" "a case" "a cassette" "a cassette deck"               "a cat" "a catflap" "a cd wallet" "a ceiling" "a cellar" "a certain" "a chain" "a champion" "a channel" "a chat" "a chatterbot" "a cheque" "a choir" "a Christian" "a chum"                     "a cinema" "a circus" "a client" "a clock" "a clothes peg" "a clown" "a coffee pot" "a company" "a compiler" "a complete central heating system" ] 
     1357bMotion_abstract_batchadd "sillyThings" [list "12 year old black metal kids" "14 US dollars" "1.5 pie" "20 minutes till lunch" "5 litres of Halfords 10W-40" "5 pints" "99 bicycle clips" "a 12-inch pianist" "a 1.44MB floppy disk" "a 1979 Aston Martin" "a 7MB Flash movie" "AA" "a backup" "a badger" "a bag" "a bagette" "a bank" "a barbecue" "a bath" "a baton" "a bazooka" "a beach" "a beard" "a beast" "a bed" "Aberystwyth" "a better computer" "a big stick with nails in it" "a bike" "a bird"                     "a biscuit tin" "a blanket" "a bloke" "a bog wallness" "a boiler" "a boob" "a book" "a bookshelf" "a bookstore" "a boot" "a bot" "a bottle" "a bottom" "a box" "a boy"  "a branch" "a brick" "a bridge" "a broken CD case" "a brother" "a brownie" "a bucket" "a budget" "a building" "a bullet" "a bunker" "a bus" "a business" "a button" "a cab"                     "a camara" "a camera" "a candidate" "a can of coke" "a can of diet coke (bleh)" "a capital" "a Cappucino" "a captain" "a car" "a car park" "a carrot" "a cartoon" "a case" "a cassette" "a cassette deck"               "a cat" "a catflap" "a cd wallet" "a ceiling" "a cellar" "a certain" "a chain" "a champion" "a channel" "a chat" "a chatterbot" "a cheque" "a choir" "a Christian" "a chum"                     "a cinema" "a circus" "a client" "a clock" "a clothes peg" "a clown" "a coffee pot" "a company" "a compiler" "a complete central heating system" "marinated fuck giblets" ] 
    13581358 
    13591359bMotion_abstract_batchadd "blownAways" [list "/is blown off feet by force of %%'s statement%|%bot\[50,¬VAR{picksUp}\]" "/falls over%|%bot\[50,¬VAR{picksUp}\]" "/is blown away by force of %%'s statement%|%bot\[50,¬VAR{picksUp}\]" "ow my eyes :(" "/blinks" ":O" "o_O" ":o" "blimey" "crumbs" "i say" "lordy" ] 
     
    14491449bMotion_abstract_batchadd "pullsOut" [list "/pulls it out%|%bot\[50,¬VAR{wahey}\]" ] 
    14501450 
    1451 bMotion_abstract_batchadd "goodMornings" [list "Morning %%" "good morning %%" "What time do you call this?" "G'day" "*yawn*" "r"] 
     1451bMotion_abstract_batchadd "goodMornings" [list "%daytime %%" "good %daytime %%" "What time do you call this?" "G'day" "*yawn*" "r"] 
     1452 
     1453#clear out old good-morning text 
     1454bMotion_abstract_add_filter "goodMornings" "morning" 
    14521455 
    14531456bMotion_abstract_batchadd "stonedRandomStuff" [list "wheeeeeeee" "wheeeee..." "hey... i sound really stoned..." "hey, my hands are huge... they can touch anything but themselves... oh, wait" "slap my ass and call me charlie" "I don't think I'm ever going to come down" "peace" "flower power rules" "Did you ever wonder about the rising situation in Eastern Europe" "Hey, my TCL is HUGE" "I love you all" "look at all those beautiful colours" "I have to be stoned to feel normal" "see the marmalade skies" ] 
     
    21702173        "/wakes up" 
    21712174        "/awakens" 
    2172         "good morning!" 
    2173         "good morning" 
    2174         "morning" 
     2175        "good %daytime!" 
     2176        "good %daytime" 
     2177        "%daytime" 
    21752178        "r" 
    21762179        "mmm toast" 
  • trunk/modules/output.tcl

    r881 r882  
    202202        #set loops 0 
    203203        bMotion_putloglev 4 * "doing VAR processing" 
    204                 set lastloop "" 
     204        set lastloop "" 
    205205        while {[regexp -nocase {%VAR\{([^\}]+)\}(\{strip\})?} $line matches BOOM clean]} { 
    206                 #putlog "var: clean = $clean" 
    207206                global $BOOM 
    208                 #incr loops 
    209                 #if {$loops > 10} { 
    210                 #  putlog "bMotion: ALERT! looping too much in %VAR code with $line" 
    211                 #  set line "/has a tremendous error while trying to sort something out :(" 
    212                 #} 
    213207                #see if we have a new-style abstract available 
    214208                set newText [bMotion_abstract_get $BOOM] 
    215209                set replacement "" 
    216210                if {$newText == ""} { 
    217                                                 bMotion_putloglev d * "abstract '$BOOM' doesn't exist in new abstracts system!" 
     211                        bMotion_putloglev d * "abstract '$BOOM' doesn't exist in new abstracts system!" 
    218212                        #insert old style 
    219213                        set var [subst $$BOOM] 
    220214                        set replacement [pickRandom $var] 
    221215                } else { 
    222                                 set replacement $newText 
     216                        set replacement $newText 
    223217                } 
    224218                if {$clean != ""} { 
    225                                 set replacement [bMotion_strip_article $replacement] 
     219                        set replacement [bMotion_strip_article $replacement] 
    226220                } 
    227221                regsub -nocase "%VAR\{$BOOM\}$clean" $line $replacement line 
     
    229223                        set line [bMotionInsertString $line "%noun" "%VAR{sillyThings}"] 
    230224                } 
    231                                 if {$lastloop == $line} { 
     225                if {$lastloop == $line} { 
    232226                        putlog "bMotion: ALERT! looping too much in %VAR code with $line (no change since last parse)" 
    233227                        set line "/has a tremendous error while trying to sort something out :(" 
    234                                                 break 
    235                                 } 
    236                                 set lastloop $line 
     228                        break 
     229                } 
     230                set lastloop $line 
    237231        } 
    238232 
     
    258252        set loops 0 
    259253        bMotion_putloglev 4 * "doing NUMBER processing" 
    260                 set padding 0 
     254        set padding 0 
    261255        while {[regexp "%NUMBER\{(\[0-9\]+)\}(\{(\[0-9\]+)\})?" $line matches numberString paddingOpt padding]} { 
    262256                set var [bMotion_get_number [bMotion_rand_nonzero $numberString]] 
    263                                 if {$padding > 0} { 
    264                                                 set fmt "%0$padding" 
    265                                                 append fmt "u" 
    266                                                 set var [format $fmt $var] 
    267                                 } 
     257                if {$padding > 0} { 
     258                        set fmt "%0$padding" 
     259                        append fmt "u" 
     260                        set var [format $fmt $var] 
     261                } 
    268262                incr loops 
    269263                if {$loops > 10} { 
     
    272266                } 
    273267                set line [bMotionInsertString $line "%NUMBER\\{$numberString\\}(\\{\[0-9\]+\\})?" $var] 
    274                                 set padding 0 
    275         } 
    276  
    277                 set loops 0 
    278                 bMotion_putloglev 4 * "doing TIME processing" 
    279                 while {[regexp "%TIME\{(\[a-zA-Z0-9 -\]+)\}" $line matches timeString]} { 
    280                                 bMotion_putloglev 2 * "found timestring $timeString" 
    281                                 set origtime $timeString 
    282                                 regsub -nocase {^-([0-9]) minutes?$} $timeString "\\1 minutes ago" timeString 
    283                                 set var [clock scan $timeString] 
    284                                 set var [clock format $var -format "%I:%M %p"] 
    285                                 bMotion_putloglev 2 * "using time $var" 
    286                                 incr loops 
    287                                 if {$loops > 10} { 
    288                                                 putlog "bMotion: ALERT! looping too much in %TIME code with %line" 
    289                                                 set line "/has a tremendous error while trying to do complex time mathematics :(" 
    290                                 } 
    291                                 set line [bMotionInsertString $line "%TIME\\{$origtime\\}" $var] 
    292                 } 
     268                set padding 0 
     269        } 
     270 
     271        set loops 0 
     272        bMotion_putloglev 4 * "doing TIME processing" 
     273        while {[regexp "%TIME\{(\[a-zA-Z0-9 -\]+)\}" $line matches timeString]} { 
     274                bMotion_putloglev 2 * "found timestring $timeString" 
     275                set origtime $timeString 
     276                regsub -nocase {^-([0-9]) minutes?$} $timeString "\\1 minutes ago" timeString 
     277                set var [clock scan $timeString] 
     278                set var [clock format $var -format "%I:%M %p"] 
     279                bMotion_putloglev 2 * "using time $var" 
     280                incr loops 
     281                if {$loops > 10} { 
     282                        putlog "bMotion: ALERT! looping too much in %TIME code with %line" 
     283                        set line "/has a tremendous error while trying to do complex time mathematics :(" 
     284                } 
     285                set line [bMotionInsertString $line "%TIME\\{$origtime\\}" $var] 
     286        } 
    293287 
    294288        bMotion_putloglev 4 * "doing misc interpolation processing for $line" 
     
    303297        set line [bMotionInsertString $line "%2" $moreText] 
    304298        set line [bMotionInsertString $line "%percent" "%"] 
    305                  
    306  
    307                 bMotion_putloglev 4 * "done misc" 
     299        set line [bMotionInsertString $line "%daytime" [bMotion_get_daytime]] 
     300 
     301 
     302        bMotion_putloglev 4 * "done misc" 
    308303 
    309304        #ruser: 
  • trunk/modules/system.tcl

    r870 r882  
    11061106} 
    11071107 
     1108proc bMotion_get_daytime { } { 
     1109        set hour [clock format [clock seconds] -format "%H"] 
     1110 
     1111        if {$hour < 1} { 
     1112                return "evening" 
     1113        } 
     1114 
     1115        if {$hour < 12} { 
     1116                return "morning" 
     1117        } 
     1118 
     1119        if {$hour < 6} { 
     1120                return "afternoon" 
     1121        } 
     1122 
     1123        return "evening" 
     1124} 
     1125 
    11081126bMotion_putloglev d * "bMotion: system module loaded" 
    11091127 
  • trunk/plugins/en/complex_sucks.tcl

    r741 r882  
    1717 
    1818proc bMotion_plugin_complex_sucks { nick host handle channel text } { 
    19         global botnicks 
     19                global botnicks 
    2020 
    21   if [regexp -nocase {([^ ]+) ((is|si|==) (teh|the)? )?sucks?} $text matches item] { 
    22     if {$item == "=="} { 
    23       return 0 
    24     } 
     21                if [regexp -nocase {([^ ]+) ((is|si|==) (teh|the)? )?sucks?} $text matches item] { 
     22                                if {$item == "=="} { 
     23                                                return 0 
     24                                } 
    2525 
    26                 if {[string tolower $item] == "i"} { 
    27                         return 0 
     26                                if {[string tolower $item] == "i"} { 
     27                                                return 0 
     28                                } 
     29 
     30                                if [regexp -nocase "you|we|really|=|i|$botnicks" $item] { 
     31                                                return 0 
     32                                } 
     33 
     34                                bMotionDoAction $channel $item "%VAR{sucks}" 
     35                                return 1 
    2836                } 
    29  
    30                 if [regexp -nocase "=|i|$botnicks" $item] { 
    31                         return 0 
    32                 } 
    33  
    34     bMotionDoAction $channel $item "%VAR{sucks}" 
    35                 return 1 
    36   } 
    3737} 
    3838 
  • trunk/plugins/en/simple_general.tcl

    r875 r882  
    5454 
    5555bMotion_plugin_add_simple "centipedes" {[a-z]+\? in my [a-z]+\?} 70 [list "it's more likely than you think"] "en" 
    56  
     56bMotion_plugin_add_simple "cilit" "they're a challenge" 80 [list "but not... for Cilit Bang!"] "en" 
    5757bMotion_plugin_add_simple "cunt" "^(cunt|twat|bollocks)" 80 [list "cunt" "twat" "bollocks" "bastards" "idiot" "wanker" "%VAR{prom_first}" "pile of %VAR{prom_first}" "%VAR{prom_first}ing %VAR{prom_first}ers"] "en" 
  • trunk/plugins/en/simple_ick.tcl

    r753 r882  
    3131  "John Major"  
    3232  "your dad"  
    33   "Jed"  
    3433  "the entire crew of Voyager"  
    3534  "your mum" 
    36   "Joost" 
    3735  "Bill Gates" 
    38   "damo" 
    39   "jms" 
    40   "Colen" 
    4136  "the Kazon" 
    4237  "the cast of Dallas" 
     
    5146  "Tim" 
    5247  "Brian" 
     48        "%ruser{male}" 
    5349} 
    5450 
    5551bMotion_abstract_register "ick_females" 
    5652bMotion_abstract_batchadd "ick_females" {  
    57   "wendy"  
    58   "sue"  
    59   "cherie blair"  
    6053  "the queen"  
    6154  "your mum"  
     
    6356  "that really minging woman who was on Eurovision"  
    6457  "Ling Xiaoyu" 
    65   "Domilijn" 
    66   "monica" 
    6758  "Britney Spears" 
    6859  "Ling Xiaoyu" 
     
    7162  "Jade of Big Brother" 
    7263  "Davina McCall" 
    73   "Cath 2's mum" 
     64        "%ruser{female}" 
    7465} 
    7566 
     
    8677  "pantyhose" 
    8778  "chains" 
     79        "hotpants" 
    8880} 
    8981 
     
    9789bMotion_abstract_register "ick_locations" 
    9890bMotion_abstract_batchadd "ick_locations" {  
    99   "in your bed" "on wendy's desk" "in the yellow room"  
    100   "on a chair in the Nash lounge" "on the Nash kitchen table" "in a field" "on a checkout" "against a fish tank"  
     91  "in your bed"    
     92  "on a chair" "in a field" "on a checkout" "against a fish tank"  
    10193  "on a trampoline" "from behind"  
    102   "on a train" "on a bus" "in a swimming pool" "at the bus stop" "in your parents' bed" "under that bush" "on dunos' sofa" 
    103   "at James' PC" "under your desk" "at the local Tesco" "over there -->" "in the shower" "behind the bikesheds" 
    104   "on TalkCity" "in #New2Internet" "on Chabbys front porch" "in Essex" "in Wales" "on a hilltop" "at Pontins" "for a porn site" 
     94  "on a train" "on a bus" "in a swimming pool" "at the bus stop" "in your parents' bed" "under that bush"  
     95  "under your desk" "at the local Tesco" "over there -->" "in the shower" "behind the bikesheds" 
     96    "in Essex" "in Wales" "on a hilltop" "at Pontins" "for a porn site" 
    10597  "in %OWNER{%ruser} bed" 
    10698} 
     
    116108  "fscking" 
    117109  "fux0ring" 
     110        "rogering" 
     111        "making sweet love to" 
    118112} 
    119113