Changeset 884
- Timestamp:
- 02/13/08 17:42:39 (11 months ago)
- Location:
- trunk
- Files:
-
- 5 modified
-
bMotion.tcl (modified) (2 diffs)
-
modules/plugins.tcl (modified) (2 diffs)
-
modules/variables.tcl (modified) (1 diff)
-
plugins/en/complex_shocked.tcl (modified) (1 diff)
-
plugins/en/complex_smiley.tcl (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/bMotion.tcl
r846 r884 66 66 } 67 67 68 # needed for variables 69 if {$bMotion_testing == 1} { 70 putlog "... loading plugin settings" 71 } 72 source "$bMotionModules/plugins_settings.tcl" 73 68 74 # init default variables 69 75 if {$bMotion_testing == 1} { … … 175 181 source "$bMotionModules/mood.tcl" 176 182 177 if {$bMotion_testing == 1} {178 putlog "... loading plugin settings"179 }180 source "$bMotionModules/plugins_settings.tcl"181 183 182 184 ### That's everything but the plugins stuff loaded. Now load extra modules -
trunk/modules/plugins.tcl
r797 r884 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 … … 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" -
trunk/modules/variables.tcl
r810 r884 66 66 set bMotionCache(remoteBot) "" 67 67 set bMotionCache(randomUser) "" 68 set bMotionCache(lastPlugin) ""69 68 70 set bMotionCache(last_simple) "" 69 bMotion_plugins_settings_set "system" "lastPlugin" "" "" "" 70 bMotion_plugins_settings_set "system" "last_simple" "" "" "" 71 71 72 72 #this is set later -
trunk/plugins/en/complex_shocked.tcl
r662 r884 13 13 14 14 proc bMotion_plugin_complex_shock { nick host handle channel text } { 15 #if we spoke last, it's probable this is a reaction to us being 16 # surprised at yourself is lame 17 if {$channel == [bMotion_plugins_settings_get "complex:shock" "last" $channel ""]} { 18 return 0 19 } 15 20 16 global bMotionCache 17 #if we spoke last, it's probable this is a reaction to us 18 #being surprised at yourself is lame 19 if {$bMotionCache($channel,last)} { 20 return 0 21 } 22 23 bMotionDoAction $channel $nick "%VAR{shocked}" 24 return 1 21 # set channel to stop use being suprised at ourselves! 22 bMotion_plugins_settings_set "complex:shock" "last" $channel "" "" 23 24 bMotionDoAction $channel $nick "%VAR{shocked}" 25 return 1 25 26 } 26 27 27 28 bMotion_plugin_add_complex "shocked" "^((((=|:|;)-?(o|0))|(!+))|blimey|crumbs|i say)$" 40 bMotion_plugin_complex_shock "en" 28 -
trunk/plugins/en/complex_smiley.tcl
r662 r884 22 22 proc bMotion_plugin_complex_smiley { nick host handle channel text } { 23 23 global mood 24 global bMotionCache25 24 26 25 if {![bMotion_interbot_me_next $channel]} { return 0 } 27 26 28 if {$bMotionCache(lastPlugin) == "bMotion_plugin_complex_smiley"} { 29 return 0 27 foreach i {"smiley" "smiley2" "smiley3" "smiley4" "smiley5"} { 28 bMotion_putloglev 2 * "checking $i" 29 30 if {[bMotion_plugin_history_check $channel "complex" $i]} { 31 return 0 32 } 30 33 } 31 34
