From 12effa29ded2f4e251c3bc3acee46e72c7ef87e8 Mon Sep 17 00:00:00 2001 From: Giuseppe Bilotta Date: Sun, 15 Oct 2006 13:40:54 +0000 Subject: [PATCH] autorejoin after a random time between 0 and 10, instead of fixed 10 --- data/rbot/plugins/autorejoin.rb | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/data/rbot/plugins/autorejoin.rb b/data/rbot/plugins/autorejoin.rb index aba46507..f057a659 100644 --- a/data/rbot/plugins/autorejoin.rb +++ b/data/rbot/plugins/autorejoin.rb @@ -4,10 +4,16 @@ class AutoRejoinPlugin < Plugin end def kick(m) if m.address? - @bot.timer.add_once(10, m) {|m| - @bot.join m.channel - @bot.say m.channel, @bot.lang.get("insult") % m.sourcenick - } + r = rand(10) + if r > 0 + @bot.timer.add_once(r, m) {|m| + @bot.join m.channel + @bot.say m.channel, @bot.lang.get("insult") % m.sourcenick + } + else + @bot.join m.channel + @bot.say m.channel, @bot.lang.get("insult") % m.sourcenick + end end end end -- 2.39.5