Changeset 887

Show
Ignore:
Timestamp:
16/02/2008 20:06:59 (9 months ago)
Author:
james
Message:

allow more brackets

Files:
1 modified

Legend:

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

    r885 r887  
    1313 
    1414#                          name   regexp               chance  callback 
    15 bMotion_plugin_add_complex "calculator" {what('s| is) (\(?\s*[0-9.]+(\s*[+/*x%-]\s*\(?\s*[0-9.]+\s*\)?)+\s*\)?)} 100 "bMotion_plugin_complex_calculator" "en" 
     15bMotion_plugin_add_complex "calculator" {what('s| is) (\(*\s*[0-9.]+(\s*[+/*x%-]\s*\(*\s*[0-9.]+\s*\)*)+\s*\)*)} 100 "bMotion_plugin_complex_calculator" "en" 
    1616 
    1717################################################################################################################################# 
     
    2020proc bMotion_plugin_complex_calculator { nick host handle channel text } { 
    2121        if {[bMotionTalkingToMe $text] || [bMotion_interbot_me_next $channel]} { 
    22                 if [regexp -nocase {(\(?\s*[0-9.]+(\s*[+/*x%-]\s*\(?\s*[0-9.]+\s*\)?)+\s*\)?)} $text matches sum] { 
     22                if [regexp -nocase {(\(*\s*[0-9.]+(\s*[+/*x%-]\s*\(*\s*[0-9.]+\s*\)*)+\s*\)*)} $text matches sum] { 
    2323                        set sum [string map { x * } $sum] 
    2424                        set sum [string trim $sum]