-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathShinyFishing.ahk
191 lines (176 loc) · 4.31 KB
/
ShinyFishing.ahk
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
#Include libs/basic.ahk
#SingleInstance Force
SetWorkingDir(A_ScriptDir)
; REMOVED: SetBatchLines -1
myGui := Gui()
myGui.OnEvent("Close", Gui_Escape)
myGui.OnEvent("Escape", Gui_Escape)
myGui.Opt("-MinimizeBox -MaximizeBox")
myGui.SetFont("s9", "Segoe UI")
myGui.Add("Picture", "x0 y0 w160 h200", "images/gui_bg.png")
myGui.SetFont()
myGui.SetFont("cWhite")
myGui.Add("Text", "x45 y5 w73 h23 +BackgroundTrans", "Shiny Fishing")
myGui.SetFont()
myGui.SetFont("s9", "Segoe UI")
myGui.SetFont()
myGui.SetFont("s20 Bold cWhite")
ogcTextBattleCount := myGui.Add("Text", "vBattleCount x6 y140 w68 h27 +BackgroundTrans +Center", "00")
myGui.SetFont()
myGui.SetFont("s9", "Segoe UI")
myGui.SetFont()
myGui.SetFont("s20 Bold cWhite")
ogcTextHealCount := myGui.Add("Text", "vHealCount x86 y140 w68 h30 +BackgroundTrans +Center", "00")
myGui.SetFont()
myGui.SetFont("s9", "Segoe UI")
myGui.SetFont()
myGui.SetFont("cWhite")
ogcTextLocation := myGui.Add("Text", "vLocation x36 y180 w85 h20 +BackgroundTrans +Center", "Johto")
myGui.SetFont()
myGui.SetFont("s9", "Segoe UI")
myGui.SetFont()
myGui.SetFont("s14 cWhite")
ogcTextStatus := myGui.Add("Text", "vStatus x8 y93 w140 h25 +BackgroundTrans +Center", "Press Q to start")
myGui.SetFont()
myGui.SetFont("s9", "Segoe UI")
myGui.SetFont()
myGui.SetFont("s14 Bold cWhite")
ogcTextTimerCount := myGui.Add("Text", "vTimerCount x8 y43 w140 h25 +BackgroundTrans +Center", "00 : 00")
myGui.SetFont()
myGui.Title := "INTI PokemmoBot"
myGui.Show("x911 y308 w158 h200")
Toggle := 0
BtlCnt := 0
HealCnt := 0
isBattle := 0
shinyBattle := 0
gui_status:="Initiating"
StartTime := A_TickCount
stepCount := 0
director :=True
Return
Q::
{ ; V1toV2: Added bracket
SetTimer(UPDATE,1000)
SetTimer(GUISTATUSUPDATE,500)
SetTimer(CHECKDISCONNECTED,3000)
WALK()
} ; Added bracket before function
WALK()
{ ; V1toV2: Added bracket
Loop{
global gui_status
gui_status := "Fishing..."
sleep_rand(90,200)
send_fish()
; send_sweet_scent()
if detect_battle(1) = 1
{
FIGHTINIT()
Continue
}
}
Return
} ; V1toV2: Added Bracket before label
FIGHTINIT()
{ ; V1toV2: Added bracket
global gui_status, fight_opt
fight_opt := 0
gui_status := "Entering battle..."
Sleep(1000)
if detect_fight_but() = 1
{
FIGHT()
}
else
{
FIGHTINIT()
}
return
} ; V1toV2: Added Bracket before label
FIGHT()
{ ; V1toV2: Added bracket
global gui_status, fight_opt
gui_status := "Fighting"
if detect_shiny() = 1
{
fight_opt := 1
}
if (fight_opt = 0)
{
send_run()
Sleep(2000)
}
if (fight_opt = 1)
{
send_get_request()
}
QUIT()
Return
} ; V1toV2: Added Bracket before label
QUIT()
{ ; V1toV2: Added bracket
if detect_battle(1) = 0
{
global gui_status, BtlCnt
gui_status := "Exiting battle..."
BtlCnt+=1
If (detect_pp() || detect_hp()) {
HEAL()
}
; If (detect_but_yes()) {
; send_no()
; }
}
else
{
FIGHT()
}
Return
} ; V1toV2: Added bracket before function
HEAL()
{ ; V1toV2: Added bracket
global gui_status, HealCnt
gui_status := "Teleport"
sleep 2000
gui_status := "Healing"
teleport_and_heal()
HealCnt+=1
; go to train
gui_status := "Moving..."
sleep 2000
randomvar := Random(35, 40)
walk_down(1)
walk_left(randomvar)
walk_up(2)
Return
} ; V1toV2: Added bracket before function
Gui_Escape(thisGui)
{ ; V1toV2: Added bracket
ExitApp()
return
}
UPDATE()
{ ; V1toV2: Added bracket
WinActivate "ahk_class GLFW30"
t := Floor((A_TickCount - StartTime) / 1000)
m := Floor(t / 60) > 10 ? Floor(t / 60) : SubStr("00" . Floor(t / 60), -2)
r := SubStr("00" . Mod(t,60), -2)
ogcTextTimerCount.Value := m " : " r
Return
} ; V1toV2: Added Bracket before label
GUISTATUSUPDATE()
{ ; V1toV2: Added bracket
WinActivate "ahk_class GLFW30"
ogcTextStatus.Value := gui_status
ogcTextBattleCount.Value := BtlCnt
ogcTextHealCount.Value := HealCnt
Return
} ; V1toV2: Added bracket in the end
CHECKDISCONNECTED()
{ ; V1toV2: Added bracket
if detect_strings("disconnected") = 1
{
send_get_request()
}
} ; V1toV2: Added bracket in the end