Moved Console into Control and added death message to Bridge
This commit is contained in:
parent
055674fd87
commit
508e1d0736
3 changed files with 55 additions and 66 deletions
|
|
@ -1,66 +0,0 @@
|
|||
import libminecraft
|
||||
import libsignal
|
||||
import libcommon
|
||||
|
||||
RetardsServer = libcommon.Group(
|
||||
"Retards Server", "5PlbXaPmWZQkhmuyyC/fkWTy8K+BqomjK7byVDyxmpo=")
|
||||
|
||||
|
||||
@libsignal.onMessage(RetardsServer)
|
||||
def signalControl(usr: str, msg: str):
|
||||
if msg.startswith("!"):
|
||||
match msg.split():
|
||||
case ["!command", *cmd] | ["!cmd", *cmd] | ["!run", *cmd] | ["!exec", *cmd]:
|
||||
libminecraft.sendCommand(' '.join(cmd))
|
||||
case ["!help"]:
|
||||
log = """Serve - Minecraft/Signal bot.
|
||||
|
||||
Commands:
|
||||
!help [<command>] - Get command help.
|
||||
|
||||
Admin commands:
|
||||
!modules <command> - Manage Serve modules.
|
||||
!command|cmd|run|exec <command> - Run Minecraft commands."""
|
||||
libsignal.sendMessage(log, RetardsServer)
|
||||
case ["!help", "modules"]:
|
||||
log = """!modules - Manage Serve modules.
|
||||
|
||||
Admin usage:
|
||||
!modules list - List available, loaded and unloaded modules.
|
||||
!modules load <module> [<module> [...]] - Load module(s).
|
||||
!modules unload <module> [<module> [...]] - Unload module(s).
|
||||
!modules reload <module> [<module> [...]] - Reload module(s).
|
||||
!modules update - Download modules from remote and list available updates.
|
||||
!modules install - Install modules from remote into local directory."""
|
||||
libsignal.sendMessage(log, RetardsServer)
|
||||
case ["!help", "command"]:
|
||||
log = """!command - Run Minecraft commands.
|
||||
|
||||
Admin usage:
|
||||
!command <command> - Run a Minecraft command in the Server."""
|
||||
libsignal.sendMessage(log, RetardsServer)
|
||||
case ["!help", "cmd"]:
|
||||
log = """!cmd - Run Minecraft commands.
|
||||
|
||||
Admin usage:
|
||||
!cmd <command> - Run a Minecraft command in the Server."""
|
||||
libsignal.sendMessage(log, RetardsServer)
|
||||
case ["!help", "run"]:
|
||||
log = """!run - Run Minecraft commands.
|
||||
|
||||
Admin usage:
|
||||
!run <command> - Run a Minecraft command in the Server."""
|
||||
libsignal.sendMessage(log, RetardsServer)
|
||||
case ["!help", "exec"]:
|
||||
log = """!exec - Run Minecraft commands.
|
||||
|
||||
Admin usage:
|
||||
!exec <command> - Run a Minecraft command in the Server."""
|
||||
libsignal.sendMessage(log, RetardsServer)
|
||||
case ["!help", "help"]:
|
||||
log = """!help - Get command help.
|
||||
|
||||
Usage:
|
||||
!help - List available commands.
|
||||
!help <command> - Get help about a command."""
|
||||
libsignal.sendMessage(log, RetardsServer)
|
||||
|
|
@ -13,6 +13,11 @@ RetardsServer = libcommon.Group(
|
|||
def signalControl(usr: str, msg: str):
|
||||
if usr == "Malasaur" and msg.startswith("!"):
|
||||
match msg.split():
|
||||
|
||||
################
|
||||
### !modules ###
|
||||
################
|
||||
|
||||
case ["!modules", "list"]:
|
||||
available_modules, loaded_modules, unloaded_modules = libcommon.listModules()
|
||||
libsignal.sendMessage(
|
||||
|
|
@ -69,3 +74,49 @@ Unloaded modules: {" ".join(unloaded_modules)}""", RetardsServer
|
|||
case ["!modules", "install"]:
|
||||
system("cp Serve/modules/* modules")
|
||||
libsignal.sendMessage("Modules installed.", RetardsServer)
|
||||
|
||||
############
|
||||
### !cmd ###
|
||||
############
|
||||
|
||||
case ["!cmd", *cmd]:
|
||||
libminecraft.sendCommand(' '.join(cmd))
|
||||
|
||||
#############
|
||||
### !help ###
|
||||
#############
|
||||
|
||||
case ["!help"]:
|
||||
log = """Serve - Minecraft/Signal bot.
|
||||
|
||||
Commands:
|
||||
!help [<command>] - Get command help.
|
||||
|
||||
Admin commands:
|
||||
!modules <command> - Manage Serve modules.
|
||||
!cmd <command> - Run Minecraft commands."""
|
||||
libsignal.sendMessage(log, RetardsServer)
|
||||
case ["!help", "modules"]:
|
||||
log = """!modules - Manage Serve modules.
|
||||
|
||||
Admin usage:
|
||||
!modules list - List available, loaded and unloaded modules.
|
||||
!modules load <module> [<module> [...]] - Load module(s).
|
||||
!modules unload <module> [<module> [...]] - Unload module(s).
|
||||
!modules reload <module> [<module> [...]] - Reload module(s).
|
||||
!modules update - Download modules from remote and list available updates.
|
||||
!modules install - Install modules from remote into local directory."""
|
||||
libsignal.sendMessage(log, RetardsServer)
|
||||
case ["!help", "cmd"]:
|
||||
log = """!cmd - Run Minecraft commands.
|
||||
|
||||
Admin usage:
|
||||
!cmd <command> - Run a Minecraft command in the Server."""
|
||||
libsignal.sendMessage(log, RetardsServer)
|
||||
case ["!help", "help"]:
|
||||
log = """!help - Get command help.
|
||||
|
||||
Usage:
|
||||
!help - List available commands.
|
||||
!help <command> - Get help about a command."""
|
||||
libsignal.sendMessage(log, RetardsServer)
|
||||
|
|
|
|||
|
|
@ -35,3 +35,7 @@ def minecraftPlayerJoin(usr: str):
|
|||
@libminecraft.onConsoleOutput(r"\[.*\] \[Server thread\/INFO\]: (.*) left the game")
|
||||
def minecraftPlayerLeave(usr: str):
|
||||
libsignal.sendMessage(f"{usr} left the game.", RetardsServer)
|
||||
|
||||
@libminecraft.onConsoleOutput(r"\[.*\] \[Server thread\/INFO\]: (.*) fell from a high place")
|
||||
def minecraftFallDeath(usr: str):
|
||||
libminecraft.sendCommand(f"say {usr} sei un coglione come cazzo fai a morire di danno da caduta lmfao")
|
||||
Loading…
Add table
Add a link
Reference in a new issue