Changeset 887 for trunk/plugins/en/complex_calculator.tcl
- Timestamp:
- 02/16/08 20:06:59 (11 months ago)
- Files:
-
- 1 modified
-
trunk/plugins/en/complex_calculator.tcl (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/plugins/en/complex_calculator.tcl
r885 r887 13 13 14 14 # 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"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" 16 16 17 17 ################################################################################################################################# … … 20 20 proc bMotion_plugin_complex_calculator { nick host handle channel text } { 21 21 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] { 23 23 set sum [string map { x * } $sum] 24 24 set sum [string trim $sum]
