-
Notifications
You must be signed in to change notification settings - Fork 25
/
Copy pathJump.ahk
352 lines (316 loc) · 7.81 KB
/
Jump.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
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
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
DetectHiddenWindows, On
#Persistent
#NoEnv
buttonToPress := "Enter"
; --------- Constants
; jump intervals
a = 667
b = 532
c = 467
d = 433
e = 383
; f = not needed since 200-300 can be done with a single interval
g = 400
g2 = 401
latency = 710
script = 1
; ---------- Gui Setup -------------
Gui, -MaximizeBox
Gui, -MinimizeBox
Gui, 2: -MaximizeBox
Gui, 2: -MinimizeBox
Gui, Color, c282a36, c6272a4
Gui, Add, Button, x15 y10 w70 default, Start
Gui, Add, Button, x15 y40 w70 default gVariableWindow, Variables
Gui, Font, ce8dfe3 s9 w550 Bold
Gui, Add, GroupBox, x90 y10 w120 h60, Button to press
Gui, Font, c758eff Bold, Verdana
Gui, Add, Radio, x100 y28 Checked altsubmit gButtonChange vButtonChoice group, X
Gui, Font, cff5754 Bold, Verdana
Gui, Add, Radio, altsubmit gButtonChange, O
Gui, Font, ce8dfe3 s8 w550 Bold
Gui, Add, GroupBox, x15 y70 w190 h40, Script
Gui, Add, Radio, x25 y90 Checked altSubmit gScriptChange vScriptChoice group, QueueTip
Gui, Add, Radio, x115 y90 altSubmit gScriptChange, Septomor
;--------- Gui 2 Setup --------------
Gui, 2: Color, c535770, c6272a4
Gui, 2: Font, c11f s9 Bold
Gui, 2: Add, Text,, Jumps 2-19
Gui, 2: Add, Edit, w40 vA, %a%
Gui, 2: Add, Text,, Jumps 20-49
Gui, 2: Add, Edit, w40 vB, %b%
Gui, 2: Add, Text,, Jumps 50-99
Gui, 2: Add, Edit, w40 vC, %c%
Gui, 2: Add, Text,, Jumps 100-199
Gui, 2: Add, Edit, w40 vD, %d%
Gui, 2: Add, Text, x100 y10, Jumps 200-299
Gui, 2: Add, Edit, w40 x100 y25 vE, %e%
Gui, 2: Add, Text, x100 y50, Jumps 300+
Gui, 2: Add, Edit, w40 x100 y65 vG, %g%
Gui, 2: Add, Edit, w40 x100 y90 vG2, %g2%
Gui, 2: Font, ccc3429 s9 Bold
Gui, 2: Add, Text, x100 y120, Latency
Gui, 2: Font, c11f s9 Bold
Gui, 2: Add, Edit, w40 x100 y135 vLat, %latency%
Gui, 2: Add, Button, x20 y192 gSaveVars, Save
Gui, 2: Add, Button, x100 y192 gVarDef, Defaults
Gui, Show,w220 h120, Vivi Jumps QueueTip + Sept
return
VariableWindow:
Gui, 2: Show, w210 h225, Variables
return
SaveVars:
Gui, 2:Submit
GuiControlGet, a, 2:, A
GuiControlGet, b, 2:, B
GuiControlGet, c, 2:, C
GuiControlGet, d, 2:, D
GuiControlGet, e, 2:, E
GuiControlGet, g, 2:, G
GuiControlGet, g2, 2:, G2
GuiControlGet, latency, 2:, Lat
return
VarDef:
a = 667
b = 532
c = 467
d = 433
e = 383
g = 400
g2 = 401
Lat = 710
GuiControl, 2:, A, %a%
GuiControl, 2:, B, %b%
GuiControl, 2:, C, %c%
GuiControl, 2:, D, %d%
GuiControl, 2:, E, %e%
GuiControl, 2:, G, %g%
GuiControl, 2:, G2, %g2%
GuiControl, 2:, Lat, %lat%
return
ButtonStart:
Gui, Submit, NoHide
id := ""
SetKeyDelay, 100
Process, priority, , High
gosub, GrabRemotePlay
if (id = "")
return
gosub, PauseLoop
CoordMode, Pixel, Screen
CoordMode, ToolTip, Screen
sleep 2000
if(script = 1)
gosub, QueueTipS
else if(script = 2)
gosub, SeptS
; ---------- Gui Setup End-------------
; ---------- Jump Loop -------------
; ---------- QueueTip
QueueTipS:
loop {
i = 1
delay = 100
balancer = 0
currentInterval := a
extraTime = 0
ToolTip, start, 400,400
; Initiate steps to begin
ControlSend,, {%buttonToPress% down}, ahk_id %id% ; Press down the %buttonToPress% key.
DllCall("Sleep", "Uint", 100)
ControlSend,, {%buttonToPress% up}, ahk_id %id% ; Release %buttonToPress% key.
Sleep, 2000
ControlSend,, {%buttonToPress% down}, ahk_id %id% ; Press down the %buttonToPress% key.
DllCall("Sleep", "Uint", 100)
ControlSend,, {%buttonToPress% up}, ahk_id %id% ; Release %buttonToPress% key.
Sleep, 3000
PixelGetColor, failColor, 644, 535, RGB
PixelGetColor, jumpColor, 562, 416, RGB
ControlSend,, {%buttonToPress% down}, ahk_id %id% ; Press down the %buttonToPress% key.
DllCall("Sleep", "Uint", 100)
ControlSend,, {%buttonToPress% up}, ahk_id %id% ; Release %buttonToPress% key.
; Detect 1st jump
Loop {
PixelSearch, x, y, 562, 416, 562, 416, %jumpColor%, 20, Fast RGB
If (ErrorLevel != 0) {
DllCall("Sleep", "Uint", latency - 220 )
break
}
}
start := A_TickCount + 50
loop
{
; Detect if failed and back at the start to retry
PixelSearch, x, y, 644, 535, 644, 535, %failColor%, 20, Fast RGB
If (ErrorLevel != 0) { ; reset
ToolTip, failed, 400, 400
sleep, 3000
ControlSend,, {%buttonToPress% down}, ahk_id %id% ; Press down the %buttonToPress% key.
DllCall("Sleep", "Uint", 100)
ControlSend,, {%buttonToPress% up}, ahk_id %id% ; Release %buttonToPress% key.
sleep, 2000
break
}
Gosub, timings
Gosub, jump
}
}
return
jump:
fullTime := A_TickCount - start - extraTime
start := A_TickCount
if(i > 1) {
balancer += currentInterval - fullTime
}
ToolTip, %i% - %fullTime%, 400, 400
ControlSend,, {%buttonToPress% down}, ahk_id %id% ; Press down the %buttonToPress% key.
DllCall("Sleep", "Uint", delay)
ControlSend,, {%buttonToPress% up}, ahk_id %id% ; Release %buttonToPress% key.
ToolTip
i += 1
extraTime = 0
return
; ------- Septomor
SeptS:
loop{
i = 1
delay = 100
balancer = 0
currentInterval := a
extraTime = 0
ToolTip, start, 400,300
SendMode, Input
Send, {%buttonToPress% down}
Sleep, 100
Send {%buttonToPress% up}
Sleep, 2000
Send, {%buttonToPress% down}
Sleep, 100
Send {%buttonToPress% up}
Sleep, 3000
PixelGetColor, failColor, 644, 535, RGB
Send, {%buttonToPress% down}
Sleep, 100
Send {%buttonToPress% up}
Sleep, %latency%
loop
{
; Detect if failed and back at the start to retry
PixelSearch, x, y, 644, 535, 644, 535, %failColor%, 20, Fast RGB
If (ErrorLevel != 0) { ; reset
ToolTip, failed, 400, 400
sleep, 3000
ControlSend,, {%buttonToPress% down}, ahk_id %id% ; Press down the %buttonToPress% key.
DllCall("Sleep", "Uint", 100)
ControlSend,, {%buttonToPress% up}, ahk_id %id% ; Release %buttonToPress% key.
sleep, 2000
gosub, GrabRemotePlay
break
}
gosub timings
gosub, InputJump
}
}
timings:
timer := A_TickCount - start
if (i = 1) {
currentInterval := a
} else if (i = 21) {
currentInterval := b
balancer = 0
} else if (i = 51) {
currentInterval := c
balancer = 0
} else if (i = 101) {
currentInterval := d
balancer = 0
} else if (i = 201) {
;extraTime = 50
delay = 70
currentInterval := e
balancer = 0
} else if (i = 260) {
extraTime = 20
balancer = 0
} else if (i = 301) {
currentInterval := g
balancer = 0
} else if (i = 500 or i = 800) {
currentInterval := g2
} else if (i = 600 or i = 900) {
currentInterval := g
} else if (i => 1001) {
if (Mod(i,2) = 0) {
currentInterval := g
} else {
currentInterval := g2
}
}
if(i > 1)
{
DllCall("Sleep", "Uint", (currentInterval - timer + balancer + extraTime))
}
return
inputJump:
fullTime := A_TickCount - start - extraTime
start := A_TickCount
if(i > 1) {
balancer += currentInterval - fullTime
}
ToolTip, %i% - %fullTime%, 400, 400
Send, {%buttonToPress% down} ; Press down the %buttonToPress% key.
Sleep, delay
Send {%buttonToPress% up} ; Release %buttonToPress% key.
i += 1
extraTime = 0
return
; ---------- Jump Loop End-------------
ButtonChange:
Gui, submit, nohide
if (ButtonChoice = 1)
{
buttonToPress := "Enter"
}
if (ButtonChoice = 2)
{
buttonToPress := "Esc"
}
return
GrabRemotePlay:
WinGet, remotePlay_id, List, ahk_exe RemotePlay.exe
if (remotePlay_id = 0)
{
MsgBox, PS4 Remote Play not found
return
}
Loop, %remotePlay_id%
{
id := remotePlay_id%A_Index%
WinGetTitle, title, % "ahk_id " id
If InStr(title, "PS Remote Play")
break
}
WinGetClass, remotePlay_class, ahk_id %id%
WinMove, ahk_id %id%,, 0, 0, 1440, 900
ControlFocus,, ahk_class %remotePlay_class%
WinActivate, ahk_id %id%
return
ScriptChange:
Gui, submit, nohide
if (ScriptChoice = 1)
{
script = 1
}
if (ScriptChoice = 2)
{
script = 2
}
return
PauseLoop:
Send, {%buttonToPress% Up}
Send, {Esc Up}
return
GuiClose:
gosub, PauseLoop
ExitApp
^Esc::ExitApp