Skip to content

Commit b27f5b7

Browse files
authored
Merge pull request #1 from superboxes/main
[feature] insult people if they dont have roblox opened and make them open it
2 parents 8da8405 + d8666c1 commit b27f5b7

File tree

2 files changed

+39
-1
lines changed

2 files changed

+39
-1
lines changed

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
1-
build
1+
build
2+
.vscode

main.cpp

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
#include <windows.h>
77
#include <psapi.h>
88
#include <vector>
9+
#include <tlhelp32.h>
910

1011
constexpr COLORREF kTargetColor = RGB(43, 137, 254);
1112
constexpr DWORD kHotkeyId = 1;
@@ -217,6 +218,34 @@ void HandleCommands() {
217218
LogMessage("\nbye!");
218219
}
219220

221+
bool isRobloxOn() {
222+
HANDLE hProcessSnap;
223+
PROCESSENTRY32 pe32;
224+
225+
// Take a snapshot of all processes in the system.
226+
hProcessSnap = CreateToolhelp32Snapshot(TH32CS_SNAPPROCESS, 0);
227+
if (hProcessSnap == INVALID_HANDLE_VALUE) {
228+
return false;
229+
}
230+
231+
pe32.dwSize = sizeof(PROCESSENTRY32);
232+
233+
if (!Process32First(hProcessSnap, &pe32)) {
234+
CloseHandle(hProcessSnap); // clean the snapshot object
235+
return false;
236+
}
237+
238+
do {
239+
if (strcmp(pe32.szExeFile, "RobloxPlayerBeta.exe") == 0) {
240+
CloseHandle(hProcessSnap);
241+
return true;
242+
}
243+
} while (Process32Next(hProcessSnap, &pe32));
244+
245+
CloseHandle(hProcessSnap);
246+
return false;
247+
}
248+
220249
int main() {
221250
SetConsoleTitle(TEXT("auto-edger"));
222251
SetPriorityClass(GetCurrentProcess(), HIGH_PRIORITY_CLASS);
@@ -229,6 +258,14 @@ int main() {
229258
int screenHeight = GetSystemMetrics(SM_CYSCREEN);
230259
AccountForDifferentRes(screenWidth, screenHeight);
231260

261+
if (!isRobloxOn()) {
262+
LogMessage("warning: roblox is not running\nturn on roblox, dummy");
263+
264+
while (!isRobloxOn()) {
265+
std::this_thread::sleep_for(std::chrono::milliseconds(1000));
266+
}
267+
}
268+
232269
if (!RegisterHotKey(nullptr, kHotkeyId, 0, VK_F8)) {
233270
LogMessage("failed to register hotkey for f8. use 'autoedge' command to toggle");
234271
} else {

0 commit comments

Comments
 (0)