Advertisement
Guest User

Untitled

a guest
Mar 25th, 2017
299
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.07 KB | None | 0 0
  1. #include <cstdio>
  2. #include <iostream>
  3. #include <Windows.h>
  4.  
  5. using namespace std;
  6.  
  7. int main ()
  8. {
  9.  
  10. int p = 10;
  11. POINT pos;
  12.  
  13. while(1){
  14.  
  15. GetCursorPos( & pos );
  16.  
  17. if(GetAsyncKeyState(VK_UP))
  18. {
  19.  
  20.  
  21. SetCursorPos(pos.x, pos.y-p);
  22. mouse_event(MOUSEEVENTF_LEFTDOWN | MOUSEEVENTF_LEFTUP,0,0,0,0);
  23.  
  24. cin.get();
  25.  
  26.  
  27.  
  28. }
  29.  
  30.  
  31.  
  32.  
  33.  
  34. if(GetAsyncKeyState(VK_DOWN))
  35. {
  36.  
  37.  
  38. SetCursorPos(pos.x, pos.y+p);
  39. mouse_event(MOUSEEVENTF_LEFTDOWN | MOUSEEVENTF_LEFTUP,0,0,0,0);
  40.  
  41. cin.get();
  42.  
  43.  
  44.  
  45. }
  46.  
  47.  
  48.  
  49.  
  50.  
  51. if(GetAsyncKeyState(VK_LEFT))
  52. {
  53.  
  54.  
  55. SetCursorPos(pos.x-p, pos.y);
  56. mouse_event(MOUSEEVENTF_LEFTDOWN | MOUSEEVENTF_LEFTUP,0,0,0,0);
  57.  
  58. cin.get();
  59.  
  60.  
  61.  
  62. }
  63.  
  64.  
  65.  
  66.  
  67.  
  68. if(GetAsyncKeyState(VK_RIGHT))
  69. {
  70.  
  71.  
  72. SetCursorPos(pos.x+p, pos.y);
  73. mouse_event(MOUSEEVENTF_LEFTDOWN | MOUSEEVENTF_LEFTUP,0,0,0,0);
  74.  
  75. cin.get();
  76.  
  77.  
  78.  
  79. }
  80.  
  81.  
  82.  
  83.  
  84.  
  85. }
  86.  
  87. return 0;
  88.  
  89.  
  90.  
  91. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement