Skip to content

Commit

Permalink
Option to use /hub instead of /q + better explanation for solo mode (#19
Browse files Browse the repository at this point in the history
)
  • Loading branch information
St0neHunter authored Aug 7, 2024
1 parent 7e8cafb commit 0d82e69
Show file tree
Hide file tree
Showing 2 changed files with 67 additions and 19 deletions.
28 changes: 28 additions & 0 deletions src/Client/Module/Modules/AutoRQ/AutoRQ.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@ class AutoRQ : public Module {
settings.addSetting("command", (std::string)"");
if (settings.getSettingByName<bool>("solo") == nullptr)
settings.addSetting("solo", false);
if (settings.getSettingByName<bool>("hub") == nullptr)
settings.addSetting("hub", false);
if (settings.getSettingByName<bool>("murderer") == nullptr)
settings.addSetting("murderer", false);
if (settings.getSettingByName<bool>("sheriff") == nullptr)
Expand Down Expand Up @@ -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),
Expand All @@ -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<bool>(
"hub")->value))
this->settings.getSettingByName<bool>("hub")->value = !this->settings.getSettingByName<bool>(
"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),
Expand Down
58 changes: 39 additions & 19 deletions src/Client/Module/Modules/AutoRQ/AutoRQListener.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ class AutoRQListener : public Listener {
command_packet->InternalSource = true;

SDK::clientInstance->getPacketSender()->sendToServer(command_packet);

} //std::cout << pkt->mName << std::endl;
}
}
Expand Down Expand Up @@ -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<bool>("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> packet = SDK::createPacket(77);
auto* command_packet = reinterpret_cast<CommandRequestPacket*>(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> packet = SDK::createPacket(77);
auto* command_packet = reinterpret_cast<CommandRequestPacket*>(packet.get());

FlarialGUI::Notify("Executing command /q " + name);
command_packet->command = "/hub";

std::shared_ptr<Packet> packet = SDK::createPacket(77);
auto* command_packet = reinterpret_cast<CommandRequestPacket*>(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();
Expand Down

0 comments on commit 0d82e69

Please sign in to comment.