-
Notifications
You must be signed in to change notification settings - Fork 3
/
gui_dlpc.au3
303 lines (268 loc) · 8.07 KB
/
gui_dlpc.au3
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
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
#include <String.au3>
#include <MsgBoxConstants.au3>
#include <StringConstants.au3>
#include <GuiScrollBars.au3>
#include <GUIConstantsEx.au3>
#include <ButtonConstants.au3>
#include <GuiEdit.au3>
#include <FileConstants.au3>
#include <WinAPIFiles.au3>
#include "dlpc.au3"
Global $nMsg = ""
Global $duel_mode = 0
Global $coin = 1000
Global $OnTop = True
;---------------------------- Start GUI --------------------------
gui()
;-------------------------- DEBUG commands -------------------------
;Move(650, 550)
;Dbg_print_color(400, 520)
;Dbg_print_color(650, 480)
;Dbg_print_color(650, 550)
;Move(498, 646)
;Dbg_search(0,0,16)
;Street_duel(0,0)
;Dbg_print_color(759,439)
;Dbg_excluded(504, 522,0)
;Gate_duel(10)
;-------------------------------------------------------------------
Func gui()
Local $window_status = 0
Global $hGui = GUICreate("Duellink Bot For PC",400, 400, 10, 20)
GUICtrlCreateTab(0,0,400,400)
GUICtrlCreateTabItem("Bot")
Global $log = GUICtrlCreateEdit("",5, 25, 210, 340)
write_log("Make sure you are already log in.")
Local $x = 225
Local $y= 60
GUICtrlCreateGroup("Duel",$x-5, 25,170,125)
GUIStartGroup()
Global $duel_enable = GUICtrlCreateCheckbox("Enable",$x,$y-20)
GUICtrlSetState($duel_enable, $GUI_CHECKED )
Global $rad_world0 = GUICtrlCreateRadio("Yu-Gi-Oh", $x,$y)
GUICtrlSetState($rad_world0, $GUI_CHECKED )
Global $rad_world1 = GUICtrlCreateRadio("GX", $x+75, $y)
Global $rad_world2 = GUICtrlCreateRadio("5DS", $x, $y + 20)
Global $rad_world3 = GUICtrlCreateRadio("Zexal", $x+75, $y + 20)
Global $rad_world4 = GUICtrlCreateRadio("ARCV", $x, $y + 40)
Global $rad_world5 = GUICtrlCreateRadio("Vrains", $x+75, $y + 40)
Global $rad_world6 = GUICtrlCreateRadio("OLDN", $x, $y + 60)
Global $rad_world7 = GUICtrlCreateRadio("Seven", $x+75, $y + 60)
GUIStartGroup()
Global $rad_sd = GUICtrlCreateRadio("Street duel", $x, $y+100)
GUICtrlSetState($rad_sd, $GUI_CHECKED )
Global $rad_gd = GUICtrlCreateRadio("Gate duel", $x+75, $y+100)
GUICtrlCreateGroup("Battle City Showdown",$x-5, $y+125,170,80)
GUIStartGroup()
Global $event_enable = GUICtrlCreateCheckbox("Enable",$x,$y+140)
Global $rad_dt = GUICtrlCreateRadio("Devine trial", $x, $y+160)
GUICtrlSetState($rad_dt, $GUI_DISABLE)
Global $rad_lo = GUICtrlCreateRadio("Card Lottery", $x + 75, $y+160)
GUICtrlSetState($rad_lo, $GUI_DISABLE)
GUICtrlCreateGroup("Other Events",$x-5, $y+210,170,70)
Global $rad_td = GUICtrlCreateRadio("Tag Duel", $x, $y+230)
GUICtrlSetState($rad_td, $GUI_ENABLE)
Global $but_duel = GUICtrlCreateButton("It's time to DUEL", 4, 370)
Global $l_status = GUICtrlCreateLabel("Duellink status: Stopped",270, 383)
GUICtrlCreateTabItem("Hotkey")
GUICtrlCreateLabel("F9 : Pause/resume",5,25)
GUICtrlCreateLabel("F10: Terminate",5,40)
GUICtrlCreateTabItem("Setting")
$x = 5
$y = 25
GUICtrlCreateGroup("General",$x, $y,170,40)
GUIStartGroup()
Global $cOnTop = GUICtrlCreateCheckbox("Always on top", $x+5,40)
GUICtrlSetState($cOnTop, $GUI_CHECKED)
GUICtrlCreateGroup("Street Duel",$x, $y+50 ,270,40)
GUIStartGroup()
Global $cLoop = GUICtrlCreateCheckbox("Loop area", $x+5,90)
Global $cOrb = GUICtrlCreateCheckbox("Auto use orb", $x+80,90)
Global $cGem = GUICtrlCreateCheckbox("Check for gems", $x+170,90)
GUICtrlSetState($cLoop, $GUI_CHECKED)
GUICtrlSetState($cGem, $GUI_CHECKED)
GUICtrlCreateGroup("Gate Duel",5, 125,170,40)
GUIStartGroup()
GUICtrlCreateTabItem("Help")
Local $nHelp = "\help.txt"
Local $hFileOpen = FileOpen(@ScriptDir & $nHelp)
If $hFileOpen = -1 Then
MsgBox($MB_SYSTEMMODAL, "", "An error occurred when reading " & $nHelp)
Else
Local $lHelp = GUICtrlCreateLabel(FileRead($hFileOpen),5,25,Default,Default,0x0000)
EndIf
GUICtrlCreateTabItem("")
HotKeySet("{F9}", "Hot_key")
HotKeySet("{F10}", "Hot_key")
GUISetState(@SW_SHOW)
While 1
If Control_gui(GUIGetMsg()) == -1 Then
ExitLoop
EndIf
If $OnTop Then
WinSetOnTop($hGui,'', $WINDOWS_ONTOP)
Else
WinSetOnTop($hGui,'', $WINDOWS_NOONTOP)
EndIf
If WinExists($title) Then
If $window_status == 0 Then
GUICtrlSetData($l_status, "Duellink status: Running")
$window_status = 1
EndIf
Else
If $window_status == 1 Then
GUICtrlSetData($l_status, "Duellink status: Stopped")
$window_status = 0
EndIf
EndIf
WEnd
GUIDelete($hGui)
Exit
EndFunc
Func write_log($variable)
$variable = $variable & @CRLF
_GUICtrlEdit_AppendText($log,$variable)
EndFunc
Func duel_bot()
Switch $duel_mode
Case 0
Street_duel($world, get_area(1))
Case 1
Gate_duel(1176/24)
Case 2
#comments-start divine_trial()
#comments-end
Battle_city()
Case 3
card_lottery($coin)
Case 4
Tag_duel()
EndSwitch
EndFunc
Func Create_log()
$log = GUICtrlCreateEdit("",10, 10, 200, 330)
EndFunc
Func Clear_log()
GUICtrlDelete($log)
Create_log()
EndFunc
Func Hot_key()
Switch @HotKeyPressed
Case "{F9}"
$sPaused = Not $sPaused
Local $Informed = False
While $sPaused
Control_gui(GUIGetMsg())
$timer = TimerInit()
If Not $Informed Then
Write_log("Bot Paused.")
$Informed = True
EndIf
Sleep(100)
WEnd
If Not $sPaused And $Informed Then
Write_log("Bot resume.")
EndIf
Case "{F10}"
Write_log("Bot terminated.")
Sleep(1000)
Exit
EndSwitch
EndFunc
Func Control_gui($nMsg)
Switch $nMsg
Case $GUI_EVENT_CLOSE
Return -1
Case $duel_enable
if GUICtrlRead($duel_enable) == $GUI_UNCHECKED Then
disable_duel_menu()
Else
GUICtrlSetState($rad_sd, $GUI_ENABLE)
GUICtrlSetState($rad_gd, $GUI_ENABLE)
GUICtrlSetState($rad_world0, $GUI_ENABLE)
GUICtrlSetState($rad_world1, $GUI_ENABLE)
disalbe_bcd_menu()
EndIf
Case $event_enable
If GUICtrlRead($event_enable) == $GUI_UNCHECKED Then
disalbe_bcd_menu()
Else
disable_duel_menu()
GUICtrlSetState($rad_dt, $GUI_ENABLE)
GUICtrlSetState($rad_lo, $GUI_ENABLE)
EndIf
Case $but_duel
duel_bot()
Case $rad_sd
$duel_mode = 0
Case $rad_gd
$duel_mode = 1
Case $rad_dt
$duel_mode = 2
Case $rad_lo
$duel_mode = 3
Case $rad_td
$duel_mode = 4
Case $rad_world0
$world = 0
Case $rad_world1
$world = 1
Case $rad_world2
$world = 2
Case $rad_world3
$world = 3
Case $rad_world4
$world = 4
Case $rad_world5
$world = 5
Case $rad_world6
$world = 6
Case $rad_world7
$world = 7
Case $cLoop
if _IsChecked($cLoop) Then
$Loop = True
Else
$Loop = false
EndIf
Case $cGem
if _IsChecked($cGem) Then
$CheckGems = True
Else
$CheckGems = false
EndIf
Case $cOrb
if _IsChecked($cOrb) Then
$auto_orb_reload = True
Else
$auto_orb_reload = false
EndIf
Case $cOnTop
if _IsChecked($cOnTop) Then
$OnTop = True
Else
$OnTop = false
EndIf
EndSwitch
EndFunc
Func disable_duel_menu()
GUICtrlSetState($duel_enable, $GUI_UNCHECKED)
GUICtrlSetState($rad_sd, $GUI_UNCHECKED)
GUICtrlSetState($rad_sd, $GUI_DISABLE)
GUICtrlSetState($rad_gd, $GUI_UNCHECKED)
GUICtrlSetState($rad_gd, $GUI_DISABLE)
GUICtrlSetState($rad_world0, $GUI_UNCHECKED)
GUICtrlSetState($rad_world0, $GUI_DISABLE)
GUICtrlSetState($rad_world1, $GUI_UNCHECKED)
GUICtrlSetState($rad_world1, $GUI_DISABLE)
EndFunc
Func disalbe_bcd_menu()
GUICtrlSetState($event_enable, $GUI_UNCHECKED)
GUICtrlSetState($rad_dt, $GUI_UNCHECKED)
GUICtrlSetState($rad_dt, $GUI_DISABLE)
GUICtrlSetState($rad_lo, $GUI_UNCHECKED)
GUICtrlSetState($rad_lo, $GUI_DISABLE)
EndFunc
Func _IsChecked($idControlID)
Return BitAND(GUICtrlRead($idControlID), $GUI_CHECKED) = $GUI_CHECKED
EndFunc