-
Notifications
You must be signed in to change notification settings - Fork 7
/
gt7-extramenus-ps4.py
152 lines (125 loc) · 3.56 KB
/
gt7-extramenus-ps4.py
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
import time
import argparse
import pyautogui
DEFAULT_DELAY = 0.2
STARTUP_DELAY = 5
def parse_args():
"""Parse arguments"""
parser = argparse.ArgumentParser()
parser.add_argument(
"--delay",
type=float,
required=False,
nargs="?",
const=DEFAULT_DELAY,
default=DEFAULT_DELAY,
help="default = 0.2 - Value must be >= 0.2",
)
parser.add_argument(
"--auto",
action="store_true",
help="automatically captures window on primary monitor",
)
args = parser.parse_args()
if args.delay < DEFAULT_DELAY:
print("--delay values below 0.2 may break the script. Try another value")
exit()
return args
def press(key: str) -> None:
"""Press a key.
Using vanilla `pyautogui.press()` will not register the keystroke
because GT requires you hold a keypress for a small duration."""
delay = parse_args().delay
with pyautogui.hold(key):
time.sleep(0.2)
time.sleep(delay) # delay after any press
def hold(key: str, duration: float) -> None:
"""Hold a key for some duration."""
with pyautogui.hold(key):
time.sleep(duration)
def sleep(seconds: float):
delay = parse_args().delay
time.sleep(seconds - delay + DEFAULT_DELAY)
def focus_window(auto):
"""Focus the window by clicking on the center of the primary screen."""
# Click center of screen to focus remote play window.
# You can reposition and resize remote play window, just
# make sure you update where you click. I don't know how to
# use pyautogui in headless mode.
if auto:
print("Using auto mode")
width, height = pyautogui.size()
center = width / 2, height / 2
pyautogui.moveTo(center)
time.sleep(1)
pyautogui.click()
time.sleep(1)
else:
print(
"Using startup delay of "
+ str(STARTUP_DELAY)
+ " seconds. Switch to PS Remote Play window now"
)
time.sleep(STARTUP_DELAY)
def start_exploit(section):
"""Begin a cycle"""
print(" [-] Entering Cafe.")
press("enter")
sleep(6)
press("left")
press("enter")
press("down")
press("right")
press("enter")
press("up")
if section == "ROTARY":
press("right")
press("right")
# Inside Rotary Engine
press("enter")
press("enter")
sleep(1) # Exploiting
press("escape")
press("escape")
press("escape")
sleep(8)
# Back to map to open ticket
press("right")
press("enter")
sleep(10)
press("right")
press("right")
press("right")
press("enter")
press("enter")
press("enter")
print(" [-] Opening ticket.")
sleep(18)
# Accepting any kind of ticket, avoids using image detection
print(" [-] Accepting ticket.")
press("enter")
# skip superfluous times for rotary tickets
if section != "ROTARY":
sleep(16)
press("enter")
sleep(6)
press("enter")
press("enter")
press("enter") # accept ticket
# Back out of tickets
print(" [-] Going back to map.")
press("escape")
press("escape")
sleep(8)
press("left") # Place cursor on Menu to start over
if __name__ == "__main__":
inputs = parse_args()
print("*** gt7-extramenus-ps4.py ***")
print("Using input delay of: " + str(inputs.delay) + " seconds")
cycles = 0
focus_window(inputs.auto)
while True:
start_exploit("")
start_exploit("ROTARY")
cycles += 1
print(" [+] Cycles completed: " + str(cycles))