Advertisement
phamduc0110

Auto Click

Apr 1st, 2019
146
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. RequireAdmin()
  2. #NoEnv
  3. #SingleInstance Force
  4. playing:=0
  5. SetWorkingDir %A_ScriptDir%
  6. CoordMode Mouse,Client
  7. SetControlDelay -1
  8.  
  9. Gui,+Alwaysontop
  10. Gui Add, Text, x16 y8, Hành động:
  11. Gui Add, DropDownList, x81 y5 w120 vModeClick, Left||Middle|Right
  12. Gui Add, Text, x215 y8 ,Delay:
  13. Gui Add, Edit, x250 y5 w120 h21 vDelayTime number,100
  14. Gui Add, Text, x374 y11 ,(ms)
  15. Gui Add, Text, x16 y32 w60 h23 +0x200, Số lần chạy: ; Đặt 0 để chạy vô hạn lần
  16. Gui Add, Edit, x81 y34 w65 h21 number vCount,
  17. Gui Add, UpDown, x128 y32 w18 h21, 1
  18. Gui Add, ListView, x16 y62 w391 h150 vMyListView, X|Y|Hành động|Delay|Cửa sổ
  19. Gui,Add,StatusBar
  20. SB_SetText("Trạng thái: hỏng có gì để làm hết :))",1)
  21. SB_SetIcon("Shell32.dll", 44,1)
  22. Gui Add, Button, x152 y222 w80 h23 gRunAuto , Chạy (F3)
  23. Gui Add, Button, x240 y224 w80 h23 gStopAuto , Dừng (F4)
  24. Gui Add, Button, x328 y224 w80 h23 gDellList, Xóa
  25. Gui Show, , Auto Clicker
  26.  
  27. Menu, MyContextMenu, Add, Xóa, DellList
  28. Menu, MyContextMenu, Add, Xóa tất cả, DellList
  29.  
  30. Return
  31.  
  32. F2::
  33. if playing
  34.     return
  35. Gui,Submit,Nohide
  36. MouseGetPos,,,WinHWND
  37. WinActivate,ahk_id %WinHWND%
  38. MouseGetPos,X,Y,
  39. LV_Add("",X,Y,ModeClick,DelayTime,WinHWND)
  40. LV_ModifyCol(1)
  41. LV_ModifyCol(2)
  42. return
  43.  
  44.  
  45. F3::
  46. RunAuto:
  47. Dem:=0
  48. Chay:=0
  49. Gui,Submit,Nohide
  50. if (LV_GetCount()=0)
  51.     return
  52. SB_SetText("Trạng thái: Đang chạy auto",1)
  53. if (Count=0)
  54.     Count=-1
  55. playing:=1
  56. Loop
  57. {
  58.     if (Dem=LV_GetCount())
  59.     {
  60.         Dem:=0
  61.         Chay++
  62.     }
  63.     if (Stop || Count=Chay)
  64.         break
  65.     Dem++
  66.     Loop % LV_GetCount("Col")
  67.         LV_GetText(Data_%A_Index%,Dem,A_Index)
  68.     Sleep,% Data_4
  69.     if Stop
  70.         break
  71.     ControlClick,x%Data_1% y%Data_2%,ahk_id %Data_5%,,%Data_3%,,NA Pos
  72. }
  73. stop:=0
  74. playing:=0
  75. SB_SetText("Trạng thái: Đã dừng auto",1)
  76. return
  77.  
  78.  
  79.  
  80. F4::
  81. StopAuto:
  82. if not playing
  83.     return
  84. Stop:=1
  85. playing:=0
  86. return
  87.  
  88. GuiContextMenu:
  89. if A_GuiControl <> MyListView
  90.     return
  91. Menu, MyContextMenu, Show, %A_GuiX%, %A_GuiY%
  92. return
  93.  
  94.  
  95. DellList:
  96. RowNumber = 0
  97. if (A_ThisMenuItem="Xóa")
  98. Loop
  99. {
  100.     RowNumber := LV_GetNext(RowNumber - 1)
  101.     if not RowNumber
  102.         break
  103.     LV_Delete(RowNumber)
  104. }
  105. else
  106.     LV_Delete()
  107. return
  108.  
  109.  
  110. GuiEscape:
  111. GuiClose:
  112. Esc::
  113.     ExitApp
  114.    
  115. RequireAdmin()
  116. {
  117. if not A_IsAdmin
  118. {
  119.     try Run, *RunAs "%A_ScriptFullPath%"
  120.         ExitApp
  121. }
  122. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement