+
+ # Figure out who the winnar is!
+ def hof(m, params)
+ fool = m.sourcenick
+ tmpKey = params[:key].to_s
+ targetKey = tmpKey.to_sym
+ m.reply("Checking out the #{tmpKey} HoF...")
+ tmp = @registry.to_hash
+ tmp.delete("totals")
+ sorted = tmp.sort { |a,b| b[1][targetKey] <=> a[1][targetKey] }
+
+ winnersLeft = 5
+
+ winners = []
+ sorted.each do |player|
+ playerName = player[0].split(" ")[1]
+ if player[0] == "totals" or playerName == ""
+ next
+ end
+ winners << "#{playerName} has #{player[1][targetKey]}"
+ winnersLeft -= 1
+ if winnersLeft == 0
+ break
+ end
+ end
+ m.reply(winners.join(" | "))
+ end