# 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
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
end
end
end
+
plugin = KarmaPlugin.new
plugin.map 'karmastats', :action => 'stats'
plugin.map 'karma :key', :defaults => {:key => false}