-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
11 changed files
with
118 additions
and
91 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
#pragma once | ||
#include "Game.h" | ||
#include "Entity.h" | ||
#include "MenuConfig.hpp" | ||
#include <chrono> | ||
|
||
namespace TriggerBot | ||
{ | ||
inline DWORD TriggerDelay = 90; // ms | ||
inline int HotKey = VK_LMENU; | ||
inline std::vector<int> HotKeyList{ VK_LMENU, VK_RBUTTON, VK_XBUTTON1, VK_XBUTTON2, VK_CAPITAL, VK_LSHIFT, VK_LCONTROL }; | ||
|
||
inline void SetHotKey(int Index) | ||
{ | ||
HotKey = HotKeyList.at(Index); | ||
} | ||
|
||
inline void Run(const CEntity& LocalEntity) | ||
{ | ||
DWORD uHandle = 0; | ||
if (!ProcessMgr.ReadMemory<DWORD>(LocalEntity.Pawn.Address + Offset::Pawn.iIDEntIndex, uHandle)) | ||
return; | ||
if (uHandle == -1) | ||
return; | ||
|
||
DWORD64 ListEntry = 0; | ||
ListEntry = ProcessMgr.TraceAddress(gGame.GetEntityListAddress(), { 0x8 * (uHandle >> 9) + 0x10,0x0 }); | ||
if (ListEntry == 0) | ||
return; | ||
|
||
DWORD64 PawnAddress = 0; | ||
if (!ProcessMgr.ReadMemory<DWORD64>(ListEntry + 0x78 * (uHandle & 0x1FF), PawnAddress)) | ||
return; | ||
|
||
CEntity Entity; | ||
if (!Entity.UpdatePawn(PawnAddress)) | ||
return; | ||
|
||
bool AllowShoot = false; | ||
|
||
if (MenuConfig::TeamCheck) | ||
AllowShoot = LocalEntity.Pawn.TeamID != Entity.Pawn.TeamID && Entity.Pawn.Health > 0; | ||
else | ||
AllowShoot = Entity.Pawn.Health > 0; | ||
|
||
if (AllowShoot) | ||
{ | ||
static std::chrono::time_point LastTimePoint = std::chrono::steady_clock::now(); | ||
auto CurTimePoint = std::chrono::steady_clock::now(); | ||
if (CurTimePoint - LastTimePoint >= std::chrono::milliseconds(TriggerDelay)) | ||
{ | ||
mouse_event(MOUSEEVENTF_LEFTDOWN, 0, 0, 0, 0); | ||
mouse_event(MOUSEEVENTF_LEFTUP, 0, 0, 0, 0); | ||
LastTimePoint = CurTimePoint; | ||
} | ||
} | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters