Changeset 1033 for trunk/plugins/en/output_ruser.tcl
- Timestamp:
- 09/11/09 14:40:18 (3 years ago)
- File:
-
- 1 edited
-
trunk/plugins/en/output_ruser.tcl (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/plugins/en/output_ruser.tcl
r1019 r1033 11 11 ############################################################################### 12 12 13 # %ruser 14 # %ruser{friend} 15 # %ruser{friend:owner} 16 # %ruser{:owner} 13 17 14 18 proc bMotion_plugin_output_ruser { channel line } { 15 19 bMotion_putloglev 4 * "bMotion_plugin_output_ruser $channel $line" 16 20 17 if {[regexp "%ruser(\{(\[^\}\]+)\})?" $line matches param condition]} { 18 set ruser [bMotionGetRealName [bMotion_choose_random_user $channel 0 $condition] ""] 19 if {$condition == ""} { 20 set findString "%ruser" 21 } else { 22 set findString "%ruser$param" 21 if [regexp "%ruser(\{(\[a-z\]*)?(:(\[a-z,\]+))?\})?" $line matches allopts filter optstring options] { 22 bMotion_putloglev 1 * "found %ruser with filter=$filter and options=$options" 23 24 set ruser [bMotionGetRealName [bMotion_choose_random_user $channel 0 $filter] ""] 25 26 set options_list [split $options ","] 27 foreach option $options_list { 28 bMotion_putloglev 1 * "working on option $option" 29 switch $option { 30 "owner" { 31 set ruser [bMotionMakePossessive $ruser] 32 } 33 "caps" { 34 set ruser [string toupper $ruser] 35 } 36 default { 37 putlog "bMotion: unexpected option $option in $matches" 38 } 39 } 23 40 } 24 regsub $ findString$line $ruser line41 regsub $matches $line $ruser line 25 42 } 43 26 44 return $line 27 45 }
Note: See TracChangeset
for help on using the changeset viewer.
