Clean up misc.py, add space support for cg key
This commit is contained in:
@@ -100,13 +100,12 @@ def on_chat(event):
|
|||||||
@simplecommand("chatgroupkey",
|
@simplecommand("chatgroupkey",
|
||||||
aliases = ["cgkey"],
|
aliases = ["cgkey"],
|
||||||
senderLimit = 0,
|
senderLimit = 0,
|
||||||
amax = 1,
|
|
||||||
helpNoargs = True,
|
helpNoargs = True,
|
||||||
helpSubcmd = True,
|
helpSubcmd = True,
|
||||||
description = "Sets a key character for chatting to your chatgroup",
|
description = "Sets a key character for chatting to your chatgroup",
|
||||||
usage = "<key>")
|
usage = "<key>")
|
||||||
def chatgroupkey_command(sender, command, label, args):
|
def chatgroupkey_command(sender, command, label, args):
|
||||||
key = args[0]
|
key = " ".join(args)
|
||||||
uuid = uid(sender)
|
uuid = uid(sender)
|
||||||
if key.lower() == "default" or key == cg_defaultkey:
|
if key.lower() == "default" or key == cg_defaultkey:
|
||||||
del cg_keys[uuid]
|
del cg_keys[uuid]
|
||||||
|
|||||||
31
misc.py
31
misc.py
@@ -9,24 +9,6 @@ import org.bukkit.event.player.PlayerChatEvent as PlayerChatEvent
|
|||||||
import basecommands
|
import basecommands
|
||||||
from basecommands import simplecommand
|
from basecommands import simplecommand
|
||||||
|
|
||||||
"""
|
|
||||||
@advancedcommand("hi", aliases = ["hu"], description = "Says hi!", subCommands = [
|
|
||||||
subcommand("server", aliases = ["serv"], amin = 1, amax = 4, usage = "[msg..]", senderLimit = 0),
|
|
||||||
subcommand("me", aliases = ["meu"], amin = 2, amax = 5, usage = "[MESSAGE]")
|
|
||||||
])
|
|
||||||
def on_hi_command():
|
|
||||||
|
|
||||||
def server(sender, command, label, args):
|
|
||||||
server.dispatchCommand(server.getConsoleSender(), "say " + " ".join(args[1:]))
|
|
||||||
return "Success!"
|
|
||||||
def me(sender, command, label, args):
|
|
||||||
target = server.getPlayer(args[1])
|
|
||||||
if target:
|
|
||||||
target.chat(" ".join(args[2:]))
|
|
||||||
return None
|
|
||||||
return "No target found"
|
|
||||||
"""
|
|
||||||
|
|
||||||
|
|
||||||
@hook.event("player.PlayerJoinEvent", "monitor")
|
@hook.event("player.PlayerJoinEvent", "monitor")
|
||||||
def on_join(event):
|
def on_join(event):
|
||||||
@@ -87,19 +69,6 @@ def on_me_command(sender, command, label, args):
|
|||||||
broadcast("utils.me", "&7- %s &7%s %s" % (sender.getDisplayName() if isinstance(sender, Player) else "&9CONSOLE", u"\u21E6", " ".join(args)))
|
broadcast("utils.me", "&7- %s &7%s %s" % (sender.getDisplayName() if isinstance(sender, Player) else "&9CONSOLE", u"\u21E6", " ".join(args)))
|
||||||
return None
|
return None
|
||||||
|
|
||||||
"""
|
|
||||||
@basecommands.command("damnyou", aliases = ["dam"])
|
|
||||||
def damnyou_command():
|
|
||||||
|
|
||||||
@basecommands.subcommand("me")
|
|
||||||
def me(sender, command, label, args):
|
|
||||||
info("me ran")
|
|
||||||
|
|
||||||
@basecommands.maincommand
|
|
||||||
def main(sender, command, label, args):
|
|
||||||
info("main ran")
|
|
||||||
"""
|
|
||||||
|
|
||||||
#@hook.command("gm")
|
#@hook.command("gm")
|
||||||
#def on_gm_command(sender, args):
|
#def on_gm_command(sender, args):
|
||||||
# """
|
# """
|
||||||
|
|||||||
Reference in New Issue
Block a user