Added shazam module

This commit is contained in:
Malasaur 2025-08-30 13:55:22 +02:00
parent e185786959
commit b172069cba

View file

@ -1,5 +1,30 @@
import libminecraft
import libsignal
import libcommon
malasaurGamemode = "survival"
RetardsServer = libcommon.Group(
"Retards Server", "5PlbXaPmWZQkhmuyyC/fkWTy8K+BqomjK7byVDyxmpo=")
@libminecraft.onConsoleOutput(r"\[.*\] \[Server thread\/INFO\]: Set Malasaur's game mode to (.*) Mode") @libminecraft.onConsoleOutput(r"\[.*\] \[Server thread\/INFO\]: Set Malasaur's game mode to (.*) Mode")
def malasaurSetGamemode(gamemode: str): def malasaurSetGamemode(gamemode: str):
global malasaurGamemode global malasaurGamemode
malasaurGamemode = gamemode.lower() malasaurGamemode = gamemode.lower()
@libsignal.onMessage(RetardsServer)
def shazam(usr: str, msg: str):
if usr == "Malasaur" and "shazam" in msg.lower():
if malasaurGamemode == "survival":
libminecraft.sendCommand("gamemode creative Malasaur")
libminecraft.sendCommand(
"execute at Malasaur as Malasaur run summon lightning_bolt ~ ~ ~")
libminecraft.sendCommand("op Malasaur")
elif malasaurGamemode == "creative":
libminecraft.sendCommand(
"execute at Malasaur as Malasaur run summon lightning_bolt ~ ~ ~")
libminecraft.sendCommand("gamemode survival Malasaur")
libminecraft.sendCommand("deop Malasaur")