]> git.netwichtig.de Git - user/henk/code/ruby/rbot.git/blobdiff - data/rbot/plugins/karma.rb
imdb plugin: bring help up to speed with what the plugin offers
[user/henk/code/ruby/rbot.git] / data / rbot / plugins / karma.rb
index 824ffa956445e3f98ef375a7286c63d0df57232b..43b3f2dc160f3a761fc48b83e2ba7215b55afaa8 100644 (file)
@@ -15,7 +15,7 @@ class KarmaPlugin < Plugin
 
     # import if old file format found
     if(File.exist?("#{@bot.botclass}/karma.rbot"))
-      puts "importing old karma data"
+      log "importing old karma data"
       IO.foreach("#{@bot.botclass}/karma.rbot") do |line|
         if(line =~ /^(\S+)<=>([\d-]+)$/)
           item = $1
@@ -69,9 +69,12 @@ class KarmaPlugin < Plugin
         key.sub!(/^\((.*)\)$/, "\1")
         key.gsub!(/\s+/, " ")
         next unless(key.length > 0)
-        next if(key == m.sourcenick)
+        next if(key.downcase == m.sourcenick.downcase)
         if(change == "++")
           @registry[key] += 1
+          if key =~ /^#{@bot.nick}$/i
+            @bot.say m.replyto, @bot.lang.get("thanks")
+          end
         elsif(change == "--")
           @registry[key] -= 1
         end
@@ -79,6 +82,7 @@ class KarmaPlugin < Plugin
     end
   end
 end
+
 plugin = KarmaPlugin.new
 plugin.map 'karmastats', :action => 'stats'
 plugin.map 'karma :key', :defaults => {:key => false}