diff options
author | Giuseppe Bilotta <giuseppe.bilotta@gmail.com> | 2010-01-25 23:17:01 +0100 |
---|---|---|
committer | Giuseppe Bilotta <giuseppe.bilotta@gmail.com> | 2010-01-25 23:17:01 +0100 |
commit | db8c68e8cf35b3bb3fcae63595726592687407c4 (patch) | |
tree | a92de4b0d837e74e8cb30d0289dfe2df71c92f73 | |
parent | 8302e6c468c5688dfd382b9264a8e8780f4edba6 (diff) |
markov: fix delay
markov.delay had the wrong default, and its use didn't have any
degree of randomness in it. Set the default to 5 and use rand()
again.
-rwxr-xr-x | data/rbot/plugins/markov.rb | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/data/rbot/plugins/markov.rb b/data/rbot/plugins/markov.rb index ce5a35a2..864db4b8 100755 --- a/data/rbot/plugins/markov.rb +++ b/data/rbot/plugins/markov.rb @@ -32,7 +32,7 @@ class MarkovPlugin < Plugin :validate => Proc.new { |v| v >= 0 }, :desc => "Time the learning thread spends sleeping after learning a line. If set to zero, learning from files can be very CPU intensive, but also faster.") Config.register Config::IntegerValue.new('markov.delay', - :default => true, + :default => 5, :validate => Proc.new { |v| v >= 0 }, :desc => "Wait short time before contributing to conversation.") Config.register Config::IntegerValue.new('markov.answer_addressed', @@ -522,7 +522,7 @@ class MarkovPlugin < Plugin def reply_delay(m, line) m.replied = true if @bot.config['markov.delay'] > 0 - @bot.timer.add_once(@bot.config['markov.delay']) { + @bot.timer.add_once(1 + rand(@bot.config['markov.delay'])) { m.reply line, :nick => false, :to => :public } else |