diff --git a/README.md b/README.md index 6fb462dec..2e93b26d0 100644 --- a/README.md +++ b/README.md @@ -9,63 +9,74 @@ OdinClient is a comprehensive Forge mod for Hypixel Skyblock, offering a range o - **Mimic Killed Message:** Sends message in party chat when mimic is killed. - **Cancel Chest Open:** Cancels the opening of chests in dungeons. - **TeammatesHighlight:** Enhances visibility of your dungeon teammates and their name tags. +- **Secret Triggerbot:** Automatically gets secrets when looking at them. - **Terracotta Timer:** Displays the time until the terracotta spawns. -- **Auto Extra Stats:** Automatically clicks the extra stats at the end of a dungeon. - **Blessing Display:** Displays the current blessings of the dungeon. - **Secret Hitboxes:** Full block Secret hitboxes. +- **Auto Extra Stats:** Automatically clicks the extra stats at the end of a dungeon. - **AFK Thorn Stun:** Toggle right click while holding Tribal Spear or Bonemerang in F4/M4 +- **Cancel Interact:** Cancels the interaction with certain blocks, so that the item can be used instead. - **Ghost Pick:** Gives you a ghost pickaxe in your selected slot when uyou press the keybind. -- **Dungeon Map:** A dungeon map that scans the dungeon, heavily inspired by FunnyMap - **Auto Ult:** Activates your ult at crucial moments, such as when giants spawn, Maxor is stuck in the first laser, or Goldor starts. +- **Dungeon Map:** A dungeon map that scans the dungeon, heavily inspired by FunnyMap - **Ghost Block:** Creates ghost blocks on keypress, and in specific locations. +- **Water Solver:** Solves the water puzzle with a single flow. - **Watcher Bar:** Shows the watcher's health. - **Superboom:** Places TNT when you left click on a block which can blow up. +- **Swap Stonk:** Does a swap stonk when you press the keybind. - **Auto Ice Fill:** Automatically completes the ice fill puzzle. - **Auto Shield:** Utilizes Wither shield every 5 seconds when health is not full (works with all Wither swords). -- **Auto Mask:** Automatically uses masks when they proc. - **Triggerbot:** Instantly left clicks if you are looking at a specified mob. +- **Auto Mask:** Automatically uses masks when they proc. - **Auto Wish:** Grants wishes for your teammates when they are low on health. - **Auto Leap:** Automatically leaps to the player who sent !tp in party chat. +- **Auto GFS:** Automatically gets pearls from sacks if your inventory doesn't have any. - **Auto Sell:** Automatically sell items in trades and cookie menus. - **Key ESP:** Draws a box around the key. ### Floor 7 -- **Decoy Dead Message:** Sends a message in party chat when a decoy dies +- **Dragon Death Confirmation:** Confirms if a dragon in p5 counted or not. - **Auto Ender Dragon:** Automatically clicks the Ender Dragon pet at the start of p5. - **Necron Drop Timer:** Shows a timer for when Necron drops you down. +- **Stop Wrong Clicks:** Stops you from clicking wrong items in terminal. +- **Arrow Triggerbot:** Triggerbot for 4th device - **Levers Triggerbot:** Triggerbot for the levers device. - **Relic Announcer:** Automatically announce your relic to the rest of the party. +- **Relic Placer:** Places the relic if you hover over the correct cauldron - **Terminal Solver:** Renders the solution of terminals in f7/m7. - **Terminal Times:** Keeps track of how long you took to complete a terminal. - **Dragon Boxes:** Shows semi-accurate kill boxes for M7 dragons. - **Dragon Timer:** Displays a timer for when M7 dragons spawn. +- **Hover Terms:** Clicks the hovered item in a terminal if it is correct. - **FUCK DIORITE:** Replaces the pillars in the F7 & M7 boss-fight with glass. - **Leap Helper:** Shows which player is the most practical to leap to in the M7 boss-fight. -- **Simon Says:** Different features for the Simon Says puzzle in f7/m7. - **Arrow Align:** Different features for the arrow alignment device. -- **Relic Auto:** Automatically picks relics in the Witherking boss-fight. +- **Simon Says:** Different features for the Simon Says puzzle in f7/m7. +- **Relic Aura:** Automatically picks relics in the Witherking boss-fight. ### Render +- **Render Optimizer:** Disables certain render functions when they are not necessary, resulting in a decrease in gpu usage - **Arrow Trajectory:** Displays the trajectory of the arrows your terminator would shoot. - **Dragon Hitboxes:** Renders real dragon hitboxes - **Personal Dragon:** Renders your own personal dragon. - **No Cursor Reset:** Makes your cursor stop resetting between guis. -- **Lock Cursor:** Makes you completely unable to move your camera. +- **Clicked Chests:** Draws a box around all the chests you have clicked. +- **Blocks Broken:** Displays how many blocks per second you're breaking. - **CPS Display:** Displays your CPS -- **Serverhud:** Displays your current ping and the server's TPS. +- **Lock Cursor:** Makes you completely unable to move your camera. - **Waypoints:** Custom Waypoints /wp gui. -- **No Render:** Disables certain render functions when they are not necessary, resulting in a decrease in gpu usage +- **Nick Hider:** Replace your name, color codes work. - **No Debuff:** Disables certain debuffs. - **No Carpet:** Removes nearby carpets. -- **Nick Hider:** Replace your name, color codes work. - **Camera:** Allows you to disable front cam and change distance. - **ESP:** Allows you to highlight selected mobs. ### Skyblock - **Auto-Renew Hollows Pass:** Automatically rebuy a crystal hollows pass. -- **Auto Limbo Leave:** Automatically leaves limbo whenever you get kicked. - **Private Commands:** Offers custom commands for private message use, accessible via !help in private chat. - **Auto Experiemnts:** Automatically click on the Chronomatron and Ultrasequencer experiments. +- **Auto Limbo Leave:** Automatically leaves limbo whenever you get kicked. +- **Deployable Timer:** Shows the time left on deployables. - **Farming Hitboxes:** Expands the hitbox of some crops to a full block - **Deployable Timer:** Shows the time left on deployables. - **Party Commands:** Party commands! Use /blacklist to blacklist players from using this module. !help for help. @@ -74,6 +85,7 @@ OdinClient is a comprehensive Forge mod for Hypixel Skyblock, offering a range o - **Cookie Clicker:** Automatically clicks the cookie in the cookie clicker menu. - **Kuudra Alerts:** Displays alerts for certain kuudra events. - **Vanq Notifier:** Sends a message whenever a vanquisher spawns. +- **Diana Helper:** Helps with Diana's event. - **Gyro Range:** Renders a helpful circle to show the range of the Gyrokinetic Wand. - **Auto Sprint:** Automatically makes you sprint. - **Escrow Fix:** Automatically reopens the ah/bz when it gets closed by escrow. diff --git a/src/main/kotlin/me/odinclient/features/ModuleManager.kt b/src/main/kotlin/me/odinclient/features/ModuleManager.kt index ac071e9a1..2876a3e1a 100644 --- a/src/main/kotlin/me/odinclient/features/ModuleManager.kt +++ b/src/main/kotlin/me/odinclient/features/ModuleManager.kt @@ -71,8 +71,6 @@ object ModuleManager { LockCursor, VanqNotifier, PartyCommands, - GuildCommands, - PrivateCommands, AutoEdrag, DioriteFucker, DragonBoxes, @@ -127,7 +125,8 @@ object ModuleManager { BPS, AutoGFS, DragonDeathCheck, - WaterSolver + WaterSolver, + MelodyMessage ) @SubscribeEvent diff --git a/src/main/kotlin/me/odinclient/features/impl/dungeon/TeammatesOutline.kt b/src/main/kotlin/me/odinclient/features/impl/dungeon/TeammatesOutline.kt index c6671814d..a8b7ffe39 100644 --- a/src/main/kotlin/me/odinclient/features/impl/dungeon/TeammatesOutline.kt +++ b/src/main/kotlin/me/odinclient/features/impl/dungeon/TeammatesOutline.kt @@ -43,6 +43,7 @@ object TeammatesOutline : Module( fun onRenderWorld(event: RenderWorldLastEvent) { if (!DungeonUtils.inDungeons || (!inBoss && DungeonUtils.inBoss)) return DungeonUtils.teammates.forEach { + if (!inBoss && DungeonUtils.inBoss) return if (!whenVisible && mc.thePlayer.canEntityBeSeen(it.first)) return if (it.first == mc.thePlayer) return RenderUtils.drawStringInWorld( diff --git a/src/main/kotlin/me/odinclient/features/impl/floor7/MelodyMessage.kt b/src/main/kotlin/me/odinclient/features/impl/floor7/MelodyMessage.kt new file mode 100644 index 000000000..9dae006a5 --- /dev/null +++ b/src/main/kotlin/me/odinclient/features/impl/floor7/MelodyMessage.kt @@ -0,0 +1,42 @@ +package me.odinclient.features.impl.floor7 + +import me.odinclient.events.impl.GuiClosedEvent +import me.odinclient.events.impl.GuiLoadedEvent +import me.odinclient.features.Category +import me.odinclient.features.Module +import me.odinclient.features.settings.impl.StringSetting +import me.odinclient.utils.skyblock.ChatUtils +import me.odinclient.utils.skyblock.dungeon.DungeonUtils +import net.minecraftforge.event.world.WorldEvent +import net.minecraftforge.fml.common.eventhandler.SubscribeEvent + +object MelodyMessage : Module( + name = "Melody Message", + description = "Sends a message whenever you open the melody terminal.", + category = Category.FLOOR7, + tag = TagType.NEW +) { + private val melodyMessage: String by StringSetting("Melody Message", "Mimic Killed", 40, description = "Message sent when the melody terminal opens") + + private var saidMelody = false + @SubscribeEvent + fun onGuiLoad(event: GuiLoadedEvent) { + if (!DungeonUtils.inDungeons) return + if (saidMelody) return + if (!event.name.startsWith("Click the button on time!")) return + + ChatUtils.partyMessage(melodyMessage) + saidMelody = true + } + + @SubscribeEvent + fun onGuiClose(event: GuiClosedEvent) { + saidMelody = false + } + + @SubscribeEvent + fun onWorldUnload(event: WorldEvent.Unload){ + saidMelody = false + } + +} \ No newline at end of file diff --git a/src/main/kotlin/me/odinclient/features/impl/render/BPS.kt b/src/main/kotlin/me/odinclient/features/impl/render/BPS.kt index 7213165df..dafca038e 100644 --- a/src/main/kotlin/me/odinclient/features/impl/render/BPS.kt +++ b/src/main/kotlin/me/odinclient/features/impl/render/BPS.kt @@ -21,7 +21,7 @@ import net.minecraftforge.fml.common.gameevent.TickEvent.ClientTickEvent object BPS : Module( name = "Blocks Broken", category = Category.RENDER, - description = "Displays hows many blocks per second you're breaking" + description = "Displays how many blocks per second you're breaking." ) { private var startTime: Long = 0 diff --git a/src/main/kotlin/me/odinclient/features/impl/skyblock/GuildCommands.kt b/src/main/kotlin/me/odinclient/features/impl/skyblock/GuildCommands.kt deleted file mode 100644 index 59dc058d3..000000000 --- a/src/main/kotlin/me/odinclient/features/impl/skyblock/GuildCommands.kt +++ /dev/null @@ -1,75 +0,0 @@ -package me.odinclient.features.impl.skyblock - -import kotlinx.coroutines.DelicateCoroutinesApi -import kotlinx.coroutines.GlobalScope -import kotlinx.coroutines.delay -import kotlinx.coroutines.launch -import me.odinclient.events.impl.ChatPacketEvent -import me.odinclient.features.Category -import me.odinclient.features.Module -import me.odinclient.features.settings.impl.BooleanSetting -import me.odinclient.utils.ServerUtils -import me.odinclient.utils.Utils.floor -import me.odinclient.utils.WebUtils -import me.odinclient.utils.skyblock.ChatUtils -import me.odinclient.utils.skyblock.ChatUtils.isInBlacklist -import me.odinclient.utils.skyblock.PlayerUtils -import net.minecraftforge.fml.common.eventhandler.SubscribeEvent -import kotlin.math.floor - -object GuildCommands : Module( - name = "Guild Commands", - category = Category.SKYBLOCK, - description = "Guild commands! Use /blacklist to blacklist players from using this module. !help for help." -) { - private val guildGM: Boolean by BooleanSetting("Guild GM") - - private var help: Boolean by BooleanSetting(name = "help", default = true) - private var coords: Boolean by BooleanSetting(name = "coords", default = true) - private var odin: Boolean by BooleanSetting(name = "odin", default = true) - private var boop: Boolean by BooleanSetting(name = "boop", default = true) - private var cf: Boolean by BooleanSetting(name = "cf", default = true) - private var eightball: Boolean by BooleanSetting(name = "eightball", default = true) - private var dice: Boolean by BooleanSetting(name = "dice", default = true) - private var cat: Boolean by BooleanSetting(name = "cat", default = true) - private var ping: Boolean by BooleanSetting(name = "ping", default = true) - private var tps: Boolean by BooleanSetting(name = "tps", default = true) - - - @OptIn(DelicateCoroutinesApi::class) - @SubscribeEvent - fun guild(event: ChatPacketEvent) { - val match = Regex("Guild > (\\[.+])? ?(.+) ?(\\[.+])?: ?(.+)").find(event.message) ?: return - - val ign = match.groups[2]?.value?.split(" ")?.get(0) // Get rid of guild rank by splitting the string and getting the first word - val msg = match.groups[4]?.value?.lowercase() - GlobalScope.launch { - delay(150) - guildCmdsOptions(msg!!, ign!!) - if (guildGM && mc.thePlayer.name !== ign) ChatUtils.autoGM(msg, ign) - } - - } - - private fun guildCmdsOptions(message: String,name: String) { - if (isInBlacklist(name)) return - if (!message.startsWith("!")) return - when (message.split(" ")[0].drop(1)) { - "help" -> if (help) ChatUtils.guildMessage("Commands: coords, odin, boop, cf, 8ball, dice, cat, ping, tps") - "coords" -> if (coords) ChatUtils.guildMessage( - "x: ${PlayerUtils.posX.floor()}, y: ${PlayerUtils.posY.floor()}, z: ${PlayerUtils.posZ.floor()}" - ) - "odin" -> if (odin) ChatUtils.guildMessage("OdinClient! https://discord.gg/2nCbC9hkxT") - "boop" -> if (boop) ChatUtils.sendChatMessage("/boop $name") - "cf" -> if (cf) ChatUtils.guildMessage(ChatUtils.flipCoin()) - "8ball" -> if (eightball) ChatUtils.guildMessage(ChatUtils.eightBall()) - "dice" -> if (dice) ChatUtils.guildMessage(ChatUtils.rollDice()) - "cat" -> if (cat) ChatUtils.guildMessage("https://i.imgur.com/${WebUtils.imgurID("https://api.thecatapi.com/v1/images/search")}.png") - "ping" -> if (ping) ChatUtils.guildMessage("Current Ping: ${floor(ServerUtils.averagePing)}ms") - "tps" -> if (tps) ChatUtils.partyMessage("Current Ping: ${floor(ServerUtils.averageTps.floor())}ms") - - - } - } - -} \ No newline at end of file diff --git a/src/main/kotlin/me/odinclient/features/impl/skyblock/PartyCommands.kt b/src/main/kotlin/me/odinclient/features/impl/skyblock/PartyCommands.kt index 98dcc2e8e..4a54dbbd4 100644 --- a/src/main/kotlin/me/odinclient/features/impl/skyblock/PartyCommands.kt +++ b/src/main/kotlin/me/odinclient/features/impl/skyblock/PartyCommands.kt @@ -4,9 +4,11 @@ import kotlinx.coroutines.DelicateCoroutinesApi import kotlinx.coroutines.GlobalScope import kotlinx.coroutines.delay import kotlinx.coroutines.launch +import me.odinclient.ModCore import me.odinclient.events.impl.ChatPacketEvent import me.odinclient.features.Category import me.odinclient.features.Module +import me.odinclient.features.settings.Setting.Companion.withDependency import me.odinclient.features.settings.impl.BooleanSetting import me.odinclient.utils.AutoSessionID import me.odinclient.utils.ServerUtils @@ -15,16 +17,20 @@ import me.odinclient.utils.WebUtils import me.odinclient.utils.skyblock.ChatUtils import me.odinclient.utils.skyblock.ChatUtils.isInBlacklist import me.odinclient.utils.skyblock.PlayerUtils +import net.minecraft.event.ClickEvent +import net.minecraft.util.ChatComponentText import net.minecraftforge.fml.common.eventhandler.SubscribeEvent import kotlin.math.floor object PartyCommands : Module( - name = "Party Commands", + name = "Chat commands", category = Category.SKYBLOCK, - description = "Party Commands! Use /blacklist to blacklist players from using this module. !help for help.", + description = "type !help in the corresponding channel for cmd list. Use /blacklist.", ) { + private var party: Boolean by BooleanSetting(name = "Party cmds", default = true) + private var guild: Boolean by BooleanSetting(name = "Guild cmds", default = true) + private var private: Boolean by BooleanSetting(name = "Private cmds", default = true) - private var help: Boolean by BooleanSetting(name = "Help", default = true) private var warp: Boolean by BooleanSetting(name = "Warp", default = true) private var warptransfer: Boolean by BooleanSetting(name = "Warp then transfer (warptransfer)", default = true) private var coords: Boolean by BooleanSetting(name = "Coords (coords)", default = true) @@ -40,6 +46,10 @@ object PartyCommands : Module( private var ping: Boolean by BooleanSetting(name = "Ping", default = true) private var tps: Boolean by BooleanSetting(name = "tps", default = true) private var dt: Boolean by BooleanSetting(name = "Dt", default = true) + private var inv: Boolean by BooleanSetting(name = "inv", default = true) + private val invite: Boolean by BooleanSetting(name = "invite", default = true) + private val guildGM: Boolean by BooleanSetting("Guild GM").withDependency { guild } + private var dtPlayer: String? = null var disableReque: Boolean? = false @@ -47,16 +57,47 @@ object PartyCommands : Module( @OptIn(DelicateCoroutinesApi::class) @SubscribeEvent fun party(event: ChatPacketEvent) { + if(!party) return val match = Regex("Party > (\\[.+])? ?(.+): !(.+)").find(event.message) ?: return val ign = match.groups[2]?.value val msg = match.groups[3]?.value?.lowercase() GlobalScope.launch { - delay(150) + delay(200) partyCmdsOptions(msg!!, ign!!) } } + @OptIn(DelicateCoroutinesApi::class) + @SubscribeEvent + fun guild(event: ChatPacketEvent) { + if(!guild) return + val match = Regex("Guild > (\\[.+])? ?(.+) ?(\\[.+])?: ?(.+)").find(event.message) ?: return + + val ign = match.groups[2]?.value?.split(" ")?.get(0) // Get rid of guild rank by splitting the string and getting the first word + val msg = match.groups[4]?.value?.lowercase() + + GlobalScope.launch { + delay(200) + guildCmdsOptions(msg!!, ign!!) + if (guildGM && !mc.thePlayer.name.equals(ign)) ChatUtils.autoGM(msg, ign) + } + } + + @OptIn(DelicateCoroutinesApi::class) + @SubscribeEvent + fun private(event: ChatPacketEvent) { + if(!private) return + val match = Regex("From (\\[.+])? ?(.+): !(.+)").find(event.message) ?: return + + val ign = match.groups[2]?.value + val msg = match.groups[3]?.value?.lowercase() + GlobalScope.launch { + delay(200) + privateCmdsOptions(msg!!, ign!!) + } + } + @OptIn(DelicateCoroutinesApi::class) @SubscribeEvent fun dt(event: ChatPacketEvent) { @@ -73,7 +114,7 @@ object PartyCommands : Module( private suspend fun partyCmdsOptions(message: String, name: String) { if (isInBlacklist(name)) return when (message.split(" ")[0]) { - "help" -> if (help) ChatUtils.partyMessage("Commands: warp, coords, allinvite, odin, boop, cf, 8ball, dice, cat, pt, rat, ping, warptransfer") + "help" -> ChatUtils.partyMessage("Commands: warp, coords, allinvite, odin, boop, cf, 8ball, dice, cat, pt, rat, ping, warptransfer") "warp" -> if (warp) ChatUtils.sendCommand("p warp") "warptransfer" -> { if (warptransfer) ChatUtils.sendCommand("p warp") @@ -107,5 +148,47 @@ object PartyCommands : Module( } } + private fun guildCmdsOptions(message: String,name: String) { + if (isInBlacklist(name)) return + if (!message.startsWith("!")) return + when (message.split(" ")[0].drop(1)) { + "help" -> ChatUtils.guildMessage("Commands: coords, odin, boop, cf, 8ball, dice, cat, ping, tps") + "coords" -> if (coords) ChatUtils.guildMessage( + "x: ${PlayerUtils.posX.floor()}, y: ${PlayerUtils.posY.floor()}, z: ${PlayerUtils.posZ.floor()}") + "odin" -> if (odin) ChatUtils.guildMessage("OdinClient! https://discord.gg/2nCbC9hkxT") + "boop" -> if (boop) ChatUtils.sendChatMessage("/boop $name") + "cf" -> if (cf) ChatUtils.guildMessage(ChatUtils.flipCoin()) + "8ball" -> if (eightball) ChatUtils.guildMessage(ChatUtils.eightBall()) + "dice" -> if (dice) ChatUtils.guildMessage(ChatUtils.rollDice()) + "cat" -> if (cat) ChatUtils.guildMessage("https://i.imgur.com/${WebUtils.imgurID("https://api.thecatapi.com/v1/images/search")}.png") + "ping" -> if (ping) ChatUtils.guildMessage("Current Ping: ${floor(ServerUtils.averagePing)}ms") + "tps" -> if (tps) ChatUtils.partyMessage("Current Ping: ${floor(ServerUtils.averageTps.floor())}ms") + } + } + private fun privateCmdsOptions(message: String,name: String) { + if (isInBlacklist(name)) return + when (message.split(" ")[0]) { + "help" -> ChatUtils.privateMessage("Commands: inv, coords, odin, boop, cf, 8ball, dice, cat ,ping",name) + "coords" -> if (coords) ChatUtils.privateMessage( + "x: ${PlayerUtils.posX.floor()}, y: ${PlayerUtils.posY.floor()}, z: ${PlayerUtils.posZ.floor()}", + name + ) + "odin" -> if (odin) ChatUtils.privateMessage("OdinClient! https://discord.gg/2nCbC9hkxT",name) + "boop" -> if (boop) ChatUtils.sendChatMessage("/boop $name") + "cf" -> if (cf) ChatUtils.privateMessage(ChatUtils.flipCoin(),name) + "8ball" -> if (eightball) ChatUtils.privateMessage(ChatUtils.eightBall(),name) + "dice" -> if (dice) ChatUtils.privateMessage(ChatUtils.rollDice(),name) + "cat" -> if (cat) ChatUtils.privateMessage("https://i.imgur.com/${WebUtils.imgurID("https://api.thecatapi.com/v1/images/search")}.png",name) + "ping" -> if (ping) ChatUtils.privateMessage("Current Ping: ${floor(ServerUtils.averagePing)}ms",name) + "inv" -> if (inv) ChatUtils.sendCommand("party invite $name") + "invite" -> if (invite) { + ModCore.mc.thePlayer.playSound("note.pling", 100f, 1f) + ModCore.mc.thePlayer.addChatMessage( + ChatComponentText("§3Odin§bClient §8»§r Click on this message to invite $name to your party!") + .setChatStyle(ChatUtils.createClickStyle(ClickEvent.Action.RUN_COMMAND,"/party invite $name")) + ) + } + } + } } diff --git a/src/main/kotlin/me/odinclient/features/impl/skyblock/PrivateCommands.kt b/src/main/kotlin/me/odinclient/features/impl/skyblock/PrivateCommands.kt deleted file mode 100644 index 0fea007c2..000000000 --- a/src/main/kotlin/me/odinclient/features/impl/skyblock/PrivateCommands.kt +++ /dev/null @@ -1,84 +0,0 @@ -package me.odinclient.features.impl.skyblock - -import kotlinx.coroutines.DelicateCoroutinesApi -import kotlinx.coroutines.GlobalScope -import kotlinx.coroutines.delay -import kotlinx.coroutines.launch -import me.odinclient.ModCore -import me.odinclient.events.impl.ChatPacketEvent -import me.odinclient.features.Category -import me.odinclient.features.Module -import me.odinclient.features.settings.impl.BooleanSetting -import me.odinclient.utils.ServerUtils -import me.odinclient.utils.Utils.floor -import me.odinclient.utils.WebUtils -import me.odinclient.utils.skyblock.ChatUtils -import me.odinclient.utils.skyblock.ChatUtils.isInBlacklist -import me.odinclient.utils.skyblock.PlayerUtils -import net.minecraft.event.ClickEvent -import net.minecraft.util.ChatComponentText -import net.minecraftforge.fml.common.eventhandler.SubscribeEvent -import kotlin.math.floor - -object PrivateCommands : Module( - name = "Private Commands", - category = Category.SKYBLOCK, - description = "Party commands! Use /blacklist to blacklist players from using this module. !help for help." -) { - - private var help: Boolean by BooleanSetting(name = "help", default = true) - private var coords: Boolean by BooleanSetting(name = "coords", default = true) - private var odin: Boolean by BooleanSetting(name = "odin", default = true) - private var boop: Boolean by BooleanSetting(name = "boop", default = true) - private var cf: Boolean by BooleanSetting(name = "cf", default = true) - private var eightball: Boolean by BooleanSetting(name = "eightball", default = true) - private var dice: Boolean by BooleanSetting(name = "dice", default = true) - private var cat: Boolean by BooleanSetting(name = "cat", default = true) - private var ping: Boolean by BooleanSetting(name = "ping", default = true) - private var inv: Boolean by BooleanSetting(name = "inv", default = true) - private var gm: Boolean by BooleanSetting(name = "gm", default = true) - private var gn: Boolean by BooleanSetting(name = "gn", default = true) - private val invite: Boolean by BooleanSetting(name = "invite", default = true) - - @OptIn(DelicateCoroutinesApi::class) - @SubscribeEvent - fun private(event: ChatPacketEvent) { - val match = Regex("From (\\[.+])? ?(.+): !(.+)").find(event.message) ?: return - - val ign = match.groups[2]?.value - val msg = match.groups[3]?.value?.lowercase() - GlobalScope.launch { - delay(150) - privateCmdsOptions(msg!!, ign!!) - } - } - - private fun privateCmdsOptions(message: String,name: String) { - if (isInBlacklist(name)) return - when (message.split(" ")[0]) { - "help" -> if (help) ChatUtils.privateMessage("Commands: inv, coords, odin, boop, cf, 8ball, dice, cat ,ping",name) - "coords" -> if (coords) ChatUtils.privateMessage( - "x: ${PlayerUtils.posX.floor()}, y: ${PlayerUtils.posY.floor()}, z: ${PlayerUtils.posZ.floor()}", - name - ) - "odin" -> if (odin) ChatUtils.privateMessage("OdinClient! https://discord.gg/2nCbC9hkxT",name) - "boop" -> if (boop) ChatUtils.sendChatMessage("/boop $name") - "cf" -> if (cf) ChatUtils.privateMessage(ChatUtils.flipCoin(),name) - "8ball" -> if (eightball) ChatUtils.privateMessage(ChatUtils.eightBall(),name) - "dice" -> if (dice) ChatUtils.privateMessage(ChatUtils.rollDice(),name) - "cat" -> if (cat) ChatUtils.privateMessage("https://i.imgur.com/${WebUtils.imgurID("https://api.thecatapi.com/v1/images/search")}.png",name) - "ping" -> if (ping) ChatUtils.privateMessage("Current Ping: ${floor(ServerUtils.averagePing)}ms",name) - "inv" -> if (inv) ChatUtils.sendCommand("party invite $name") - "gm" -> if (gm) ChatUtils.privateMessage("Good Morning $name!",name) - "gn" -> if (gn) ChatUtils.privateMessage("Good Night $name.",name) - "invite" -> if (invite) { - ModCore.mc.thePlayer.playSound("note.pling", 100f, 1f) - ModCore.mc.thePlayer.addChatMessage( - ChatComponentText("§3Odin§bClient §8»§r Click on this message to invite $name to your party!") - .setChatStyle(ChatUtils.createClickStyle(ClickEvent.Action.RUN_COMMAND,"/party invite $name")) - ) - } - } - } - -}