#include #include #include // Global değişkenler bool isRightClickPressed = false; // Fare işlemi için hook fonksiyonu LRESULT CALLBACK MouseHookProc(int nCode, WPARAM wParam, LPARAM lParam) { if (nCode >= 0) { if (wParam == WM_RBUTTONDOWN) { isRightClickPressed = true; } else if (wParam == WM_RBUTTONUP) { isRightClickPressed = false; } } return CallNextHookEx(NULL, nCode, wParam, lParam); } // Pozisyon okuma fonksiyonu (oyunun bellek adresinden okuma) struct Vec3 { float x, y, z; }; HANDLE hProcess = NULL; uintptr_t baseAddress = 0x12345678; // Bellek adresi // burayı bulamadım aq Vec3 ReadPlayerPosition(uintptr_t address) { Vec3 position; ReadProcessMemory(hProcess, (BYTE*)address, &position, sizeof(Vec3), nullptr); return position; } // Fare hareketi için smoothing void SmoothAim(Vec2 myPos, Vec2 enemyPos, float smoothingFactor) { float deltaX = (enemyPos.x - myPos.x) / smoothingFactor; float deltaY = (enemyPos.y - myPos.y) / smoothingFactor; SetCursorPos((int)(myPos.x + deltaX), (int)(myPos.y + deltaY)); } // Nişan alma fonksiyonu void AimAtTargetSmooth(Vec2 myPos, Vec2 enemyPos, float smoothingFactor) { if (isRightClickPressed) { SmoothAim(myPos, enemyPos, smoothingFactor); } } int main() { // Oyun işleminin ID'sini bul ve handle'ı al DWORD processId = 1234; // Oyunun işlem kimliği hProcess = OpenProcess(PROCESS_ALL_ACCESS, FALSE, processId); if (hProcess) { // Mouse hook işlemi HHOOK mouseHook = SetWindowsHookEx(WH_MOUSE_LL, MouseHookProc, NULL, 0); // Test pozisyonlar Vec2 myPos = { 500, 500 }; Vec2 enemyPos = { 700, 300 }; // Mesaj döngüsü MSG msg; while (GetMessage(&msg, NULL, 0, 0)) { // Bellekten sürekli pozisyon okuma Vec3 enemyHead = ReadPlayerPosition(baseAddress); // pozisyon güncelleme işi enemyPos.x = enemyHead.x; // x pozisyonu güncelle enemyPos.y = enemyHead.y; // y pozisyonu güncelle AimAtTargetSmooth(myPos, enemyPos, 5.0f); // SmoothingFactor: 5.0 TranslateMessage(&msg); DispatchMessage(&msg); } UnhookWindowsHookEx(mouseHook); } else { std::cout << "Failed to open process!" << std::endl; } return 0; }