Changeset 898

Show
Ignore:
Timestamp:
03/27/08 06:48:16 (10 months ago)
Author:
james
Message:

add global bias option (just for complex plugins for now)

Location:
trunk/modules
Files:
2 modified

Legend:

Unmodified
Added
Removed
  • trunk/modules/plugins.tcl

    r884 r898  
    201201  bMotion_putloglev 3 * "Looking for a complex plugin to match !$text!" 
    202202 
     203        set bias [bMotion_setting_get "bias"] 
     204        if {$bias == ""} { 
     205                set bias 1 
     206        } 
     207 
    203208  foreach key $s { 
    204209    if {$key == "dummy"} { continue } 
     
    213218      if [regexp -nocase $rexp $text] { 
    214219        set c [rand 100] 
     220                                set chance [expr $chance * $bias] 
    215221        bMotion_putloglev 4 * "matched complex:$key, chance is $chance, c is $c" 
    216222        if {$chance > $c} { 
  • trunk/modules/settings.sample.tcl

    r869 r898  
    151151# so that it can talk to them (when they're in the same channel) 
    152152set bMotion_interbot_enable 1 
     153 
     154# bias the output probability 
     155# 0 = never trigger 
     156# 1 = normal 
     157# 2 = about twice as likely 
     158# floating-point is fine 
     159set bMotionSettings(bias) 1 
    153160 
    154161