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


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

   
    using namespace std;
   
    int main(int argc, char* argv[]) {
            int delay = 0;
            int positions = 0;
            POINT cursorPos[256];
        SetConsoleTitleA("Autoclicker C++");
            cout << "Bienvenido a Autoclicker !\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_F3)) {
                            GetCursorPos(&cursorPos[positions]);
                            cout << "Posición Adquirida" << positions + 1 << ": " << cursorPos[positions].x << ' ' << cursorPos[positions].y << '\n';
                            positions += 1;
                    }
                    if(GetAsyncKeyState(VK_F1)) {
                            if(positions == 0) {
                                    GetCursorPos(&cursorPos[positions]);
                                    positions = 1;
                            }
                            break;
                    }
            }
   
            cout << "Autoclicker Iniciado\n";
            cout << "Presionar F3 Para Pararlo\n";
   
            int pos = 0;
            bool active = false;
            for(;;Sleep(delay)) {
                    if(GetAsyncKeyState(VK_F1))  active = true;
                    if(GetAsyncKeyState(VK_F2))  active = false;
                    if(GetAsyncKeyState(VK_F4))  break;
                    if(active){ 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++;}
            }
   
            cout << "Gracias por usar Autoclicker \n";
            Sleep(10000);
            return 0;
    }




pues necesito ayuda, porfavor con este codigo , quiero que al al fijar las coordenadas el mouse no se quede quieto en un solo lugar , que sea el cursor libre , osea cuanto lo activo , se  pueda mover el mouse activandolo a  cualquier lado ,  un tipo caos se podria? decir , me podrian ayudar???
Responder

Volver a “Dudas y Preguntas”