-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathgt7-extramenus-detection.py
137 lines (110 loc) · 3.36 KB
/
gt7-extramenus-detection.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
import sys
import time
import pyautogui
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."""
with pyautogui.hold(key):
time.sleep(0.2)
time.sleep(0.2)
def hold(key: str, duration: float) -> None:
"""Hold a key for some duration."""
with pyautogui.hold(key):
time.sleep(duration)
def focus_window():
"""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.
width, height = pyautogui.size()
center = width / 2, height / 2
pyautogui.moveTo(center)
time.sleep(1)
pyautogui.click()
time.sleep(1)
def detect_creen(screen):
width, height = pyautogui.size()
halfwidth = int(width / 2)
halfheight = int(height / 2)
CONFIDENCE = 0.5
GRAYSCALE = True
REGION = (halfwidth, 0, halfwidth, halfheight)
filename = screen + ".png"
print(" [-] Analyzing " + filename + " screen.")
detected_screen = pyautogui.locateOnScreen(
filename, region=REGION, grayscale=GRAYSCALE, confidence=CONFIDENCE
)
if detected_screen is not None:
return True
else:
return False
def start_exploit(section):
focus_window()
print(" [-] Entering Cafe.")
press("enter")
time.sleep(3)
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")
time.sleep(3)
press("escape")
press("escape")
press("escape")
time.sleep(4)
# Back to map to open ticket
press("right")
press("enter")
time.sleep(4)
press("right")
press("right")
press("right")
press("enter")
press("enter")
press("enter")
# Ticket opening duration
print(" [-] Opening ticket.")
time.sleep(15)
if section != "ROTARY": # if ticket is 4-start
if detect_creen("cartext"):
print("Car screen detected.")
press("enter")
time.sleep(10)
press("enter")
time.sleep(4)
press("enter")
press("enter")
elif detect_creen("creditstext"):
print("Credits screen detected.")
press("enter")
time.sleep(5)
press("enter")
elif detect_creen("tuningtext"):
print("Tuning part screen detected.")
elif detect_creen("invitationtext"):
print("Invitation screen detected.")
else:
print("No Screen detected. Exiting Now")
exit()
print(" [-] Accepting ticket.")
press("enter") # accept ticket
# Back out of tickets
print(" [-] Going back to map.")
press("escape")
press("escape")
time.sleep(3)
press("left") # Place cursor on Menu to start over
if __name__ == "__main__":
while True:
start_exploit("")
start_exploit("ROTARY")