37 lines
1.1 KiB
Python
37 lines
1.1 KiB
Python
import libminecraft
|
|
import libsignal
|
|
import libcommon
|
|
|
|
RetardsServer = libcommon.Group(
|
|
"Retards Server", "5PlbXaPmWZQkhmuyyC/fkWTy8K+BqomjK7byVDyxmpo=")
|
|
|
|
|
|
players = {
|
|
"Malasaur": "Malasaur",
|
|
"AlForno": "stef",
|
|
"Filippo": "BrixsBang",
|
|
"Mr Beast": "firr",
|
|
"Nick": "NPZ",
|
|
"Osvaldo": "Cheruz",
|
|
"Black Gigef": "Gigef",
|
|
}
|
|
|
|
|
|
@libminecraft.onConsoleOutput(r"\[.*\] \[Server thread\/INFO\]: <(.*)> (.*)")
|
|
def minecraftToSignal(usr: str, msg: str):
|
|
libsignal.sendMessage(f"<{usr}> {msg}", RetardsServer)
|
|
|
|
|
|
@libsignal.onMessage(RetardsServer)
|
|
def signalToMinecraft(usr: str, msg: str):
|
|
usr = players.get(usr, usr)
|
|
libminecraft.sendCommand(f'tellraw @a "<{usr}> {msg}"')
|
|
|
|
|
|
@libminecraft.onConsoleOutput(r"\[.*\] \[Server thread\/INFO\]: (.*) joined the game")
|
|
def minecraftPlayerJoin(usr: str):
|
|
libsignal.sendMessage(f"{usr} joined the game.", RetardsServer)
|
|
|
|
@libminecraft.onConsoleOutput(r"\[.*\] \[Server thread\/INFO\]: (.*) left the game")
|
|
def minecraftPlayerLeave(usr: str):
|
|
libsignal.sendMessage(f"{usr} left the game.", RetardsServer)
|