RequireAdmin NoTrayIcon include ButtonConstants au3 include EditConsta

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
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
98
#RequireAdmin
#NoTrayIcon
#include <ButtonConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
#include <Timers.au3>
; После авторизации в игре посредством кнопки Start WoW нажимаем Start в этом кликере
$start = 1
Switch @OSVersion
Case "WIN_7"
; Окно программы ReBot [Название динамично]
$rebot_window = "[CLASS:WindowsForms10.Window.8.app.0.1a0e24_r15_ad1]"
; Кнопка Start [Название динамично]
$start_stop_button = "[CLASS:WindowsForms10.BUTTON.app.0.1a0e24_r15_ad1; INSTANCE:13]"
Case "WIN_8"
$rebot_window = "[CLASS:WindowsForms10.Window.8.app.0.3551b1b_r11_ad1]"
$start_stop_button = "[CLASS:WindowsForms10.BUTTON.app.0.3551b1b_r11_ad1; INSTANCE:13]"
Case Else
Exit
EndSwitch
; Окно для получения премиум доступа
$prem_window = "Premium Bot"
; Кнопка Run Demo
$rundemo_button = "Run Demo"
; Пауза между перезапуском равная 27 минутам
$pause = 27 * 60000
; GUI
GuiCreate("ReBot Clicker", 400, 150)
GUICtrlCreateLabel("Created by kiriman", 50, 20, 300, 15, $SS_CENTER)
GUICtrlSetColor(-1, 0xFF0000)
$GO = GUICtrlCreateButton("Start", 100, 65, 200, 30)
GUISetState(@SW_SHOW)
$time = -1
While 1
If ($time <> -1) And (_Timer_Diff($time) >= $pause) Then
If startBot() = 0 Then ; Во время выполнения GUI будет недоступен
stopBot()
EndIf
EndIf
$msg = GUIGetMsg()
Select
Case $msg = $GO
GUICtrlSetState($GO, $GUI_DISABLE)
If startBot() = 0 Then
stopBot()
EndIf
Case $msg = $GUI_EVENT_CLOSE
Exit
EndSelect
WEnd
Func stopBot()
$time = -1
GUICtrlSetState($GO, $GUI_ENABLE)
EndFunc
Func startBot()
If $start = 0 Then
; Stop
If Click($rebot_window, $start_stop_button) = 0 Then
Return 0
EndIf
Sleep(1800)
EndIf
; Start
If Click($rebot_window, $start_stop_button) = 0 Then
Return 0
EndIf
Sleep(1800)
; Run Demo
If Click($prem_window, $rundemo_button) = 0 Then
Return 0
EndIf
$start = 0
$time = _Timer_Init()
Return 1
EndFunc
; Имитация нажатия ЛКМ
Func Click($window, $button)
$wnd = WinWait($window, "", 2)
if $wnd = 0 Then
Return 0
EndIf
WinActivate($wnd)
ControlClick($wnd, "", $button, "left", 1)
Return 1
EndFunc