sorting of !stats roles

This commit is contained in:
Jimmy Cao 2011-08-06 00:17:12 -05:00
parent 512d5e7843
commit 400aa4028a
2 changed files with 17 additions and 4 deletions

View File

@ -1,8 +1,8 @@
PASS = "" PASS = "my_nickserv_pass"
CHANNEL = "" CHANNEL = "#mywolfgame"
HOST = "irc.freenode.net" HOST = "irc.freenode.net"
PORT = 6667 PORT = 6667 # SSL not supported yet
NICK = "wolfbot" NICK = "mywolfbot"
OWNERS = ("unaffiliated/wolfbot_admin1",) # the comma is required at the end if there is one owner OWNERS = ("unaffiliated/wolfbot_admin1",) # the comma is required at the end if there is one owner
ADMINS = ("unaffiliated/wolfbot_admin2", "unaffiliated/wolfbot_admin3") ADMINS = ("unaffiliated/wolfbot_admin2", "unaffiliated/wolfbot_admin3")
CMD_CHAR = "!" CMD_CHAR = "!"

View File

@ -415,6 +415,19 @@ def stats(cli, nick, chan, rest):
rs = list(set(l1+l2)) rs = list(set(l1+l2))
if "village drunk" in rs: if "village drunk" in rs:
rs.remove("village drunk") # drunk is not displayed rs.remove("village drunk") # drunk is not displayed
# Due to popular demand, picky ordering
if "wolf" in rs:
rs.remove("wolf")
rs.insert(0, "wolf")
if "seer" in rs:
rs.remove("seer")
rs.insert(1, "seer")
if "villager" in rs:
rs.remove("villager")
rs.append("villager")
firstcount = len(var.ROLES[rs[0]]) firstcount = len(var.ROLES[rs[0]])
if firstcount > 1 or not firstcount: if firstcount > 1 or not firstcount:
vb = "are" vb = "are"