Ticket #13: last-simple.diff
| File last-simple.diff, 1.5 KB (added by bmotion, 2 years ago) |
|---|
-
modules/variables.tcl
67 67 set bMotionCache(randomUser) "" 68 68 set bMotionCache(lastPlugin) "" 69 69 70 set bMotionCache(last_simple)""70 bMotion_plugins_settings_set "system" "last_simple" "" "" "" 71 71 72 72 #this is set later 73 73 set botnicks "" -
modules/plugins.tcl
80 80 ## Find a simple plugin 81 81 proc bMotion_plugin_find_simple { text lang } { 82 82 bMotion_putloglev 3 * "bMotion_plugin_find_simple: text = $text, lang = $lang" 83 global bMotion_plugins_simple botnicks bMotionCache83 global bMotion_plugins_simple botnicks 84 84 set s [lsort [array names bMotion_plugins_simple]] 85 85 86 86 foreach key $s { … … 96 96 if [regexp -nocase $rexp $text] { 97 97 set c [rand 100] 98 98 bMotion_putloglev 4 * "simple plugin $key matches" 99 if { $bMotionCache(last_simple)== $key} {99 if {[bMotion_plugins_settings_get "system" "last_simple" "" ""] == $key} { 100 100 bMotion_putloglev 3 * "trying to trigger same simple plugin twice in a row, aborting" 101 101 return "" 102 102 } 103 set bMotionCache(last_simple)$key103 bMotion_plugins_settings_set "system" "last_simple" "" "" $key 104 104 if {$chance > $c} { 105 105 bMotion_putloglev 4 * " `- firing" 106 106 return $response
