diff options
author | Linnea Gräf <nea@nea.moe> | 2024-10-04 20:58:00 +0200 |
---|---|---|
committer | Linnea Gräf <nea@nea.moe> | 2024-10-04 20:58:00 +0200 |
commit | 3a3d0bdf021558f9ab5ddd8e8549ade491fd8a57 (patch) | |
tree | f054f4660e9747be10a7e7b24b0a001670476ca9 /src/main/kotlin/features/chat | |
parent | 67dd2f68d68ae48d7b9881a34502d6c25e335745 (diff) | |
download | firmament-tapcube.tar.gz firmament-tapcube.tar.bz2 firmament-tapcube.zip |
Add tapcubed stufftapcube
[no changelog]
Diffstat (limited to 'src/main/kotlin/features/chat')
-rw-r--r-- | src/main/kotlin/features/chat/AutoGGOnTapCube.kt | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/src/main/kotlin/features/chat/AutoGGOnTapCube.kt b/src/main/kotlin/features/chat/AutoGGOnTapCube.kt new file mode 100644 index 0000000..356d40a --- /dev/null +++ b/src/main/kotlin/features/chat/AutoGGOnTapCube.kt @@ -0,0 +1,35 @@ +package moe.nea.firmament.features.chat + +import java.util.concurrent.ThreadLocalRandom +import kotlinx.coroutines.delay +import kotlinx.coroutines.launch +import kotlin.time.Duration.Companion.milliseconds +import net.minecraft.text.Text +import moe.nea.firmament.Firmament +import moe.nea.firmament.annotations.Subscribe +import moe.nea.firmament.events.ProcessChatEvent +import moe.nea.firmament.features.fixes.CompatibliltyFeatures +import moe.nea.firmament.util.FirmFormatters +import moe.nea.firmament.util.MC +import moe.nea.firmament.util.SBData +import moe.nea.firmament.util.useMatch + +object AutoGGOnTapCube { + + val regex = " *. STORE PURCHASE .".toPattern() + + @Subscribe + fun onChat(event: ProcessChatEvent) { + if (!SBData.isTabCube) return + if (!CompatibliltyFeatures.TConfig.tapCube) return + regex.useMatch(event.unformattedString) { + val delay = ThreadLocalRandom.current().nextInt(500, 3000).milliseconds + MC.sendChat(Text.literal("Sending gg in ${FirmFormatters.formatTimespan(delay, true)}")) + Firmament.coroutineScope.launch { + delay(delay) + MC.sendServerChat("gg") + MC.sendChat(Text.literal("Mission accomplished. AutoGG out.")) + } + } + } +} |