Advertisement
Guest User

autoclicker

a guest
Mar 19th, 2019
65
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 1.68 KB | None | 0 0
  1. //---------------------------------------------------------------------------
  2.  
  3. #include <vcl.h>
  4. #pragma hdrstop
  5.  
  6. #include "Unit1.h"
  7. //---------------------------------------------------------------------------
  8. #pragma package(smart_init)
  9. #pragma resource "*.dfm"
  10. TForm1 *Form1;
  11.  
  12. int z = 0;
  13. int c;
  14.  
  15. void zastosuj()
  16. {
  17.  if (z==1)
  18.  {
  19.  for(;;)
  20.     {
  21.         if (GetAsyncKeyState(VK_MBUTTON))
  22.         {
  23.             mouse_event(MOUSEEVENTF_LEFTDOWN, 0,0,0,0);
  24.             mouse_event(MOUSEEVENTF_LEFTUP, 0,0,0,0);
  25.             Sleep(c);
  26.             Application->ProcessMessages();
  27.  
  28.         }
  29.  
  30.         }
  31.         z=0;
  32.   }
  33. }
  34.  
  35. void anuluj()
  36. {
  37.  if (GetAsyncKeyState(VK_LBUTTON))
  38.  {
  39.  return;
  40.  }
  41. }
  42.  
  43. //---------------------------------------------------------------------------
  44. __fastcall TForm1::TForm1(TComponent* Owner)
  45.         : TForm(Owner)
  46. {
  47.  
  48. }
  49. //---------------------------------------------------------------------------
  50.  
  51. void __fastcall TForm1::FormCreate(TObject *Sender)
  52. {
  53.  //
  54.  
  55. }
  56. //---------------------------------------------------------------------------
  57. void __fastcall TForm1::CzasChange(TObject *Sender)
  58. {
  59.    c = String(Czas -> Text).ToInt();
  60.    
  61. }
  62. //---------------------------------------------------------------------------
  63. void __fastcall TForm1::ZastosujClick(TObject *Sender)
  64. {
  65.    z=1;
  66.    zastosuj();
  67.    anuluj();
  68.  
  69.  
  70.  
  71.  
  72.  
  73.  
  74.  
  75.  
  76.  
  77.  
  78.  
  79.  
  80. }
  81. //---------------------------------------------------------------------------
  82.  
  83.  
  84.  
  85.  
  86.  
  87.  
  88.  
  89.  
  90.  
  91.  
  92.  
  93.  
  94.  
  95.  
  96.  
  97. void __fastcall TForm1::CzasClick(TObject *Sender)
  98. {
  99. for(;;)
  100. if (GetAsyncKeyState(VK_LBUTTON))
  101. {
  102. return;
  103. }
  104. }
  105. //---------------------------------------------------------------------------
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement