Ver Mensaje Individual
  #11 (permalink)  
Antiguo 18/01/2014, 12:23
fooztt
 
Fecha de Ingreso: enero-2014
Mensajes: 6
Antigüedad: 10 años, 3 meses
Puntos: 0
Respuesta: Un problemita alguien? soy novato

Cita:
Iniciado por guzzano Ver Mensaje
Él lo que quiere hacer, si no entendí mal, y esto.

Código C:
Ver original
  1. #include <windows.h>
  2. #include <cstdlib>
  3. #include <iostream>
  4.  
  5. using namespace std;
  6.  
  7. int main(int argc, char* argv[]) {
  8.     int delay = 0;
  9.     int positions = 0;
  10.     POINT cursorPos[256];
  11.     SetConsoleTitleA("Andromeda 0.1");
  12.     cout << "Bienvenido a Andromeda 0.1\n";
  13.     cout << "Tiempo que se tomara los clicks (en milisegundos): ";
  14.     cin >> delay;
  15.     de_nuevo:
  16.     cout << "1. Para agregar posicion presione F1\n";
  17.     cout << "2. Presione F3 para empezar\n";
  18.    
  19.     for(;; Sleep(200)) {
  20.         if(GetAsyncKeyState(VK_F1)) {
  21.             GetCursorPos(&cursorPos[positions]);
  22.             cout << "Posicion actual " << positions + 1 << ": " << cursorPos[positions].x << ' ' << cursorPos[positions].y << '\n';
  23.             positions += 1;
  24.         }
  25.         if(GetAsyncKeyState(VK_F3)) {
  26.             if(positions == 0) {
  27.                 GetCursorPos(&cursorPos[positions]);
  28.                 positions = 1;
  29.             }
  30.             break;
  31.         }
  32.     }
  33.  
  34.     cout << "Andromeda iniciado\n";
  35.     cout << "Presione F4 para detener\n";
  36.  
  37.     int pos = 0;
  38.     for(;;Sleep(delay)) {
  39.         if(GetAsyncKeyState(VK_F4))
  40.             goto de_nuevo;
  41.         SetCursorPos(cursorPos[pos % positions].x, cursorPos[pos % positions].y);
  42.         mouse_event(MOUSEEVENTF_LEFTDOWN, cursorPos[pos % positions].x, cursorPos[pos % positions].y, 0, 0);
  43.         mouse_event(MOUSEEVENTF_LEFTUP, cursorPos[pos % positions].x, cursorPos[pos % positions].y, 0, 0);
  44.         pos++;
  45.     }
  46.  
  47.     cout << "Gracias por utilizar Andromeda 0.1\n";
  48.     Sleep(10000);
  49.     return 0;
  50. }

Disculpen ese goto ahí, se puede hacer mejor. Solo como ejemplo a ver si es lo que te apetece lograr.
Exactamente lo que estaba buscando, algo mas sabrás como potenciar para que de mas clicks osea que de mas clicks por segundo? Si no sabes gracias de todos modos y gracias a carbon por estar respondiendo