From 0d82e6915526f547da758f669dc5e992c433a403 Mon Sep 17 00:00:00 2001 From: St0neHunter <161620876+St0neHunter@users.noreply.github.com> Date: Wed, 7 Aug 2024 19:30:01 +0200 Subject: [PATCH] Option to use /hub instead of /q + better explanation for solo mode (#19) --- src/Client/Module/Modules/AutoRQ/AutoRQ.hpp | 28 +++++++++ .../Module/Modules/AutoRQ/AutoRQListener.hpp | 58 +++++++++++++------ 2 files changed, 67 insertions(+), 19 deletions(-) diff --git a/src/Client/Module/Modules/AutoRQ/AutoRQ.hpp b/src/Client/Module/Modules/AutoRQ/AutoRQ.hpp index 7f1a6a01..c12cc437 100644 --- a/src/Client/Module/Modules/AutoRQ/AutoRQ.hpp +++ b/src/Client/Module/Modules/AutoRQ/AutoRQ.hpp @@ -32,6 +32,8 @@ class AutoRQ : public Module { settings.addSetting("command", (std::string)""); if (settings.getSettingByName("solo") == nullptr) settings.addSetting("solo", false); + if (settings.getSettingByName("hub") == nullptr) + settings.addSetting("hub", false); if (settings.getSettingByName("murderer") == nullptr) settings.addSetting("murderer", false); if (settings.getSettingByName("sheriff") == nullptr) @@ -64,6 +66,13 @@ class AutoRQ : public Module { Constraints::RelativeConstraint(1.0, "width"), Constraints::RelativeConstraint(1.0f, "height")); + FlarialGUI::FlarialTextWithFont(toggleX + Constraints::SpacingConstraint(0, textWidth), toggleY, + L"Re-Q when you finish or die in a game\npls dont use while in a party", textWidth * 6.9f, textHeight, + DWRITE_TEXT_ALIGNMENT_LEADING, Constraints::SpacingConstraint(1.05, textWidth), + DWRITE_FONT_WEIGHT_NORMAL); + + toggleY += Constraints::SpacingConstraint(0.35, textWidth); + FlarialGUI::FlarialTextWithFont(toggleX + Constraints::SpacingConstraint(0.60, textWidth), toggleY, L"Solo mode", textWidth * 6.9f, textHeight, DWRITE_TEXT_ALIGNMENT_LEADING, Constraints::SpacingConstraint(1.05, textWidth), @@ -76,6 +85,25 @@ class AutoRQ : public Module { toggleY += Constraints::SpacingConstraint(0.35, textWidth); + FlarialGUI::FlarialTextWithFont(toggleX + Constraints::SpacingConstraint(0, textWidth), toggleY, + L"Use /hub instead of /q", textWidth * 6.9f, textHeight, + DWRITE_TEXT_ALIGNMENT_LEADING, Constraints::SpacingConstraint(1.05, textWidth), + DWRITE_FONT_WEIGHT_NORMAL); + + toggleY += Constraints::SpacingConstraint(0.35, textWidth); + + FlarialGUI::FlarialTextWithFont(toggleX + Constraints::SpacingConstraint(0.60, textWidth), toggleY, + L"use /hub", textWidth * 6.9f, textHeight, + DWRITE_TEXT_ALIGNMENT_LEADING, Constraints::SpacingConstraint(1.05, textWidth), + DWRITE_FONT_WEIGHT_NORMAL); + + if (FlarialGUI::Toggle(11, toggleX, toggleY, this->settings.getSettingByName( + "hub")->value)) + this->settings.getSettingByName("hub")->value = !this->settings.getSettingByName( + "hub")->value; + + toggleY += Constraints::SpacingConstraint(0.35, textWidth); + FlarialGUI::FlarialTextWithFont(toggleX + Constraints::SpacingConstraint(0, textWidth), toggleY, L"Re-Q when you get a specific role (Hive)", textWidth * 6.9f, textHeight, DWRITE_TEXT_ALIGNMENT_LEADING, Constraints::SpacingConstraint(1.05, textWidth), diff --git a/src/Client/Module/Modules/AutoRQ/AutoRQListener.hpp b/src/Client/Module/Modules/AutoRQ/AutoRQListener.hpp index 3f3ba970..46e8e472 100644 --- a/src/Client/Module/Modules/AutoRQ/AutoRQListener.hpp +++ b/src/Client/Module/Modules/AutoRQ/AutoRQListener.hpp @@ -103,7 +103,7 @@ class AutoRQListener : public Listener { command_packet->InternalSource = true; SDK::clientInstance->getPacketSender()->sendToServer(command_packet); - + } //std::cout << pkt->mName << std::endl; } } @@ -291,28 +291,48 @@ class AutoRQListener : public Listener { std::string textToCheckToSilence = "You are connected"; if (pkt->message.find(textToCheck) != std::string::npos && triggered) { - std::string server = pkt->message.replace(0, textToCheck.length(), ""); - std::regex pattern("\\d+"); - std::string name = std::regex_replace(server, pattern, ""); - FlarialGUI::Notify("Preparing Q: " + name); - std::thread t([name]() { - std::this_thread::sleep_for(std::chrono::milliseconds(1000)); + if(!module->settings.getSettingByName("hub")->value){ + std::string server = pkt->message.replace(0, textToCheck.length(), ""); + std::regex pattern("\\d+"); + std::string name = std::regex_replace(server, pattern, ""); + FlarialGUI::Notify("Preparing Q: " + name); + std::thread t([name]() { + std::this_thread::sleep_for(std::chrono::milliseconds(1000)); + + FlarialGUI::Notify("Executing command /q " + name); + + std::shared_ptr packet = SDK::createPacket(77); + auto* command_packet = reinterpret_cast(packet.get()); + command_packet->command = "/q " + name; + + command_packet->origin.type = CommandOriginType::Player; + + command_packet->InternalSource = true; + SDK::clientInstance->getPacketSender()->sendToServer(command_packet); + }); + t.detach(); + triggered = false; + pkt->message = ""; + } + else{ + std::thread h([]() { + std::this_thread::sleep_for(std::chrono::milliseconds(1000)); + FlarialGUI::Notify("Executing command /hub"); + std::shared_ptr packet = SDK::createPacket(77); + auto* command_packet = reinterpret_cast(packet.get()); - FlarialGUI::Notify("Executing command /q " + name); + command_packet->command = "/hub"; - std::shared_ptr packet = SDK::createPacket(77); - auto* command_packet = reinterpret_cast(packet.get()); - command_packet->command = "/q " + name; + command_packet->origin.type = CommandOriginType::Player; - command_packet->origin.type = CommandOriginType::Player; - - command_packet->InternalSource = true; - SDK::clientInstance->getPacketSender()->sendToServer(command_packet); - }); - t.detach(); - triggered = false; - pkt->message = ""; + command_packet->InternalSource = true; + SDK::clientInstance->getPacketSender()->sendToServer(command_packet); + }); + h.detach(); + triggered = false; + pkt->message = ""; + } } else if (pkt->message.find(textToCheckToSilence) != std::string::npos) { event.cancel();