Changeset 716


Ignore:
Timestamp:
09/13/06 09:16:59 (6 years ago)
Author:
james
Message:

fix summoning ourselves #76, patch by znx

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/plugins/en/complex_summon.tcl

    r715 r716  
    1616proc bMotion_plugin_complex_summon { nick host handle channel text } { 
    1717        global summon_privmsg_response 
     18        global botnicks 
    1819 
    1920        # bMotion_putloglev d * "bMotion: (summon) entering" 
     
    3940                        # summon the best we can 
    4041                        if { ![onchan $name $channel] } { 
     42                                # the botnick could be non-existant 
     43                                if [regexp -nocase "^$botnicks\$" $name] { 
     44                                        bMotion_putloglev d * "bMotion: (summon) myself!" 
     45                                        bMotionDoAction $channel $nick "%VAR{summon_bot}" 
     46                                        return 1 
     47                                } 
    4148                                bMotion_putloglev d * "bMotion: (summon) answering for someone not here" 
    4249                                bMotionDoAction $channel $name "%VAR{summon_channel_response_notthere}" 
    4350                        } else { 
     51                                # the botnick could exist but be shorthand 
     52                                if [isbotnick $name || regexp -nocase "$botnicks" $name] { 
     53                                        bMotion_putloglev d * "bMotion: (summon) myself!" 
     54                                bMotionDoAction $channel $nick "%VAR{summon_bot}" 
     55                                return 1 
     56                        } 
    4457                                bMotion_putloglev d * "bMotion: (summon) answering for someone here" 
    4558                                if [isbotnick $name] { 
     
    4861                                } 
    4962                                bMotionDoAction $channel $name "%VAR{summon_channel_response}" 
    50                                 set msg [pickRandom $summon_privmsg_response] 
    51                                 # replacements 
     63                                #set msg [pickRandom $summon_privmsg_response] 
     64                                set msg [doInterpolation "%VAR{summon_privmsg_response}" $nick ""] 
     65                                # replacements (TODO: may not be needed after doInterpolation) 
    5266                                regsub "%chan" $msg $channel msg  
    5367                                regsub "%%" $msg $nick msg 
    5468                                # notify 
    55                                 puthelp "NOTICE $name :$msg" 
    5669                                puthelp "PRIVMSG $name :$msg" 
    5770                        } 
     
    6881bMotion_plugin_add_complex "summon" "^!summon" 100 "bMotion_plugin_complex_summon" "en" 
    6982 
    70 set summon_channel_response_notthere { 
     83bMotion_abstract_register "summon_channel_response_notthere" 
     84bMotion_abstract_batchadd "summon_channel_response_notthere" { 
    7185        "yoooo hooooo! %%!" 
    7286        "hello there, %%?" 
     
    7892} 
    7993 
    80 set summon_channel_response { 
     94bMotion_abstract_register "summon_channel_response" 
     95bMotion_abstract_batchadd "summon_channel_response" { 
    8196        "/prods at %% with %noun" 
    8297        "through my awesome powers of telepathy, I shall summon %%!!" 
     
    87102} 
    88103 
    89 set summon_privmsg_response { 
     104bMotion_abstract_register "summon_privmsg_response" 
     105bMotion_abstract_batchadd "summon_privmsg_response" { 
    90106        "FYI: %% was looking for you on %chan" 
    91107        "just so you know %% was asking about you on %chan" 
     
    96112} 
    97113 
    98 set summon_channel_idiot { 
     114bMotion_abstract_register "summon_channel_idiot" 
     115bMotion_abstract_batchadd "summon_channel_idiot" { 
    99116        "ANNOUNCEMENT: %% is an idiot. That is all." 
    100117        "Pay no attention to %%, the village idiot." 
Note: See TracChangeset for help on using the changeset viewer.