Go4Expert

Go4Expert (http://www.go4expert.com/)
-   C (http://www.go4expert.com/forums/c/)
-   -   help for newbie plyyzz (http://www.go4expert.com/forums/help-newbie-plyyzz-t25550/)

slaidas 17Apr2011 20:28

help for newbie plyyzz
 
my program presses wasd123wasd123, but i dont know how to make it pressing 1ws2aasd22ww. How to make random presser? Can someone edit my code?

Code:

#include <iostream>
#include <windows.h>
#include <stdlib.h>
using namespace std;
 
int main ()
{
  for(;;){
  Sleep(1000);
  rand();
  keybd_event(VkKeyScan('w'),0,0,0);
  Sleep(1000);
  rand();
  keybd_event(VkKeyScan('a'),0,0,0);
  Sleep(1000);
  rand();
  keybd_event(VkKeyScan('s'),0,0,0);
  Sleep(1000);
  rand();
  keybd_event(VkKeyScan('d'),0,0,0);
  Sleep(1000);
  rand();
  keybd_event(VkKeyScan('1'),0,0,0);
  Sleep(1000);
  rand();
  keybd_event(VkKeyScan('2'),0,0,0);
  Sleep(1000);
  rand();
  keybd_event(VkKeyScan('3'),0,0,0);
  }
  return 0;
}



All times are GMT +5.5. The time now is 00:41.