Ticket #76: summon.fix.diff

File summon.fix.diff, 2.9 KB (added by znxster@…, 6 years ago)

Update to !summon

  • plugins/en/complex_summon.tcl

     
    1515# random summoning callback 
    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" 
    2021        # check to make sure we should bother 
     
    3839                if { $name != "" && $name != $nick } { 
    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 { 
    44                                 bMotion_putloglev d * "bMotion: (summon) answering for someone here" 
    45                                 if [isbotnick $name] { 
     51                                # the botnick could exist but be shorthand 
     52                                if [isbotnick $name || regexp -nocase "$botnicks" $name] { 
     53                                        bMotion_putloglev d * "bMotion: (summon) myself!" 
    4654                                        bMotionDoAction $channel $nick "%VAR{summon_bot}" 
    4755                                        return 1 
    4856                                } 
     57                                bMotion_putloglev d * "bMotion: (summon) answering for someone here" 
    4958                                bMotionDoAction $channel $name "%VAR{summon_channel_response}" 
    5059                                set msg [pickRandom $summon_privmsg_response] 
    5160                                # replacements 
     
    6776# register the summon callback 
    6877bMotion_plugin_add_complex "summon" "^!summon" 100 "bMotion_plugin_complex_summon" "en" 
    6978 
    70 set summon_channel_response_notthere { 
     79bMotion_abstract_register "summon_channel_response_notthere" 
     80bMotion_abstract_batchadd "summon_channel_response_notthere" { 
    7181        "yoooo hooooo! %%!" 
    7282        "hello there, %%?" 
    7383        "how should I know where %% is?" 
     
    7787        "/searches all over the channel for %%" 
    7888} 
    7989 
    80 set summon_channel_response { 
     90bMotion_abstract_register "summon_channel_response" 
     91bMotion_abstract_batchadd "summon_channel_response" { 
    8192        "/prods at %% with %noun" 
    8293        "through my awesome powers of telepathy, I shall summon %%!!" 
    8394        "/uses a smoke signal to get %%'s attention" 
     
    8697        "why do you want to talk to %%?" 
    8798} 
    8899 
    89 set summon_privmsg_response { 
     100bMotion_abstract_register "summon_privmsg_response" 
     101bMotion_abstract_batchadd "summon_privmsg_response" { 
    90102        "FYI: %% was looking for you on %chan" 
    91103        "just so you know %% was asking about you on %chan" 
    92104        "%% was too lazy to message you from %chan themselves so I had to" 
     
    95107        "Oi! %chan now! %% looking for you!" 
    96108} 
    97109 
    98 set summon_channel_idiot { 
     110bMotion_abstract_register "summon_privmsg_response" 
     111Motion_abstract_batchadd "summon_channel_idiot" { 
    99112        "ANNOUNCEMENT: %% is an idiot. That is all." 
    100113        "Pay no attention to %%, the village idiot." 
    101114        "oOoOooOO very good %%... now who are you looking for?"