diff options
author | Giuseppe Bilotta <giuseppe.bilotta@gmail.com> | 2006-10-15 13:40:54 +0000 |
---|---|---|
committer | Giuseppe Bilotta <giuseppe.bilotta@gmail.com> | 2006-10-15 13:40:54 +0000 |
commit | 12effa29ded2f4e251c3bc3acee46e72c7ef87e8 (patch) | |
tree | bcabc7236f3644affaf3f5b707e2c5997d61bf36 | |
parent | d183fb000ad7756a2ed543cc9535477b5b281c30 (diff) |
autorejoin after a random time between 0 and 10, instead of fixed 10
-rw-r--r-- | data/rbot/plugins/autorejoin.rb | 14 |
1 files 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 |