Even more fixes for stasis.
This commit is contained in:
parent
b2ff0a486b
commit
05f048c6c9
@ -2518,15 +2518,18 @@ def on_error(cli, pfx, msg):
|
|||||||
@pmcmd("fstasis", admin_only=True)
|
@pmcmd("fstasis", admin_only=True)
|
||||||
def fstasis(cli, nick, *rest):
|
def fstasis(cli, nick, *rest):
|
||||||
data = rest[0].split()
|
data = rest[0].split()
|
||||||
if len(data) == 2:
|
if data and len(data) < 3:
|
||||||
lusers = {k.lower(): v for k, v in var.USERS.items()}
|
lusers = {k.lower(): v for k, v in var.USERS.items()}
|
||||||
user = data[0].lower()
|
user = data[0].lower()
|
||||||
if user in lusers:
|
if user in lusers:
|
||||||
cloak = lusers[user]['cloak']
|
cloak = lusers[user]['cloak']
|
||||||
else:
|
else:
|
||||||
cloak = None
|
cloak = None
|
||||||
amt = int(data[1])
|
if cloak is None:
|
||||||
if cloak is not None:
|
cli.msg(nick, "Sorry, that user cannot be found.")
|
||||||
|
return
|
||||||
|
if len(data) == 2:
|
||||||
|
amt = int(data[1])
|
||||||
if amt < 0 and cloak in var.STASISED:
|
if amt < 0 and cloak in var.STASISED:
|
||||||
var.STASISED[cloak] -= amt
|
var.STASISED[cloak] -= amt
|
||||||
cli.msg(nick, "{0} ({1}) is now in stasis for {2} games.".format(data[0], cloak, var.STASISED[cloak]))
|
cli.msg(nick, "{0} ({1}) is now in stasis for {2} games.".format(data[0], cloak, var.STASISED[cloak]))
|
||||||
@ -2539,8 +2542,12 @@ def fstasis(cli, nick, *rest):
|
|||||||
else:
|
else:
|
||||||
var.STASISED[cloak] = amt
|
var.STASISED[cloak] = amt
|
||||||
cli.msg(nick, "{0} ({1}) is now in stasis for {2} games.".format(data[0], cloak, amt))
|
cli.msg(nick, "{0} ({1}) is now in stasis for {2} games.".format(data[0], cloak, amt))
|
||||||
else:
|
else:
|
||||||
cli.msg(nick, "Sorry, that user cannot be found.")
|
elif len(data) == 1:
|
||||||
|
if cloak in var.STASISED:
|
||||||
|
cli.msg(nick, "{0} ({1}) is in stasis for {2} games.".format(data[0], cloak, var.STASISED[cloak]))
|
||||||
|
else:
|
||||||
|
cli.msg(nick, "{0} ({1}) is not in stasis.".format(data[0], cloak))
|
||||||
elif not data:
|
elif not data:
|
||||||
if var.STASISED:
|
if var.STASISED:
|
||||||
cli.msg(nick, "Currently stasised: {0}".format(
|
cli.msg(nick, "Currently stasised: {0}".format(
|
||||||
|
Loading…
x
Reference in New Issue
Block a user