summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDico200 <dico.karssiens@gmail.com>2016-05-25 18:41:42 +0200
committerDico200 <dico.karssiens@gmail.com>2016-05-25 18:41:42 +0200
commit8629b39ce10242da9d4686f6bb2dcd7c24b53832 (patch)
treed483406fd58f6c1f504bca834ba9be2569984c2f
parent00e38efd14eaa3261b1dd66f71157a7f048bd92c (diff)
Make /busy a toggle, move help page to /busy help. Changed a few messages
-rw-r--r--imbusy.py38
1 files changed, 24 insertions, 14 deletions
diff --git a/imbusy.py b/imbusy.py
index 225862b..1fc9e63 100644
--- a/imbusy.py
+++ b/imbusy.py
@@ -40,34 +40,44 @@ def on_busy_command(sender, cmd, label, args):
noperm(sender)
return True
+ sender_name = sender.getName()
+
if len(args) == 0:
- msg(sender, "This plugin allows being busy, and when turned on you will not receive any direct messages or tpa requests.")
- msg(sender, "\nCommands:")
- msg(sender, "/busy on: turns on busy mode")
- msg(sender, "/busy off: turns off busy mode")
- msg(sender, "/busy status [player]: shows your or [player]'s current busy status.")
+ if sender_name in busy_players:
+ busy_players.remove(sender_name)
+ msg(sender, "Your busy status was removed, you can be bothered again")
+ else:
+ busy_players.append(sender_name)
+ broadcast(None, "&c[&2Busy&c] %s&r is now busy, don't even TRY bothering them!" % sender.getDisplayName())
elif len(args) == 1:
- if args[0] == "on":
- if sender.getName() in busy_players:
+ if args[0].lower() == "on":
+ if sender_name in busy_players:
msg(sender, "You cannot be even more focused than this without being a jedi!")
else:
- busy_players.append(sender.getName())
+ busy_players.append(sender_name)
broadcast(None, "&c[&2Busy&c] %s&r is now busy, don't even TRY bothering them!" % sender.getDisplayName())
- elif args[0] == "off":
+ elif args[0].lower() == "off":
try:
- busy_players.remove(sender.getName())
- msg(sender, "Master has sent /busy command, %s&r is freeee of bothering!" % sender.getDisplayName())
+ busy_players.remove(sender_name)
+ msg(sender, "Your busy status was removed, you can be bothered again")
except ValueError:
msg(sender, "You are not busy! You cannot be even less busy! Are you perhaps bored?")
- elif args[0] == "status":
- if sender.getName() in busy_players:
+ elif args[0].lower() == "status":
+ if sender_name in busy_players:
msg(sender, "You are super-duper busy and concentrated right now. Think, think, think!")
else:
msg(sender, "You are completely unable to focus right now.")
+ elif args[0].lower() in ("?", "help"):
+ msg(sender, "Let's you put yourself in busy status, preventing pms and tpa requests from other players")
+ msg(sender, "\nCommands:")
+ msg(sender, "/busy: toggles busy status")
+ msg(sender, "/busy on: turns on busy status")
+ msg(sender, "/busy off: turns off busy status")
+ msg(sender, "/busy status [player]: shows your or [player]'s current busy status.")
else:
unclear(sender)
return False
@@ -75,7 +85,7 @@ def on_busy_command(sender, cmd, label, args):
elif len(args) == 2 and args[0] == "status":
target = server.getPlayer(args[1])
if target is None:
- msg(sender, "That player is not online, I doubt they are busy.")
+ msg(sender, "That player is not online, they may be busy IRL, we never know")
elif target.getName() in busy_players:
msg(sender, "Yes, %s&r is busy. Shhh..." % target.getDisplayName())
else: