Ignore:
Timestamp:
08/23/09 19:22:05 (3 years ago)
Author:
james
Message:

New output parser for core plugins - should fix problems with late replacements getting missed

File:
1 edited

Legend:

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

    r961 r1019  
    1 # 
    2 # 
    31# vim: fdm=indent fdn=1 
    42# 
     
    64############################################################################### 
    75# This is a bMotion plugin 
    8 # Copyright (C) James Michael Seward 2000-2008 
     6# Copyright (C) James Michael Seward 2000-2009 
    97# 
    108# This program is covered by the GPL, please refer the to LICENCE file in the 
     
    2119        bMotion_putloglev 4 * "bMotion_plugin_output_NUMBER $channel $line" 
    2220 
    23         set lastline "" 
    24  
    2521        set padding 0 
    26         while {[regexp "%NUMBER\{(\[0-9\]+)\}(\{(\[0-9\]+)\})?" $line matches numberString paddingOpt padding]} { 
     22        if {[regexp "%NUMBER\{(\[0-9\]+)\}(\{(\[0-9\]+)\})?" $line matches numberString paddingOpt padding]} { 
    2723                set var [bMotion_get_number [bMotion_rand_nonzero $numberString]] 
    2824                if {$padding > 0} { 
     
    3329                set line [bMotionInsertString $line "%NUMBER\\{$numberString\\}(\\{\[0-9\]+\\})?" $var] 
    3430                set padding 0 
    35  
    36                 if {$lastline == $line} { 
    37                         putlog "bMotion: ALERT! unable to process %NUMBER in $line (dropping output)" 
    38                         set line "" 
    39                         break 
    40                 } 
    41                 set lastline $line 
    4231        } 
    4332 
Note: See TracChangeset for help on using the changeset viewer.