Changeset 248


Ignore:
Timestamp:
09/09/03 19:46:13 (8 years ago)
Author:
kevdadrum
Message:

Moved some question handling from simple_general into complex_questions where I think it belongs: this fixes the problem I was having where I couldn't get complex_questions to listen to "do you want this thingie?" because the simple handler was grabbing it first.

Location:
trunk/plugins/en
Files:
2 edited

Legend:

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

    r246 r248  
    1616 
    1717proc bMotion_plugin_complex_question { nick host handle channel text } { 
    18  
     18  bMotion_putloglev 2 * "Question handler triggerred" 
    1919  global botnicks bMotionFacts 
    2020 
    2121  regsub {(.+)[>\/]$} $text {\1?} text 
    22  
     22  bMotion_putloglev 3 * "Checking question for 'what'" 
    2323  ## What question targeted at me 
    2424  if { [regexp -nocase "what('?s)?(.+)" $text matches s question] || 
     
    3333  } 
    3434 
     35  bMotion_putloglev 3 * "Checking question for 'with/at/against'" 
    3536  ## With/at/against who question targeted at me 
    3637  if { [regexp -nocase "^$botnicks,?:? (with|at|against|by) who" $text ma mb prop] || 
     
    4041  } 
    4142 
     43  bMotion_putloglev 3 * "Checking question for 'who'" 
    4244  ## Who question targeted at me 
    4345  if { [regexp -nocase "^$botnicks,?:? who(se|'s)? " $text matches bot owner] || 
     
    4749  } 
    4850 
     51  bMotion_putloglev 3 * "Checking question for 'want'" 
    4952  ## Want question targetted at me 
    5053  if { [regexp -nocase "^$botnicks,?:? do you (need|want) (a|these|this|some|the|those|that)" $text] || 
     
    5356      return 1 
    5457  } 
    55    
     58 
     59  bMotion_putloglev 3 * "Checking question for 'why'" 
    5660  ## Why question targeted at me 
    5761  if { [regexp -nocase "^$botnicks,?:? why" $text] || 
     
    6165  } 
    6266 
     67  bMotion_putloglev 3 * "Checking question for 'where'" 
    6368  ## Where question targeted at me 
    6469  if { [regexp -nocase "^$botnicks,?:? where" $text] || 
     
    6873  } 
    6974 
     75  bMotion_putloglev 3 * "Checking question for 'how many'" 
    7076  ## How many question targeted at me 
    7177  if { [regexp -nocase "^$botnicks,?:? how ?many" $text] || 
     
    7581  } 
    7682 
     83  bMotion_putloglev 3 * "Checking question for 'when'" 
    7784  ## When question targeted at me 
    7885  if { [regexp -nocase "^$botnicks,?:? (when|what time)" $text] || 
     
    8289  } 
    8390 
     91  bMotion_putloglev 3 * "Checking question for 'how'" 
    8492  ## How question targeted at me 
    8593  if { [regexp -nocase "^$botnicks,?:? how" $text] || 
     
    8997  } 
    9098 
     99  bMotion_putloglev 3 * "Checking question for some general questions"     
     100  # some other random responses, handled here rather than simple_general so as not to break other code   
     101    if [regexp -nocase  "^${botnicks}:?,? do(n'?t)? you (like|want|find .+ attractive|get horny|(find|think) .+ (is ?)horny|have|keep)" $text] { 
     102    bMotion_putloglev 2 * "$nick general question" 
     103    bMotionDoAction $channel [bMotionGetRealName $nick $host] "%VAR{yesnos}" 
     104    return 1 
     105  } 
     106     
    91107  # me .... ? 
    92108  if [regexp -nocase "^${botnicks}:?,? (.+)\\?$" $text ming ming2 question] { 
     109    bMotion_putloglev 2 * "$nick final question catch" 
    93110    bMotionDoAction $channel [bMotionGetRealName $nick $host] "%VAR{randomReplies}" 
    94111    return 1 
     
    97114  # ... me? 
    98115  if [regexp -nocase "${botnicks}\\?$" $text bhar ming what] { 
     116    bMotion_putloglev 2 * "$nick very final question catch" 
    99117    if { [rand 2] == 1 } { 
    100118      bMotionDoAction $channel [bMotionGetRealName $nick $host] "%VAR{randomReplies}" 
     
    104122 
    105123  if [bMotionTalkingToMe $text] { 
     124    bMotion_putloglev 2 * "$nick talkingtome catch" 
    106125    bMotionDoAction $channel [bMotionGetRealName $nick $host] "%VAR{randomReplies}" 
    107126    return 1 
     
    111130 
    112131proc bMotion_plugin_complex_question_what { nick channel host question } { 
     132    bMotion_putloglev 2 * "$nick what is $question question" 
    113133    global bMotionInfo bMotionFacts bMotionOriginalInput 
    114134    #see if we know the answer to it 
     
    156176 
    157177proc bMotion_plugin_complex_question_when { nick channel host } { 
     178    bMotion_putloglev 2 * "$nick When question" 
    158179  bMotionDoAction $channel [bMotionGetRealName $nick $host] "%VAR{answerWhens}" 
    159180  return 1 
     
    161182 
    162183proc bMotion_plugin_complex_question_with { nick channel host prop } { 
     184    bMotion_putloglev 2 * "$nick with question" 
    163185  set answer "$prop %VAR{answerWithWhos}" 
    164186  bMotionDoAction $channel [bMotionGetRealName $nick $host] $answer 
     
    167189 
    168190proc bMotion_plugin_complex_question_who { nick channel host owner } { 
     191    bMotion_putloglev 2 * "$nick who question" 
    169192  if {$owner == "se"} { 
    170193    set line "%OWNER[%VAR{answerWhos}]" 
     
    177200 
    178201proc bMotion_plugin_complex_question_want { nick channel host } { 
     202    bMotion_putloglev 2 * "$nick Want/need question" 
    179203    bMotionDoAction $channel [bMotionGetRealName $nick $host] "%VAR{question_want_reply_wrapper}" 
    180204    return 1 
     
    182206 
    183207proc bMotion_plugin_complex_question_why { nick channel host } { 
     208    bMotion_putloglev 2 * "$nick why question" 
    184209  bMotionDoAction $channel [bMotionGetRealName $nick $host] "%VAR{answerWhys}" 
    185210  return 1 
     
    187212 
    188213proc bMotion_plugin_complex_question_where { nick channel host } { 
     214    bMotion_putloglev 2 * "$nick where question" 
    189215  bMotionDoAction $channel [bMotionGetRealName $nick $host] "%VAR{answerWheres}" 
    190216  return 1 
     
    192218 
    193219proc bMotion_plugin_complex_question_many { nick channel host } { 
     220    bMotion_putloglev 2 * "$nick how many question" 
    194221  bMotionDoAction $channel [bMotionGetRealName $nick $host] "%VAR{answerHowmanys}" 
    195222  return 1 
     
    197224 
    198225proc bMotion_plugin_complex_question_how { nick channel host } { 
     226    bMotion_putloglev 2 * "$nick how question" 
    199227  bMotionDoAction $channel [bMotionGetRealName $nick $host] "%VAR{answerHows}" 
    200228  return 1 
  • trunk/plugins/en/simple_general.tcl

    r170 r248  
    3232bMotion_plugin_add_simple "didn't!" "^i didn'?t!?$" 40 "%VAR{ididntresponses}" "en" 
    3333bMotion_plugin_add_simple "ow" "^(ow+|ouch|aie+)!*$" 50 "%VAR{awwws}" "en" 
    34 bMotion_plugin_add_simple "question-have" "^%botnicks:?,? do(n'?t)? you (like|want|find .+ attractive|get horny|(find|think) .+ (is ?)horny|have|keep)" 100 "%VAR{yesnos}" "en" 
     34#kis moved the following line to complex_questions because it was breaking stuff. 
     35#kis bMotion_plugin_add_simple "question-have" "^%botnicks:?,? do(n'?t)? you (like|want|find .+ attractive|get horny|(find|think) .+ (is ?)horny|have|keep)" 100 "%VAR{yesnos}" "en" 
    3536bMotion_plugin_add_simple "dude" "^Dude!$" 40 "%VAR{sweet}" "en" 
    3637bMotion_plugin_add_simple "sweet" "^Sweet!$" 40 "%VAR{dude}" "en" 
Note: See TracChangeset for help on using the changeset viewer.