From 9c19a901d41ce890b49f20f2bc5b8cb0f460db32 Mon Sep 17 00:00:00 2001 From: jcao219 Date: Sat, 6 Aug 2011 00:17:12 -0500 Subject: [PATCH] sorting of !stats roles --- botconfig.py => botconfig.py.example | 8 ++++---- wolfgame.py | 13 +++++++++++++ 2 files changed, 17 insertions(+), 4 deletions(-) rename botconfig.py => botconfig.py.example (75%) diff --git a/botconfig.py b/botconfig.py.example similarity index 75% rename from botconfig.py rename to botconfig.py.example index ac8e670..75378c3 100644 --- a/botconfig.py +++ b/botconfig.py.example @@ -1,8 +1,8 @@ -PASS = "" -CHANNEL = "" +PASS = "my_nickserv_pass" +CHANNEL = "#mywolfgame" HOST = "irc.freenode.net" -PORT = 6667 -NICK = "wolfbot" +PORT = 6667 # SSL not supported yet +NICK = "mywolfbot" OWNERS = ("unaffiliated/wolfbot_admin1",) # the comma is required at the end if there is one owner ADMINS = ("unaffiliated/wolfbot_admin2", "unaffiliated/wolfbot_admin3") CMD_CHAR = "!" diff --git a/wolfgame.py b/wolfgame.py index 544d3ef..4353b75 100644 --- a/wolfgame.py +++ b/wolfgame.py @@ -415,6 +415,19 @@ def stats(cli, nick, chan, rest): rs = list(set(l1+l2)) if "village drunk" in rs: 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]]) if firstcount > 1 or not firstcount: vb = "are"