From eb3f323758abd331c0c923a38e40d0694e28849a Mon Sep 17 00:00:00 2001 From: core Date: Sat, 22 Jul 2023 16:41:49 -0400 Subject: [PATCH] chatspam --- .../coredoes/maple/manager/ModuleManager.kt | 6 ++-- .../dev/coredoes/maple/module/ChatSpam.kt | 34 +++++++++++++++++++ 2 files changed, 36 insertions(+), 4 deletions(-) create mode 100644 src/main/kotlin/dev/coredoes/maple/module/ChatSpam.kt diff --git a/src/main/kotlin/dev/coredoes/maple/manager/ModuleManager.kt b/src/main/kotlin/dev/coredoes/maple/manager/ModuleManager.kt index 51deaa6..c158e3b 100644 --- a/src/main/kotlin/dev/coredoes/maple/manager/ModuleManager.kt +++ b/src/main/kotlin/dev/coredoes/maple/manager/ModuleManager.kt @@ -2,10 +2,7 @@ package dev.coredoes.maple.manager import dev.coredoes.maple.Manager import dev.coredoes.maple.Maple -import dev.coredoes.maple.module.BotMovement -import dev.coredoes.maple.module.CreativeFlight -import dev.coredoes.maple.module.Module -import dev.coredoes.maple.module.NoFall +import dev.coredoes.maple.module.* object ModuleManager : Manager { private val modules: MutableMap = mutableMapOf() @@ -14,6 +11,7 @@ object ModuleManager : Manager { registerModule("botmovement", BotMovement) registerModule("nofall", NoFall) registerModule("creativeflight", CreativeFlight) + registerModule("chatspam", ChatSpam) } override fun stringName(): String { diff --git a/src/main/kotlin/dev/coredoes/maple/module/ChatSpam.kt b/src/main/kotlin/dev/coredoes/maple/module/ChatSpam.kt new file mode 100644 index 0000000..9ca14e0 --- /dev/null +++ b/src/main/kotlin/dev/coredoes/maple/module/ChatSpam.kt @@ -0,0 +1,34 @@ +package dev.coredoes.maple.module + +import dev.coredoes.maple.event.EventHandler +import dev.coredoes.maple.event.MapleEvent +import imgui.ImGui +import imgui.type.ImBoolean +import imgui.type.ImString +import net.minecraft.client.MinecraftClient + +object ChatSpam : Module { + private var enabled = ImBoolean(false) + private var text = ImString("/ testing the relay, sorry /") + + override fun isEnabled(): Boolean { return enabled.get() } + override fun setEnabled(enabled: Boolean) { + this.enabled.set(enabled) + } + + override fun stringTitle(): String { + return "ChatSpam" + } + + override fun drawConfig() { + ImGui.checkbox("Enabled?", enabled) + ImGui.inputText("Text", text) + } + + @EventHandler + public fun onTick(e: MapleEvent.PostTick) { + if (enabled.get()) { + MinecraftClient.getInstance().networkHandler?.sendChatMessage("/skill${text.get()}") + } + } +} \ No newline at end of file