-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTrig.cpp
More file actions
52 lines (39 loc) · 1.11 KB
/
Copy pathTrig.cpp
File metadata and controls
52 lines (39 loc) · 1.11 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
#include "stdafx.h"
#include "Trig.h"
using namespace std;
MemUtil mem;
Trig::Trig()
{
}
Trig::~Trig()
{
}
bool Trig::initialize() {
if (mem.FindProcess()) {
if (mem.ClientModuleBaseAddress()) {
LOCAL_PLAYER = mem.GetLocalPlayer();
LOCAL_TEAM = mem.GetTeam(LOCAL_PLAYER);
LOCAL_POSITION = mem.GetPosition(LOCAL_PLAYER);
cout << "INFO: Trig::Initialize success" << endl;
cout << "INFO: LOCAL_TEAM = " << LOCAL_TEAM << endl;
return true;
}
}
cout << "ERR: Trig::initialize failed" << endl;
return false;
}
void Trig::activate() {
LOCAL_XHAIR = mem.GetCrossHair(LOCAL_PLAYER);
LOCAL_POSITION = mem.GetPosition(LOCAL_PLAYER);
TARGET_PLAYER = mem.GetTarget(LOCAL_XHAIR);
TARGET_HEALTH = mem.GetTargetHealth(TARGET_PLAYER);
TARGET_TEAM = mem.GetTeam(TARGET_PLAYER);
if (LOCAL_TEAM != TARGET_TEAM && TARGET_HEALTH > 0) {
input.type = INPUT_MOUSE;
input.mi.mouseData = 0;
input.mi.dwFlags = MOUSEEVENTF_LEFTDOWN;
SendInput(1, &input, sizeof(input));
input.mi.dwFlags = MOUSEEVENTF_LEFTUP;
SendInput(1, &input, sizeof(input));
}
}