Skip to content

Commit

Permalink
https://github.com/users/ByteCorum/projects/1?pane=issue&itemId=80642424
Browse files Browse the repository at this point in the history
  • Loading branch information
ByteCorum committed Sep 24, 2024
1 parent 7390124 commit 9c3faa9
Show file tree
Hide file tree
Showing 12 changed files with 149 additions and 41 deletions.
19 changes: 11 additions & 8 deletions DragonBurn/Config/ConfigMenu.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
#include <string>
#include "../Resources/Language.hpp"
#include "../Features/RCS.h"
#include "../Helpers/KeyManager.h"

namespace ConfigMenu {

Expand Down Expand Up @@ -64,8 +65,8 @@ namespace ConfigMenu {
ImGui::OpenPopup("##reallyDelete");
if (ImGui::BeginPopup("##reallyDelete"))
{
ImGui::TextUnformatted(" Are you sure? ");
ImGui::TextUnformatted(" ");
ImGui::Text(" Are you sure? ");
ImGui::Text(" ");
ImGui::SameLine();
if (ImGui::Button("No", { 40.0f, 0.0f }))
ImGui::CloseCurrentPopup();
Expand All @@ -89,8 +90,8 @@ namespace ConfigMenu {
ImGui::OpenPopup("##reallyReset");
if (ImGui::BeginPopup("##reallyReset"))
{
ImGui::TextUnformatted(" Are you sure? ");
ImGui::TextUnformatted(" ");
ImGui::Text(" Are you sure? ");
ImGui::Text(" ");
ImGui::SameLine();
if (ImGui::Button("No", { 40.0f, 0.0f }))
ImGui::CloseCurrentPopup();
Expand Down Expand Up @@ -190,6 +191,8 @@ namespace ConfigMenu {

LegitBotConfig::TriggerBot = true;
LegitBotConfig::TriggerAlways = false;
TriggerBot::HotKey = 6;
Text::Trigger::HotKey = KeyMgr::GetKeyName(TriggerBot::HotKey);

MenuConfig::TeamCheck = true;
MenuConfig::BypassOBS = false;
Expand All @@ -198,8 +201,8 @@ namespace ConfigMenu {
MiscCFG::ShowHeadShootLine = false;
MiscCFG::HeadShootLineColor = ImColor(131, 137, 150, 200);

LegitBotConfig::AimBotHotKey = 3;
AimControl::SetHotKey(LegitBotConfig::AimBotHotKey);
AimControl::HotKey = 1;
Text::Aimbot::HotKey = KeyMgr::GetKeyName(AimControl::HotKey);
AimControl::AimFov = 10;
AimControl::AimFovMin = 0.4f;
AimControl::Smooth = 5.0f;
Expand All @@ -210,8 +213,6 @@ namespace ConfigMenu {
TriggerBot::ShotDuration = 400;

RCS::RCSBullet = 1;
LegitBotConfig::TriggerHotKey = 4;
TriggerBot::SetHotKey(LegitBotConfig::TriggerHotKey);

RCS::RCSScale = ImVec2(1.4f, 1.4f);
AimControl::ScopeOnly = true;
Expand Down Expand Up @@ -261,5 +262,7 @@ namespace ConfigMenu {
MenuConfig::RadarWinChengePos = true;
MenuConfig::SpecWinChengePos = true;

MenuConfig::HotKey = VK_END;

}
}
16 changes: 10 additions & 6 deletions DragonBurn/Config/ConfigSaver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
#include "../Features/TriggerBot.h"
#include "../Features/Aimbot.h"
#include "../Features/RCS.h"
#include "../Helpers/KeyManager.h"
#include <json.hpp>

using json = nlohmann::json;
Expand Down Expand Up @@ -148,7 +149,7 @@ namespace MyConfigSaver

ConfigData["Aimbot"]["Enable"]= LegitBotConfig::AimBot;
ConfigData["Aimbot"]["ToggleMode"]= LegitBotConfig::AimToggleMode;
ConfigData["Aimbot"]["Hotkey"]= LegitBotConfig::AimBotHotKey;
ConfigData["Aimbot"]["Hotkey"]= AimControl::HotKey;
ConfigData["Aimbot"]["AimBullet"]= AimControl::AimBullet;
ConfigData["Aimbot"]["Fov"]= AimControl::AimFov;
ConfigData["Aimbot"]["FovMin"]= AimControl::AimFovMin;
Expand All @@ -175,7 +176,7 @@ namespace MyConfigSaver


ConfigData["Triggerbot"]["Enable"]= LegitBotConfig::TriggerBot;
ConfigData["Triggerbot"]["Hotkey"]= LegitBotConfig::TriggerHotKey;
ConfigData["Triggerbot"]["Hotkey"]= TriggerBot::HotKey;
ConfigData["Triggerbot"]["Delay"]= TriggerBot::TriggerDelay;
ConfigData["Triggerbot"]["FakeShot"]= TriggerBot::ShotDuration;
ConfigData["Triggerbot"]["ScopeOnly"]= TriggerBot::ScopeOnly;
Expand Down Expand Up @@ -213,6 +214,7 @@ namespace MyConfigSaver

ConfigData["Misc"]["TeamCheck"]= MenuConfig::TeamCheck;
ConfigData["Misc"]["AntiRecord"]= MenuConfig::BypassOBS;
ConfigData["Misc"]["MenuKey"] = MenuConfig::HotKey;

ConfigData["MenuConfig"]["MarkWinPos"]["x"] = MenuConfig::MarkWinPos.x;
ConfigData["MenuConfig"]["MarkWinPos"]["y"] = MenuConfig::MarkWinPos.y;
Expand Down Expand Up @@ -371,7 +373,7 @@ namespace MyConfigSaver
{
LegitBotConfig::AimBot = ReadData(ConfigData["Aimbot"],{"Enable"}, false);
LegitBotConfig::AimToggleMode = ReadData(ConfigData["Aimbot"],{"ToggleMode"}, false);
LegitBotConfig::AimBotHotKey = ReadData(ConfigData["Aimbot"],{"Hotkey"}, 0);
AimControl::HotKey = ReadData(ConfigData["Aimbot"],{"Hotkey"}, 0);
AimControl::AimBullet = ReadData(ConfigData["Aimbot"],{"AimBullet"}, 0);
AimControl::AimFov = ReadData(ConfigData["Aimbot"],{"Fov"}, 5.f);
AimControl::AimFovMin = ReadData(ConfigData["Aimbot"],{"FovMin"}, .5f);
Expand All @@ -385,7 +387,7 @@ namespace MyConfigSaver
LegitBotConfig::VisibleCheck = ReadData(ConfigData["Aimbot"],{"VisibleCheck"}, true);
AimControl::IgnoreFlash = ReadData(ConfigData["Aimbot"],{"IgnoreFlash"}, false);
AimControl::ScopeOnly = ReadData(ConfigData["Aimbot"],{"ScopeOnly"}, false);
AimControl::SetHotKey(LegitBotConfig::AimBotHotKey);
Text::Aimbot::HotKey = KeyMgr::GetKeyName(AimControl::HotKey);
LegitBotConfig::HitboxUpdated = false;
}

Expand All @@ -400,13 +402,13 @@ namespace MyConfigSaver
if (ConfigData.contains("Triggerbot"))
{
LegitBotConfig::TriggerBot = ReadData(ConfigData["Triggerbot"],{"Enable"}, false);
LegitBotConfig::TriggerHotKey = ReadData(ConfigData["Triggerbot"],{"Hotkey"}, 0);
TriggerBot::HotKey = ReadData(ConfigData["Triggerbot"],{"Hotkey"}, 6);
TriggerBot::TriggerDelay = ReadData(ConfigData["Triggerbot"],{"Delay"}, 20);
TriggerBot::ShotDuration = ReadData(ConfigData["Triggerbot"],{"FakeShot"}, 200);
TriggerBot::ScopeOnly = ReadData(ConfigData["Triggerbot"],{"ScopeOnly"}, false);
TriggerBot::IgnoreFlash = ReadData(ConfigData["Triggerbot"],{"IgnoreFlash"}, false);
LegitBotConfig::TriggerAlways = ReadData(ConfigData["Triggerbot"],{"AutoMode"}, false);
TriggerBot::SetHotKey(LegitBotConfig::TriggerHotKey);
Text::Trigger::HotKey = KeyMgr::GetKeyName(TriggerBot::HotKey);
}

if (ConfigData.contains("Misc"))
Expand Down Expand Up @@ -435,6 +437,8 @@ namespace MyConfigSaver
MiscCFG::SniperCrosshairColor.Value.w = ReadData(ConfigData["Misc"], { "SniperCrosshairColor","a" }, 255.f);
MenuConfig::TeamCheck = ReadData(ConfigData["Misc"],{"TeamCheck"}, true);
MenuConfig::BypassOBS = ReadData(ConfigData["Misc"],{"AntiRecord"}, false);
MenuConfig::HotKey = ReadData(ConfigData["Misc"], { "MenuKey" }, VK_END);
Text::Misc::HotKey = KeyMgr::GetKeyName(MenuConfig::HotKey);
}

if (ConfigData.contains("MenuConfig"))
Expand Down
2 changes: 1 addition & 1 deletion DragonBurn/Core/Cheats.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@ void Menu()
{
std::chrono::time_point<std::chrono::system_clock> now = std::chrono::system_clock::now();
std::chrono::duration<double, std::milli> difference = now - timepoint;
SHORT keyState = GetAsyncKeyState(VK_END);
SHORT keyState = GetAsyncKeyState(MenuConfig::HotKey);
if (keyState & 0x8000) {
keyWasPressed = true;
}
Expand Down
3 changes: 1 addition & 2 deletions DragonBurn/Core/Config.h
Original file line number Diff line number Diff line change
Expand Up @@ -44,14 +44,14 @@ namespace MenuConfig
inline bool RadarWinChengePos = false;
inline bool SpecWinChengePos = false;
inline bool BombWinChengePos = false;
inline int HotKey = VK_END;
}

namespace LegitBotConfig
{
inline bool AimBot = true;
inline bool AimAlways = false;
inline bool AimToggleMode = false;
inline int AimBotHotKey = 3;
// 0: head 1: neck 3: spine
inline int AimPosition = 0;
inline DWORD AimPositionIndex = BONEINDEX::head;
Expand All @@ -64,7 +64,6 @@ namespace LegitBotConfig

inline bool TriggerBot = true;
inline bool TriggerAlways = false;
inline int TriggerHotKey = 4;

inline bool RCS = false;

Expand Down
29 changes: 21 additions & 8 deletions DragonBurn/Core/GUI.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@

#include "..\Resources\Language.hpp"
#include "..\Resources\Images.hpp"
#include "../Helpers/KeyManager.h"

ID3D11ShaderResourceView* Logo = NULL;
ID3D11ShaderResourceView* MenuButton1 = NULL;
Expand Down Expand Up @@ -426,11 +427,12 @@ namespace GUI
ImGui::SetCursorPosX(ImGui::GetCursorPosX() + 10.f);
ImGui::TextDisabled(Text::Aimbot::HotKeyList.c_str());
ImGui::SameLine();
AlignRight(160.f);
ImGui::SetNextItemWidth(160.f);
if (ImGui::Combo("###AimKey", &LegitBotConfig::AimBotHotKey, "LALT\0LBUTTON\0RBUTTON\0XBUTTON1\0XBUTTON2\0CAPITAL\0SHIFT\0CONTROL\0"))
AlignRight(70.f);
if (ImGui::Button(Text::Aimbot::HotKey.c_str(), { 70.f, 25.f }))
{
AimControl::SetHotKey(LegitBotConfig::AimBotHotKey);
std::thread([&]() {
KeyMgr::GetPressedKey(AimControl::HotKey, Text::Aimbot::HotKey);
}).detach();
}
PutSliderInt(Text::Aimbot::BulletSlider.c_str(), 10.f, &AimControl::AimBullet, &BulletMin, &BulletMax, "%d");
PutSwitch(Text::Aimbot::Toggle.c_str(), 10.f, ImGui::GetFrameHeight() * 1.7, &LegitBotConfig::AimToggleMode);
Expand Down Expand Up @@ -561,6 +563,7 @@ namespace GUI
ImGui::SeparatorText("Triggerbot");
int DelayMin = 0, DelayMax = 300;
int DurationMin = 0, DurationMax = 1000;

PutSwitch(Text::Trigger::Enable.c_str(), 5.f, ImGui::GetFrameHeight() * 1.7, &LegitBotConfig::TriggerBot);
if (LegitBotConfig::TriggerBot)
{
Expand All @@ -569,11 +572,12 @@ namespace GUI
ImGui::SetCursorPosX(ImGui::GetCursorPosX() + 5.f);
ImGui::TextDisabled(Text::Trigger::HotKeyList.c_str());
ImGui::SameLine();
AlignRight(160.f);
ImGui::SetNextItemWidth(160.f);
if (ImGui::Combo("###TriggerbotKey", &LegitBotConfig::TriggerHotKey, "LALT\0RBUTTON\0XBUTTON1\0XBUTTON2\0CAPITAL\0SHIFT\0CONTROL\0"))
AlignRight(70.f);
if (ImGui::Button(Text::Trigger::HotKey.c_str(), {70.f, 25.f}))
{
TriggerBot::SetHotKey(LegitBotConfig::TriggerHotKey);
std::thread([&]() {
KeyMgr::GetPressedKey(TriggerBot::HotKey, Text::Trigger::HotKey);
}).detach();
}
}
PutSwitch(Text::Trigger::Toggle.c_str(), 5.f, ImGui::GetFrameHeight() * 1.7, &LegitBotConfig::TriggerAlways);
Expand Down Expand Up @@ -612,6 +616,15 @@ namespace GUI
ImGui::NextColumn();
ImGui::SetCursorPosY(24.f);
ImGui::SeparatorText("Global Settings");
ImGui::TextDisabled(Text::Misc::MenuKey.c_str());
ImGui::SameLine();
AlignRight(70.f);
if (ImGui::Button(Text::Misc::HotKey.c_str(), { 70.f, 25.f }))
{
std::thread([&]() {
KeyMgr::GetPressedKey(MenuConfig::HotKey, Text::Misc::HotKey);
}).detach();
}
PutSwitch(Text::Misc::SpecCheck.c_str(), 5.f, ImGui::GetFrameHeight() * 1.7, &MenuConfig::WorkInSpec);
PutSwitch(Text::Misc::TeamCheck.c_str(), 5.f, ImGui::GetFrameHeight() * 1.7, &MenuConfig::TeamCheck);
PutSwitch(Text::Misc::AntiRecord.c_str(), 5.f, ImGui::GetFrameHeight() * 1.7, &MenuConfig::BypassOBS);
Expand Down
1 change: 1 addition & 0 deletions DragonBurn/DragonBurn.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,7 @@
<ClInclude Include="Game\View.h" />
<ClInclude Include="Helpers\Format.h" />
<ClInclude Include="Helpers\GetWeaponIcon.h" />
<ClInclude Include="Helpers\KeyManager.h" />
<ClInclude Include="Helpers\Logger.h" />
<ClInclude Include="Helpers\Mouse.h" />
<ClInclude Include="Helpers\WebApi.h" />
Expand Down
1 change: 1 addition & 0 deletions DragonBurn/DragonBurn.vcxproj.filters
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,7 @@
<ClInclude Include="Core\Config.h">
<Filter>Core</Filter>
</ClInclude>
<ClInclude Include="Helpers\KeyManager.h" />
</ItemGroup>
<ItemGroup>
<Image Include="icon.ico">
Expand Down
6 changes: 0 additions & 6 deletions DragonBurn/Features/Aimbot.cpp
Original file line number Diff line number Diff line change
@@ -1,11 +1,5 @@
#include "Aimbot.h"


void AimControl::SetHotKey(int Index)
{
HotKey = HotKeyList.at(Index);
}

void AimControl::switchToggle()
{
LegitBotConfig::AimAlways = !LegitBotConfig::AimAlways;
Expand Down
4 changes: 1 addition & 3 deletions DragonBurn/Features/Aimbot.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,19 +20,17 @@ extern "C" {

namespace AimControl
{
inline int HotKey = VK_XBUTTON1;
inline int HotKey = VK_LBUTTON;
inline int AimBullet = 1;
inline bool ScopeOnly = true;
inline bool IgnoreFlash = false;
inline float AimFov = 10;
inline float AimFovMin = 0.4f;
inline float Smooth = 5.0f;
inline std::vector<int> HitboxList{ BONEINDEX::head };
inline std::vector<int> HotKeyList{ VK_LMENU, VK_LBUTTON, VK_RBUTTON, VK_XBUTTON1, VK_XBUTTON2, VK_CAPITAL, VK_LSHIFT, VK_LCONTROL };
inline bool HasTarget = false;


void AimBot(const CEntity& Local, Vec3 LocalPos, std::vector<Vec3>& AimPosList);
void switchToggle();
void SetHotKey(int Index);
}
8 changes: 1 addition & 7 deletions DragonBurn/Features/TriggerBot.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,18 +11,12 @@ namespace TriggerBot
inline int ShotDuration = 400; // ms
inline bool ScopeOnly = true;
inline bool IgnoreFlash = false;
inline int HotKey = VK_CAPITAL;
inline std::vector<int> HotKeyList{VK_LMENU, VK_RBUTTON, VK_XBUTTON1, VK_XBUTTON2, VK_CAPITAL, VK_LSHIFT, VK_LCONTROL};
inline int HotKey = VK_XBUTTON2;
inline std::chrono::time_point<std::chrono::system_clock> timepoint = std::chrono::system_clock::now();
inline std::chrono::time_point<std::chrono::system_clock> startTime = std::chrono::system_clock::now();
inline bool recorded = false;
inline bool VisibleCheck = true;

inline void SetHotKey(int Index)
{
HotKey = HotKeyList.at(Index);
}

// Triggerbot
void Run(const CEntity& LocalEntity);
//void TargetCheck(const CEntity& LocalEntity) noexcept;
Expand Down
Loading

0 comments on commit 9c3faa9

Please sign in to comment.