diff --git a/DragonBurn/Features/Legitbot.hpp b/DragonBurn/Features/Legitbot.hpp index f768a33..123d1a7 100644 --- a/DragonBurn/Features/Legitbot.hpp +++ b/DragonBurn/Features/Legitbot.hpp @@ -10,6 +10,7 @@ #include #include "..\View.hpp" #include "..\Features/RCS.h" +#include "TriggerBot.h" extern "C" { #include "..\Features\Mouse.h" @@ -58,7 +59,8 @@ namespace AimControl { bool isScoped; ProcessMgr.ReadMemory(Local.Pawn.Address + Offset::Pawn.isScoped, isScoped); - if (!isScoped) { + if (!isScoped and TriggerBot::CheckScopeWeapon(Local)) + { HasTarget = false; return; } diff --git a/DragonBurn/Features/TriggerBot.cpp b/DragonBurn/Features/TriggerBot.cpp index cb5ae49..d9db2f0 100644 --- a/DragonBurn/Features/TriggerBot.cpp +++ b/DragonBurn/Features/TriggerBot.cpp @@ -38,7 +38,7 @@ void TriggerBot::Run(const CEntity& LocalEntity) { bool isScoped; ProcessMgr.ReadMemory(LocalEntity.Pawn.Address + Offset::Pawn.isScoped, isScoped); - if (!isScoped) + if (!isScoped and CheckScopeWeapon(LocalEntity)) { return; } @@ -75,6 +75,30 @@ void TriggerBot::Run(const CEntity& LocalEntity) } } +bool TriggerBot::CheckScopeWeapon(const CEntity& LocalEntity) +{ + DWORD64 WeaponNameAddress = 0; + char Buffer[256]{}; + + WeaponNameAddress = ProcessMgr.TraceAddress(LocalEntity.Pawn.Address + Offset::Pawn.pClippingWeapon, { 0x10,0x20 ,0x0 }); + if (WeaponNameAddress == 0) + return false; + + DWORD64 CurrentWeapon; + short weaponIndex; + ProcessMgr.ReadMemory(LocalEntity.Pawn.Address + Offset::Pawn.pClippingWeapon, CurrentWeapon); + ProcessMgr.ReadMemory(CurrentWeapon + Offset::EconEntity.AttributeManager + Offset::WeaponBaseData.Item + Offset::WeaponBaseData.ItemDefinitionIndex, weaponIndex); + + if (weaponIndex == -1) + return false; + + std::string WeaponName = CEntity::GetWeaponName(weaponIndex); + if (WeaponName == "aug" or WeaponName == "awp" or WeaponName == "g3Sg1" or WeaponName == "sg556" or WeaponName == "ssg08" or WeaponName == "scar20") + return true; + else + return false; +} + void TriggerBot::TargetCheck(const CEntity& LocalEntity) noexcept { if (!ProcessMgr.ReadMemory(LocalEntity.Pawn.Address + Offset::Pawn.iIDEntIndex, uHandle) || uHandle == -1) { CrosshairsCFG::isAim = false; diff --git a/DragonBurn/Features/TriggerBot.h b/DragonBurn/Features/TriggerBot.h index 68f714a..1d1a435 100644 --- a/DragonBurn/Features/TriggerBot.h +++ b/DragonBurn/Features/TriggerBot.h @@ -25,4 +25,5 @@ namespace TriggerBot // Triggerbot void Run(const CEntity& LocalEntity); void TargetCheck(const CEntity& LocalEntity) noexcept; + bool CheckScopeWeapon(const CEntity& LocalEntity); } \ No newline at end of file diff --git a/todo.txt b/todo.txt index 995ef5f..c5cc2f5 100644 --- a/todo.txt +++ b/todo.txt @@ -1,7 +1,6 @@ ○ Refactor the code(I have no time for it) ○ Make cheat multi-tread(I have no time for it) ○ Add bhop -○ Fix scope check ○ Add spec list ○ Use JSON instead YAML ○ Make menu looks nice(low priority)