Show
Ignore:
Timestamp:
05/20/08 17:08:12 (8 months ago)
Author:
james
Message:

new plugin enable/disable bits

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/modules/plugins.tcl

    r898 r907  
    5858## Load a simple plugin 
    5959proc bMotion_plugin_add_simple { id match chance response language} { 
    60   global bMotion_plugins_simple plugins bMotion_testing bMotion_noplugins 
    61  
    62   if {$bMotion_testing == 0} { 
    63     catch { 
    64       set test $bMotion_plugins_simple($id) 
    65       bMotion_putloglev d * "bMotion: ALERT! Simple plugin $id is defined more than once" 
    66       return 0 
    67     } 
    68   } 
    69   if [bMotion_plugin_check_allowed "simple:$id"] { 
    70     set bMotion_plugins_simple($id) "${match}Š${chance}Š${response}Š${language}" 
    71     bMotion_putloglev 2 * "bMotion: added simple plugin: $id" 
    72     append plugins "$id," 
    73     return 1 
    74   } 
    75   bMotion_putloglev d * "bMotion: ignoring disallowed plugin simple:$id" 
     60        global bMotion_plugins_simple plugins bMotion_testing bMotion_noplugins 
     61 
     62        if {$bMotion_testing == 0} { 
     63                catch { 
     64                        set test $bMotion_plugins_simple($id) 
     65                        bMotion_putloglev d * "bMotion: ALERT! Simple plugin $id is defined more than once" 
     66                        return 0 
     67                } 
     68        } 
     69        if [bMotion_plugin_check_allowed "simple:$id"] { 
     70                set bMotion_plugins_simple($id) "${match}Š${chance}Š${response}Š${language}" 
     71                bMotion_putloglev 2 * "bMotion: added simple plugin: $id" 
     72                append plugins "$id," 
     73                return 1 
     74        } 
     75        bMotion_putloglev d * "bMotion: ignoring disallowed plugin simple:$id" 
    7676        set bMotion_noplugins 1 
    7777} 
     
    8080## Find a simple plugin 
    8181proc bMotion_plugin_find_simple { text lang } { 
    82   bMotion_putloglev 3 * "bMotion_plugin_find_simple: text = $text, lang = $lang" 
    83   global bMotion_plugins_simple botnicks 
    84   set s [lsort [array names bMotion_plugins_simple]] 
    85  
    86   foreach key $s { 
    87     if {$key == "dummy"} { continue } 
    88     set val $bMotion_plugins_simple($key) 
    89     set blah [split $val "Š"] 
    90     set rexp [lindex $blah 0] 
    91     set chance [lindex $blah 1] 
    92     set response [lindex $blah 2] 
    93     set language [lindex $blah 3] 
    94     if {[string match $lang $language] || ($language == "any")} { 
    95       set rexp [bMotionInsertString $rexp "%botnicks" "${botnicks}"] 
    96       if [regexp -nocase $rexp $text] { 
    97         set c [rand 100] 
    98         bMotion_putloglev 4 * "simple plugin $key matches" 
    99         if {[bMotion_plugins_settings_get "system" "last_simple" "" ""] == $key} { 
    100           bMotion_putloglev 3 * "trying to trigger same simple plugin twice in a row, aborting" 
    101           return "" 
    102         } 
    103             bMotion_plugins_settings_set "system" "last_simple" "" "" $key 
    104         if {$chance > $c} { 
    105           bMotion_putloglev 4 * "  `- firing" 
    106           return $response 
    107         } 
    108       } 
    109     } 
    110   } 
    111   return "" 
     82        bMotion_putloglev 3 * "bMotion_plugin_find_simple: text = $text, lang = $lang" 
     83        global bMotion_plugins_simple botnicks 
     84        set s [lsort [array names bMotion_plugins_simple]] 
     85 
     86        foreach key $s { 
     87                if {$key == "dummy"} { continue } 
     88                set val $bMotion_plugins_simple($key) 
     89                set blah [split $val "Š"] 
     90                set rexp [lindex $blah 0] 
     91                set chance [lindex $blah 1] 
     92                set response [lindex $blah 2] 
     93                set language [lindex $blah 3] 
     94                if {[string match $lang $language] || ($language == "any")} { 
     95                        set rexp [bMotionInsertString $rexp "%botnicks" "${botnicks}"] 
     96                        if [regexp -nocase $rexp $text] { 
     97                                set c [rand 100] 
     98                                bMotion_putloglev 4 * "simple plugin $key matches" 
     99                                if {[bMotion_plugins_settings_get "system" "last_simple" "" ""] == $key} { 
     100                                        bMotion_putloglev 3 * "trying to trigger same simple plugin twice in a row, aborting" 
     101                                        return "" 
     102                                } 
     103                        bMotion_plugins_settings_set "system" "last_simple" "" "" $key 
     104                                if {$chance > $c} { 
     105                                        bMotion_putloglev 4 * "  `- firing" 
     106                                        return $response 
     107                                } 
     108                        } 
     109                } 
     110        } 
     111        return "" 
    112112} 
    113113 
     
    115115## Load management plugin: TODO: Still generating dups? 
    116116proc bMotion_plugin_add_management { id match flags callback { language "" } { helpcallback "" } } { 
    117   global bMotion_plugins_management plugins bMotion_testing bMotion_noplugins 
    118  
    119   if {$bMotion_testing == 0} { 
    120     catch { 
    121       set test $bMotion_plugins_management($id) 
    122       bMotion_putloglev d * "bMotion: ALERT! management plugin $id is defined more than once ($bMotion_testing)" 
    123       return 0 
    124     } 
     117        global bMotion_plugins_management plugins bMotion_testing bMotion_noplugins 
     118 
     119        if {$bMotion_testing == 0} { 
     120                catch { 
     121                        set test $bMotion_plugins_management($id) 
     122                        bMotion_putloglev d * "bMotion: ALERT! management plugin $id is defined more than once ($bMotion_testing)" 
     123                        return 0 
     124                } 
    125125                if [bMotion_plugin_check_allowed "management:$id"] { 
    126126                        set bMotion_plugins_management($id) "${match}Š${flags}Š${callback}Š${helpcallback}" 
     
    136136## Find management plugin 
    137137proc bMotion_plugin_find_management { text } { 
    138   global bMotion_plugins_management 
    139   set s [array startsearch bMotion_plugins_management] 
    140  
    141   while {[set key [array nextelement bMotion_plugins_management $s]] != ""} { 
    142     if {$key == "dummy"} { continue } 
    143     set val $bMotion_plugins_management($key) 
    144     set blah [split $val "Š"] 
    145     set rexp [lindex $blah 0] 
    146     set flags [lindex $blah 1] 
    147     set callback [lindex $blah 2] 
    148     if [regexp -nocase $rexp $text] { 
    149       array donesearch bMotion_plugins_management $s 
    150       return "${flags}Š$callback" 
    151     } 
    152   } 
    153   array donesearch bMotion_plugins_management $s 
    154   return "" 
     138        global bMotion_plugins_management 
     139        set s [array startsearch bMotion_plugins_management] 
     140 
     141        while {[set key [array nextelement bMotion_plugins_management $s]] != ""} { 
     142                if {$key == "dummy"} { continue } 
     143                set val $bMotion_plugins_management($key) 
     144                set blah [split $val "Š"] 
     145                set rexp [lindex $blah 0] 
     146                set flags [lindex $blah 1] 
     147                set callback [lindex $blah 2] 
     148                if [regexp -nocase $rexp $text] { 
     149                        array donesearch bMotion_plugins_management $s 
     150                        return "${flags}Š$callback" 
     151                } 
     152        } 
     153        array donesearch bMotion_plugins_management $s 
     154        return "" 
    155155} 
    156156 
    157157#find a management plugin's help callback 
    158158proc bMotion_plugin_find_management_help { name } { 
    159   global bMotion_plugins_management 
    160   set s [array startsearch bMotion_plugins_management] 
    161  
    162   while {[set key [array nextelement bMotion_plugins_management $s]] != ""} { 
    163     if {$key == "dummy"} { continue } 
    164     if [string match -nocase $name $key] { 
    165         set blah [split $bMotion_plugins_management($key) "Š"] 
    166           set helpcallback [lindex $blah 3] 
    167           array donesearch bMotion_plugins_management $s 
    168             return $helpcallback 
    169           } 
    170   } 
    171   array donesearch bMotion_plugins_management $s 
    172   return "" 
     159        global bMotion_plugins_management 
     160        set s [array startsearch bMotion_plugins_management] 
     161 
     162        while {[set key [array nextelement bMotion_plugins_management $s]] != ""} { 
     163                if {$key == "dummy"} { continue } 
     164                if [string match -nocase $name $key] { 
     165                        set blah [split $bMotion_plugins_management($key) "Š"] 
     166                        set helpcallback [lindex $blah 3] 
     167                        array donesearch bMotion_plugins_management $s 
     168                        return $helpcallback 
     169                } 
     170        } 
     171        array donesearch bMotion_plugins_management $s 
     172        return "" 
    173173} 
    174174 
    175175## Load a complex plugin 
    176176proc bMotion_plugin_add_complex { id match chance callback language } { 
    177   global bMotion_plugins_complex plugins bMotion_testing bMotion_noplugins 
    178   if {$bMotion_testing == 0} { 
    179     catch { 
    180       set test $bMotion_plugins_complex($id) 
    181       bMotion_putloglev d * "bMotion: ALERT! Complex plugin $id is defined more than once" 
    182       return 0 
    183     } 
     177        global bMotion_plugins_complex plugins bMotion_testing bMotion_noplugins 
     178        if {$bMotion_testing == 0} { 
     179                catch { 
     180                        set test $bMotion_plugins_complex($id) 
     181                        bMotion_putloglev d * "bMotion: ALERT! Complex plugin $id is defined more than once" 
     182                        return 0 
     183                } 
    184184                if [bMotion_plugin_check_allowed "complex:$id"] { 
    185185                        set bMotion_plugins_complex($id) "${match}Š${chance}Š${callback}Š${language}" 
     
    190190                bMotion_putloglev d * "bMotion: ignoring disallowed plugin complex:$id" 
    191191                set bMotion_noplugins 1 
    192   } 
     192        } 
    193193} 
    194194 
    195195## Find a complex plugin plugin 
    196196proc bMotion_plugin_find_complex { text lang } { 
    197   global bMotion_plugins_complex botnicks 
    198   set s [lsort [array names bMotion_plugins_complex]] 
    199   set result [list] 
    200  
    201   bMotion_putloglev 3 * "Looking for a complex plugin to match !$text!" 
     197        global bMotion_plugins_complex botnicks 
     198        set s [lsort [array names bMotion_plugins_complex]] 
     199        set result [list] 
     200 
     201        bMotion_putloglev 3 * "Looking for a complex plugin to match !$text!" 
    202202 
    203203        set bias [bMotion_setting_get "bias"] 
     
    206206        } 
    207207 
    208   foreach key $s { 
    209     if {$key == "dummy"} { continue } 
    210     set val $bMotion_plugins_complex($key) 
    211     set blah [split $val "Š"] 
    212     set rexp [lindex $blah 0] 
    213     set chance [lindex $blah 1] 
    214     set callback [lindex $blah 2] 
    215     set language [lindex $blah 3] 
    216     if {[string match $lang $language] || ($language == "any") || ($language == "all")} { 
    217     set rexp [bMotionInsertString $rexp "%botnicks" "${botnicks}"] 
    218       if [regexp -nocase $rexp $text] { 
    219         set c [rand 100] 
     208        foreach key $s { 
     209                if {$key == "dummy"} { continue } 
     210                set val $bMotion_plugins_complex($key) 
     211                set blah [split $val "Š"] 
     212                set rexp [lindex $blah 0] 
     213                set chance [lindex $blah 1] 
     214                set callback [lindex $blah 2] 
     215                set language [lindex $blah 3] 
     216                if {[string match $lang $language] || ($language == "any") || ($language == "all")} { 
     217                set rexp [bMotionInsertString $rexp "%botnicks" "${botnicks}"] 
     218                        if [regexp -nocase $rexp $text] { 
     219                                set c [rand 100] 
    220220                                set chance [expr $chance * $bias] 
    221         bMotion_putloglev 4 * "matched complex:$key, chance is $chance, c is $c" 
    222         if {$chance > $c} { 
     221                                bMotion_putloglev 4 * "matched complex:$key, chance is $chance, c is $c" 
     222                                if {$chance > $c} { 
    223223                                        bMotion_putloglev 4 * "chance is high enough, adding $callback" 
    224           lappend result $callback 
    225         } 
    226       } 
    227     } 
    228   } 
    229   return $result 
     224                                        lappend result $callback 
     225                                } 
     226                        } 
     227                } 
     228        } 
     229        return $result 
    230230} 
    231231 
     
    233233## Load an output plugin 
    234234proc bMotion_plugin_add_output { id callback enabled language } { 
    235   global bMotion_plugins_output plugins bMotion_testing bMotion_noplugins 
    236  
    237   if {$bMotion_testing == 0} { 
    238     catch { 
    239       set test $bMotion_plugins_output($id) 
    240       bMotion_putloglev d * "bMotion: ALERT! Output plugin $id is defined more than once" 
    241       return 0 
    242     } 
     235        global bMotion_plugins_output plugins bMotion_testing bMotion_noplugins 
     236 
     237        if {$bMotion_testing == 0} { 
     238                catch { 
     239                        set test $bMotion_plugins_output($id) 
     240                        bMotion_putloglev d * "bMotion: ALERT! Output plugin $id is defined more than once" 
     241                        return 0 
     242                } 
    243243                if [bMotion_plugin_check_allowed "output:$id"] { 
    244244                        set bMotion_plugins_output($id) "${callback}Š${enabled}Š$language" 
    245245                        bMotion_putloglev 2 * "bMotion: added output plugin: $id" 
    246246                        append plugins "$id," 
     247                        set bMotion_plugins_output_perchan($id) [list ] 
    247248                        return 1 
    248249                } 
     
    252253} 
    253254 
    254 proc bMotion_plugin_find_output { lang } { 
    255   global bMotion_plugins_output botnicks 
    256   set s [array startsearch bMotion_plugins_output] 
    257   set result [list] 
    258  
    259   while {[set key [array nextelement bMotion_plugins_output $s]] != ""} { 
    260     if {$key == "dummy"} { continue } 
    261     set val $bMotion_plugins_output($key) 
    262     set blah [split $val "Š"] 
    263     set callback [lindex $blah 0] 
    264     set enabled [lindex $blah 1] 
    265     set language [lindex $blah 2] 
    266     if {[string match $lang $language] || ($language == "any")|| ($language == "all")} { 
    267       if {$enabled == 1} { 
    268         lappend result $callback 
    269       } 
    270     } 
    271   } 
    272   array donesearch bMotion_plugins_output $s 
    273   return $result 
     255proc bMotion_plugin_find_output { lang { channel "" } } { 
     256        global bMotion_plugins_output botnicks 
     257        global bMotion_plugins_output_perchan 
     258        set s [array startsearch bMotion_plugins_output] 
     259        set result [list] 
     260 
     261        while {[set key [array nextelement bMotion_plugins_output $s]] != ""} { 
     262                if {$key == "dummy"} { continue } 
     263                set val $bMotion_plugins_output($key) 
     264                set blah [split $val "Š"] 
     265                set callback [lindex $blah 0] 
     266                set enabled [lindex $blah 1] 
     267                set language [lindex $blah 2] 
     268                if {[string match $lang $language] || ($language == "any")|| ($language == "all")} { 
     269                        if {$enabled == 1} { 
     270                                lappend result $callback 
     271                        } else { 
     272                                bMotion_putloglev 1 * "Searching $key for channel $channel" 
     273                                if {$channel != ""} { 
     274                                        catch { 
     275                                                set chanlist $bMotion_plugins_output_perchan($key) 
     276                                                if {[lsearch $chanlist $channel] > -1} { 
     277                                                        lappend result $callback 
     278                                                        bMotion_putloglev d * "Plugin $key is enabled for $channel" 
     279                                                } 
     280                                        } 
     281                                } 
     282                        } 
     283                } 
     284        } 
     285        array donesearch bMotion_plugins_output $s 
     286        return $result 
     287} 
     288 
     289proc bMotion_plugin_set_output { id enabled } { 
     290        global bMotion_plugins_output 
     291 
     292        if {($enabled == 0) || ($enabled == 1)} { 
     293                set details $bMotion_plugins_output($id) 
     294                set blah [split $details "Š"] 
     295                set callback [lindex $blah 0] 
     296                set language [lindex $blah 2] 
     297 
     298                set bMotion_plugins_output($id) "$callbackŠ$enabledŠ$language" 
     299                return 1 
     300        } 
     301        return 0 
     302} 
     303 
     304proc bMotion_plugin_set_output_channel { id channel enabled } { 
     305        global bMotion_plugins_output_perchan 
     306        set channel [string tolower $channel] 
     307 
     308        set current [list] 
     309        catch { 
     310                set current $bMotion_plugins_output_perchan($id) 
     311        } 
     312        if {$enabled == 1} { 
     313                set current [lappend current $channel] 
     314        } else { 
     315                set index [lsearch $current $channel] 
     316                if {$index > -1} { 
     317                        set current [lreplace $current $index $index] 
     318                } 
     319        } 
     320        set current [lsort -unique $current] 
     321 
     322        set bMotion_plugins_output_perchan($id) $current 
     323        return 1 
    274324} 
    275325 
     
    277327## Load a simple action plugin 
    278328proc bMotion_plugin_add_action_simple { id match chance response language } { 
    279   global bMotion_plugins_action_simple plugins bMotion_testing bMotion_noplugins 
    280  
    281   if {$bMotion_testing == 0} { 
    282     catch { 
    283       set test $bMotion_plugins_action_simple($id) 
    284       bMotion_putloglev d * "bMotion: ALERT! Simple plugin $id is defined more than once" 
    285       return 0 
    286     } 
     329        global bMotion_plugins_action_simple plugins bMotion_testing bMotion_noplugins 
     330 
     331        if {$bMotion_testing == 0} { 
     332                catch { 
     333                        set test $bMotion_plugins_action_simple($id) 
     334                        bMotion_putloglev d * "bMotion: ALERT! Simple plugin $id is defined more than once" 
     335                        return 0 
     336                } 
    287337                if [bMotion_plugin_check_allowed "action_simple:$id"] { 
    288338                        set bMotion_plugins_action_simple($id) "${match}Š${chance}Š${response}Š$language" 
     
    299349## Find a simple action plugin 
    300350proc bMotion_plugin_find_action_simple { text lang } { 
    301   global bMotion_plugins_action_simple botnicks 
    302   set s [lsort [array names bMotion_plugins_action_simple]] 
    303  
    304   foreach key $s { 
    305     if {$key == "dummy"} { continue } 
    306     set val $bMotion_plugins_action_simple($key) 
    307     set blah [split $val "Š"] 
    308     set rexp [lindex $blah 0] 
    309     set chance [lindex $blah 1] 
    310     set response [lindex $blah 2] 
    311     set language [lindex $blah 3] 
    312     if {[string match $lang $language] || ($language == "any")|| ($language == "all")} { 
    313       set rexp [bMotionInsertString $rexp "%botnicks" "${botnicks}"] 
    314       if [regexp -nocase $rexp $text] { 
    315         set c [rand 100] 
    316         if {$chance > $c} { 
    317           return $response 
    318         } 
    319       } 
    320     } 
    321   } 
    322   return "" 
     351        global bMotion_plugins_action_simple botnicks 
     352        set s [lsort [array names bMotion_plugins_action_simple]] 
     353 
     354        foreach key $s { 
     355                if {$key == "dummy"} { continue } 
     356                set val $bMotion_plugins_action_simple($key) 
     357                set blah [split $val "Š"] 
     358                set rexp [lindex $blah 0] 
     359                set chance [lindex $blah 1] 
     360                set response [lindex $blah 2] 
     361                set language [lindex $blah 3] 
     362                if {[string match $lang $language] || ($language == "any")|| ($language == "all")} { 
     363                        set rexp [bMotionInsertString $rexp "%botnicks" "${botnicks}"] 
     364                        if [regexp -nocase $rexp $text] { 
     365                                set c [rand 100] 
     366                                if {$chance > $c} { 
     367                                        return $response 
     368                                } 
     369                        } 
     370                } 
     371        } 
     372        return "" 
    323373} 
    324374 
     
    326376## Load a complex action plugin 
    327377proc bMotion_plugin_add_action_complex { id match chance callback language } { 
    328   global bMotion_plugins_action_complex plugins bMotion_testing bMotion_noplugins 
    329   if {$bMotion_testing == 0} { 
    330     catch { 
    331       set test $bMotion_plugins_action_complex($id) 
    332       bMotion_putloglev d * "bMotion: ALERT! Complex action plugin $id is defined more than once" 
    333       return 0 
    334     } 
     378        global bMotion_plugins_action_complex plugins bMotion_testing bMotion_noplugins 
     379        if {$bMotion_testing == 0} { 
     380                catch { 
     381                        set test $bMotion_plugins_action_complex($id) 
     382                        bMotion_putloglev d * "bMotion: ALERT! Complex action plugin $id is defined more than once" 
     383                        return 0 
     384                } 
    335385                if [bMotion_plugin_check_allowed "action_complex:$id"] { 
    336386                        set bMotion_plugins_action_complex($id) "${match}Š${chance}Š${callback}Š${language}" 
     
    346396## Find a complex action plugin plugin 
    347397proc bMotion_plugin_find_action_complex { text lang } { 
    348   global bMotion_plugins_action_complex botnicks 
    349   set s [lsort [array names bMotion_plugins_action_complex]] 
    350   set result [list] 
    351  
    352   foreach key $s { 
    353     if {$key == "dummy"} { continue } 
    354     set val $bMotion_plugins_action_complex($key) 
    355     set blah [split $val "Š"] 
    356     set rexp [lindex $blah 0] 
    357     set chance [lindex $blah 1] 
    358     set callback [lindex $blah 2] 
    359     set language [lindex $blah 3] 
    360     if {[string match $language $lang] || ($language == "any")|| ($language == "all")} { 
    361       set rexp [bMotionInsertString $rexp "%botnicks" "${botnicks}"] 
    362       if [regexp -nocase $rexp $text] { 
    363         bMotion_putloglev 4 * "matched: $key" 
    364         set c [rand 100] 
    365         if {$chance > $c} { 
    366           lappend result $callback 
    367         } 
    368       } 
    369     } 
    370   } 
    371   return $result 
     398        global bMotion_plugins_action_complex botnicks 
     399        set s [lsort [array names bMotion_plugins_action_complex]] 
     400        set result [list] 
     401 
     402        foreach key $s { 
     403                if {$key == "dummy"} { continue } 
     404                set val $bMotion_plugins_action_complex($key) 
     405                set blah [split $val "Š"] 
     406                set rexp [lindex $blah 0] 
     407                set chance [lindex $blah 1] 
     408                set callback [lindex $blah 2] 
     409                set language [lindex $blah 3] 
     410                if {[string match $language $lang] || ($language == "any")|| ($language == "all")} { 
     411                        set rexp [bMotionInsertString $rexp "%botnicks" "${botnicks}"] 
     412                        if [regexp -nocase $rexp $text] { 
     413                                bMotion_putloglev 4 * "matched: $key" 
     414                                set c [rand 100] 
     415                                if {$chance > $c} { 
     416                                        lappend result $callback 
     417                                } 
     418                        } 
     419                } 
     420        } 
     421        return $result 
    372422} 
    373423 
     
    376426 
    377427proc bMotion_plugin_check_depend { depends } { 
    378   #pass a string in the format "type:plugin,type:plugin,..." 
    379   if {$depends == ""} { 
    380     return 1 
    381   } 
    382  
    383   set result 1 
    384  
    385   set blah [split $depends ","] 
    386   foreach depend $blah { 
    387     set blah2 [split $depend ":"] 
    388     set t [lindex $blah2 0] 
    389     set id [lindex $blah2 1] 
    390     set a "bMotion_plugins_$t" 
    391     upvar #0 $a ar 
    392     bMotion_putloglev 1 * "bMotion: checking $a for $id ..." 
    393     set temp [array names ar $id] 
    394     if {[llength $temp] == 0} { 
    395       set result 0 
    396       bMotion_putloglev d * "bMotion: Missing dependency $t:$id" 
    397     } 
    398   } 
    399   return $result 
     428        #pass a string in the format "type:plugin,type:plugin,..." 
     429        if {$depends == ""} { 
     430                return 1 
     431        } 
     432 
     433        set result 1 
     434 
     435        set blah [split $depends ","] 
     436        foreach depend $blah { 
     437                set blah2 [split $depend ":"] 
     438                set t [lindex $blah2 0] 
     439                set id [lindex $blah2 1] 
     440                set a "bMotion_plugins_$t" 
     441                upvar #0 $a ar 
     442                bMotion_putloglev 1 * "bMotion: checking $a for $id ..." 
     443                set temp [array names ar $id] 
     444                if {[llength $temp] == 0} { 
     445                        set result 0 
     446                        bMotion_putloglev d * "bMotion: Missing dependency $t:$id" 
     447                } 
     448        } 
     449        return $result 
    400450} 
    401451 
     
    405455 
    406456proc bMotion_plugin_check_allowed { name } { 
    407   #pass a string in the format "type:plugin" 
    408   #setting in config should be "type:plugin,type:plugin,..." 
    409   global bMotionSettings 
    410  
    411   set disallowed "" 
    412  
    413   catch { 
    414     set disallowed $bMotionSettings(noPlugin) 
    415   } 
    416  
    417   if {$disallowed == ""} { 
    418     return 1 
    419   } 
    420  
    421   bMotion_putloglev 4 * "bMotion: checking $name against $disallowed" 
    422  
    423   set blah [split $disallowed ","] 
    424   foreach plugin $blah { 
    425     if {$plugin == $name} { 
    426       return 0 
    427     } 
    428   } 
    429   return 1 
     457        #pass a string in the format "type:plugin" 
     458        #setting in config should be "type:plugin,type:plugin,..." 
     459        global bMotionSettings 
     460 
     461        set disallowed "" 
     462 
     463        catch { 
     464                set disallowed $bMotionSettings(noPlugin) 
     465        } 
     466 
     467        if {$disallowed == ""} { 
     468                return 1 
     469        } 
     470 
     471        bMotion_putloglev 4 * "bMotion: checking $name against $disallowed" 
     472 
     473        set blah [split $disallowed ","] 
     474        foreach plugin $blah {