]> git.netwichtig.de Git - user/henk/code/ruby/rbot.git/blobdiff - data/rbot/plugins/games/uno.rb
markov plugin: don't echo a line a line that is just a substring of the input line
[user/henk/code/ruby/rbot.git] / data / rbot / plugins / games / uno.rb
index ba3b1a90af5ecf782de3b700f6cb17821bd2830e..47fac28d52205109bf4a70abab358e53c99776e1 100644 (file)
@@ -650,9 +650,9 @@ class UnoGame
     end
     cards = 7
     if @start_time
-      cards = @players.inject(0) do |s, pl|
+      cards = (@players.inject(0) do |s, pl|
         s +=pl.cards.length
-      end/@players.length
+      end*1.0/@players.length).ceil
     end
     p = Player.new(user)
     @players << p
@@ -854,6 +854,7 @@ class UnoPlugin < Plugin
 
   def message(m)
     return unless @games.key?(m.channel)
+    return unless m.plugin # skip messages such as: <someuser> botname,
     g = @games[m.channel]
     case m.plugin.intern
     when :jo # join game