diff options
Diffstat (limited to 'src/main/kotlin/features/chat/AutoGGOnTapCube.kt')
-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.")) + } + } + } +} |