This repository has been archived by the owner on Sep 12, 2023. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 14
/
DashTASBot.cpp
85 lines (82 loc) · 2.91 KB
/
DashTASBot.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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
#include <cstdio>
#include <string>
#include <vector>
#include <chrono>
#include <thread>
#include <windows.h>
#include "..\Pizzabot-v4-master\public.h"
#include "..\Pizzabot-v4-master\vjoyinterface.h"
#include "HAPIH.h"
const std::vector<std::string> levels = {
"StereoMadness.dbj",
"BackOnTrack.dbj",
"Polargeist.dbj",
"DryOut.dbj",
"BaseAfterBase.dbj",
"CantLetGo.dbj",
"Jumper.dbj",
"TimeMachine.dbj"
};
void sendKey(bool up) {
/*INPUT i;
memset(&i, 0, sizeof(i));
i.type = INPUT_KEYBOARD;
i.ki.wVk = VK_RIGHT;
i.ki.wScan = 0x4d;
i.ki.dwFlags = (up ? KEYEVENTF_KEYUP : 0) | KEYEVENTF_SCANCODE;
i.ki.time = 0;
i.ki.dwExtraInfo = NULL;
SendInput(1, &i, sizeof(i));
if ((up && GetAsyncKeyState(VK_RIGHT)) || (!up && !GetAsyncKeyState(VK_RIGHT))) std::cerr << "Could not press!\n";*/
if (!SetDiscPov(up ? -1 : 1, 1, 1)) printf("Error\n");
}
int main() {
std::cout << "Geometry Dash TASBot by JackMacWindows\nPowered by DashBot 3.0\nAll jump maps were generated by DashBot.\n";
HackIH GD;
GD.bind("GeometryDash.exe");
if (!vJoyEnabled()) {
std::cerr << "vJoy not available.\n";
return 2;
}
if (!AcquireVJD(1)) {
std::cerr << "Could not acquire vJoy device.\n";
return 3;
}
std::cout << "Starting in 3...";
std::this_thread::sleep_for(std::chrono::seconds(1));
std::cout << " 2...";
std::this_thread::sleep_for(std::chrono::seconds(1));
std::cout << " 1...";
std::this_thread::sleep_for(std::chrono::seconds(1));
std::cout << "\n";
void* tmp = malloc(4);
std::chrono::system_clock::time_point start = std::chrono::system_clock::now();
for (int i = 0; i < levels.size(); i++) {
std::cout << "Playing level: " << levels[i] << "\n";
keybd_event(VK_RETURN, 0x1c, 0, NULL);
Sleep(75);
keybd_event(VK_RETURN, 0x1c, KEYEVENTF_KEYUP, NULL);
system(std::string("dashbot_player.exe " + levels[i]).c_str());
if (i < levels.size() - 1) {
std::cout << "Menuing... ";
while (GD.ReadRaw({ GD.BaseAddress , 0x3222D0 , 0x164, 0x224, 0x67C }, tmp, 4)) {
keybd_event(VK_ESCAPE, 0x01, 0, NULL);
Sleep(25);
keybd_event(VK_ESCAPE, 0x01, KEYEVENTF_KEYUP, NULL);
Sleep(25);
}
Sleep(25);
//keybd_event(VK_RIGHT, MapVirtualKey(LOBYTE(VkKeyScan(VK_RIGHT)), 0), 0, NULL);
sendKey(false);
Sleep(25);
sendKey(true);
//keybd_event(VK_RIGHT, MapVirtualKey(LOBYTE(VkKeyScan(VK_RIGHT)), 0), KEYEVENTF_KEYUP, NULL);
Sleep(25);
std::cout << "Done.\n";
}
}
std::cout << "Run complete! Total time (with loads): " << std::chrono::duration_cast<std::chrono::seconds>(std::chrono::system_clock::now() - start).count() / 60.0 << "\n";
free(tmp);
RelinquishVJD(1);
return 0;
}