| 96 | | if { [regexp -nocase "^$botnicks,?:? do you (need|want) (a|these|this|some|the|those|that)" $text] || |
| 97 | | [regexp -nocase "^do you (want|need) (a|these|this|some|the|those|that) .* $botnicks ?\\?" $text] || |
| 98 | | [regexp -nocase "^$botnicks,?:? would you like" $text] || |
| 99 | | [regexp -nocase "^would you like .+ $botnicks" $text] || |
| 100 | | [regexp -nocase "^$botnicks,?:? (do )?((yo)?u )?wanna" $text] || |
| 101 | | [regexp -nocase "^(do )?((yo)?u )?wanna .+ $botnicks" $text] } { |
| 102 | | bMotion_plugin_complex_question_want $nick $channel $host |
| | 96 | set item "" |
| | 97 | if { [regexp -nocase "^$botnicks,?:? do you (need|want) (a|these|this|some|the|those|that) (.+)" $text matches a b c item] || |
| | 98 | [regexp -nocase "^do you (want|need) (a|these|this|some|the|those|that) (.*) $botnicks ?\\?" $text matches a b item] || |
| | 99 | [regexp -nocase "^$botnicks,?:? would you like (.+)" $text matches a item] || |
| | 100 | [regexp -nocase "^(do|would) you like (.+) $botnicks" $text matches item] || |
| | 101 | [regexp -nocase "^$botnicks,?:? (do )?((yo)?u )?wanna (.+)" $text matches item] || |
| | 102 | [regexp -nocase "^(do )?((yo)?u )?wanna (.+) $botnicks" $text matches item] } { |
| | 103 | bMotion_plugin_complex_question_want $nick $channel $host $item |
| 361 | | bMotionDoAction $channel [bMotionGetRealName $nick $host] "%VAR{question_want_reply_wrapper}" |
| | 362 | |
| | 363 | if {$item != ""} { |
| | 364 | # let's try to figure out if this is an item proper or something like "to go home" etc |
| | 365 | if {[regexp -nocase "^(to)" $item]} { |
| | 366 | # TODO: scope for improvement --^ |
| | 367 | bMotion_putloglev 3 * "item actually looks like an action, using generic answer for now" |
| | 368 | bMotionDoAction $channel [bMotionGetRealName $nick $host] "%VAR{question_want_reply_wrapper}" |
| | 369 | return 1 |
| | 370 | } |
| | 371 | |
| | 372 | # TODO: check if it's a user |
| | 373 | # TODO: factorise this code? |
| | 374 | # TODO: other tests? |
| | 375 | |
| | 376 | bMotion_putloglev 3 * "item looks like an item!" |
| | 377 | set original_item $item |
| | 378 | set item [string tolower [bMotion_strip_article $item]] |
| | 379 | regsub {\?} $item "" item |
| | 380 | regsub "s$" $item "" item |
| | 381 | |
| | 382 | if [bMotion_abstract_contains "_bmotion_like" $item] { |
| | 383 | bMotionDoAction $channel $original_item "%VAR{want_item_like}" $nick |
| | 384 | return 1 |
| | 385 | } |
| | 386 | |
| | 387 | if [bMotion_abstract_contains "_bmotion_dislike" $item] { |
| | 388 | bMotionDoAction $channel $original_item "%VAR{want_item_dislike}" $nick |
| | 389 | return 1 |
| | 390 | } |
| | 391 | |
| | 392 | if {[rand 100] > 80} { |
| | 393 | bMotionDoAction $channel $original_item "%VAR{want_item_dislike}" $nick |
| | 394 | bMotion_abstract_add "_bmotion_dislike" $item |
| | 395 | } else { |
| | 396 | bMotionDoAction $channel $original_item "%VAR{want_item_like}" $nick |
| | 397 | bMotion_abstract_add "_bmotion_like" $item |
| | 398 | } |
| | 399 | return 1 |
| | 400 | } |
| | 401 | |
| | 402 | if {$item == ""} { |
| | 403 | bMotion_putloglev 3 * "item is blank, using generic want answer" |
| | 404 | bMotionDoAction $channel [bMotionGetRealName $nick $host] "%VAR{question_want_reply_wrapper}" |
| | 405 | } |
| | 406 | |