Skip to content

Commit

Permalink
feat(AutoQueue): message mode (#5696)
Browse files Browse the repository at this point in the history
  • Loading branch information
1zun4 authored Feb 24, 2025
1 parent f6919d2 commit 798ada8
Show file tree
Hide file tree
Showing 2 changed files with 61 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,14 @@ import net.ccbluex.liquidbounce.features.module.Category
import net.ccbluex.liquidbounce.features.module.ClientModule
import net.ccbluex.liquidbounce.features.module.modules.player.autoqueue.modes.AutoQueueGommeDuels
import net.ccbluex.liquidbounce.features.module.modules.player.autoqueue.modes.AutoQueueHypixelSW
import net.ccbluex.liquidbounce.features.module.modules.player.autoqueue.modes.AutoQueueMessage
import net.ccbluex.liquidbounce.features.module.modules.player.autoqueue.modes.AutoQueuePaper

object ModuleAutoQueue : ClientModule("AutoQueue", Category.PLAYER, aliases = arrayOf("AutoPlay")) {
val modes = choices("Mode", AutoQueuePaper, arrayOf(
AutoQueueMessage,
AutoQueuePaper,
AutoQueueHypixelSW,
AutoQueueGommeDuels
AutoQueueGommeDuels,
)).apply(::tagBy)
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
/*
* This file is part of LiquidBounce (https://github.com/CCBlueX/LiquidBounce)
*
* Copyright (c) 2015 - 2025 CCBlueX
*
* LiquidBounce is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* LiquidBounce is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with LiquidBounce. If not, see <https://www.gnu.org/licenses/>.
*
*
*/

package net.ccbluex.liquidbounce.features.module.modules.player.autoqueue.modes

import net.ccbluex.liquidbounce.config.types.Choice
import net.ccbluex.liquidbounce.config.types.ChoiceConfigurable
import net.ccbluex.liquidbounce.event.events.ChatReceiveEvent
import net.ccbluex.liquidbounce.event.handler
import net.ccbluex.liquidbounce.features.module.modules.player.autoqueue.ModuleAutoQueue.modes

/**
* Can be used for different server that use paper to join a game
*/
object AutoQueueMessage : Choice("Message") {

private val text by text("Text", "Новая игра")
private val command by text("Command", "/next")

override val parent: ChoiceConfigurable<Choice>
get() = modes

@Suppress("unused")
private val chatReceive = handler<ChatReceiveEvent> { event ->
val message = event.message

if (event.type != ChatReceiveEvent.ChatType.GAME_MESSAGE) {
return@handler
}

if (event.message.contains(text)) {
if (command.startsWith("/")) {
network.sendCommand(command.substring(1))
} else {
network.sendChatMessage(command)
}
}
}

}

0 comments on commit 798ada8

Please sign in to comment.