-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathAutoClicker.cpp
44 lines (30 loc) · 905 Bytes
/
AutoClicker.cpp
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
#include "AutoClicker.h"
AutoClicker::AutoClicker() : AbstractModule("AutoClicker", Category::Combat) {
EventManager::getInstance().reg(Event::EventRenderOverlay, MakeHandler(this, &AutoClicker::onRenderOverlay));
}
AutoClicker* AutoClicker::getInstance() {
static AutoClicker* inst = new AutoClicker();
return inst;
}
void AutoClicker::onEnabled() {
this->cpsTimer.reset();
}
void AutoClicker::onDisabled() {
}
void AutoClicker::onRenderOverlay() {
ToggleCheck;
IngameCheck;
if (ClickGui::getInstance()->getToggle()) return;
if (GetForegroundWindow() != Client::wndGame) return;
#ifdef _DEBUG
ImGui::Begin("AutoClicker");
ImGui::SliderInt("CPS", &(this->cps), 0, 15);
ImGui::End();
#endif
if (Client::rendererIO->MouseDownDuration[ImGuiMouseButton_Middle] > 0) {
if (this->cpsTimer.elapsed(1000 / this->cps)) {
Simulator::mlclick(20);
this->cpsTimer.reset();
}
}
}