Skip to content

Commit

Permalink
fixed scope check
Browse files Browse the repository at this point in the history
  • Loading branch information
ByteCorum committed Jul 28, 2024
1 parent 9b1a0ab commit edfe45a
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 3 deletions.
4 changes: 3 additions & 1 deletion DragonBurn/Features/Legitbot.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
#include <iostream>
#include "..\View.hpp"
#include "..\Features/RCS.h"
#include "TriggerBot.h"

extern "C" {
#include "..\Features\Mouse.h"
Expand Down Expand Up @@ -58,7 +59,8 @@ namespace AimControl
{
bool isScoped;
ProcessMgr.ReadMemory<bool>(Local.Pawn.Address + Offset::Pawn.isScoped, isScoped);
if (!isScoped) {
if (!isScoped and TriggerBot::CheckScopeWeapon(Local))
{
HasTarget = false;
return;
}
Expand Down
26 changes: 25 additions & 1 deletion DragonBurn/Features/TriggerBot.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ void TriggerBot::Run(const CEntity& LocalEntity)
{
bool isScoped;
ProcessMgr.ReadMemory<bool>(LocalEntity.Pawn.Address + Offset::Pawn.isScoped, isScoped);
if (!isScoped)
if (!isScoped and CheckScopeWeapon(LocalEntity))
{
return;
}
Expand Down Expand Up @@ -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<DWORD>(LocalEntity.Pawn.Address + Offset::Pawn.iIDEntIndex, uHandle) || uHandle == -1) {
CrosshairsCFG::isAim = false;
Expand Down
1 change: 1 addition & 0 deletions DragonBurn/Features/TriggerBot.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,5 @@ namespace TriggerBot
// Triggerbot
void Run(const CEntity& LocalEntity);
void TargetCheck(const CEntity& LocalEntity) noexcept;
bool CheckScopeWeapon(const CEntity& LocalEntity);
}
1 change: 0 additions & 1 deletion todo.txt
Original file line number Diff line number Diff line change
@@ -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)
Expand Down

0 comments on commit edfe45a

Please sign in to comment.