-
Автор темы
- #1
Всем привет, не могли бы вы мне помочь с авто ацептом?
Я это спастил, но не робит, проблема в функции, что не так?
C++:
void misc::auto_accept() //change
{
if (!g_cfg.misc.auto_accept)
return;
static auto SetLocalPlayerReadyFn = reinterpret_cast<bool(__stdcall*)(const char*)>(util::find_pattern("client_panorama.dll", "55 8B EC 83 E4 F8 8B 4D 08 BA ? ? ? ? E8 ? ? ? ? 85 C0 75 12", 0));
HWND Hwnd;
if ((Hwnd = FindWindow(NULL, "Counter-Strike: Global Offensive")) && GetForegroundWindow() == Hwnd) // Gets the csgo window and checks if the active window is csgos window // EDIT: Changed from Valve001 to Counter-Strike: Global Offensive.
{
RECT lprect;
GetClientRect(Hwnd, &lprect); // Gets the resolution of the window
SendMessage(Hwnd, WM_MOUSEMOVE, 0, MAKELPARAM(lprect.right / 2, lprect.bottom / 2)); // Moves the mouse into the middle of the window
mouse_event(MOUSEEVENTF_LEFTDOWN | MOUSEEVENTF_LEFTUP, 0, 0, 0, 0); // click
}
if (SetLocalPlayerReadyFn)
SetLocalPlayerReadyFn(""); // Calling with "" because then it accepts everytime. Calling it with "deferred" dont always work.
}