From f40e749c0797c62cc92a5b4d3bc9679cf657b94d Mon Sep 17 00:00:00 2001 From: "Vgr E.Barry" Date: Fri, 31 Jul 2015 13:28:34 -0400 Subject: [PATCH] Allow !fjoin to join ranges of fake nicks --- src/wolfgame.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/wolfgame.py b/src/wolfgame.py index 94a4dda..536b9af 100644 --- a/src/wolfgame.py +++ b/src/wolfgame.py @@ -1110,6 +1110,16 @@ def fjoin(cli, nick, chan, rest): for tojoin in re.split(" +",rest): tojoin = tojoin.strip() + if "-" in tojoin: + first, hyphen, last = tojoin.partition("-") + if first.isdigit() and last.isdigit(): + if int(last)+1 - int(first) > var.MAX_PLAYERS - len(var.list_players()): + cli.msg(chan, "{0}: Too many players to join.".format(nick)) + break + fake = True + for i in range(int(first), int(last)+1): + join_player(cli, str(i), chan, forced=True, who=nick) + continue if not tojoin: continue ul = list(var.USERS.keys())