// ConsoleApplication1.cpp: define el punto de entrada de la aplicación de consola.
//

#include "stdafx.h"
#include <windows.h>
#include <cstdlib>
#include <iostream>


int _tmain(int argc, _TCHAR* argv[])
{
return 0;
}


using namespace std;

int main(int argc, char* argv[]) {
int delay = 0;
int positions = 0;
POINT cursorPos[256];
SetConsoleTitleA("Autoclicker C++ By Recofast2");
cout << "Bienvenido a Autoclicker Recofast2!\n";
cout << "Elija Intervalo que desea: ";
cin >> delay;
cout << "1. Graba las coordenadas con F1\n";
cout << "2. Presiona F2 Para Activarlo\nEsperando la activacion...\n";
for(;; Sleep(200)) {
if(GetAsyncKeyState(VK_F1)) {
GetCursorPos(&cursorPos[positions]);
cout << "Posicion Adquirida" << positions + 1 << ": " << cursorPos[positions].x << ' ' << cursorPos[positions].y << '\n';
positions += 1;
}
if(GetAsyncKeyState(VK_F2)) {
if(positions == 0) {
GetCursorPos(&cursorPos[positions]);
positions = 1;
}
break;
}
}
cout << "Autoclicker Iniciado\n";
cout << "Presionar F3 Para Pararlo\n";
int pos = 0;
for(;;Sleep(delay)) {
if(GetAsyncKeyState(VK_F3))
break;
SetCursorPos(cursorPos[pos % positions].x, cursorPos[pos % positions].y);
mouse_event(MOUSEEVENTF_LEFTDOWN, cursorPos[pos % positions].x, cursorPos[pos % positions].y, 9, 9);
mouse_event(MOUSEEVENTF_LEFTUP, cursorPos[pos % positions].x, cursorPos[pos % positions].y, 9, 9);
pos++;
}
}




Necesito que no se salga y que el iniciar f1 y parar f2 se repita :/ no solo sea una vez
ES AUTOCLICK OBVIAMENTE LO ESTOY PROGRAMANDO EN C++ PERO NECESITO QUE ME AYUDEN :S
Responder

Volver a “C/C++”