Skip to content

Commit d312802

Browse files
authored
Add files via upload
1 parent b4b17a5 commit d312802

24 files changed

+1722
-1584
lines changed

FFX_Auto_Main.py

Lines changed: 25 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,12 @@
99

1010
#Gamestate, "none" for new game, or set to a specific section to start from the first save.
1111
#See the if statement tree below to determine starting position for Gamestate.
12-
Gamestate = "Macalania"
13-
StepCounter = 2
1412
#Gamestate = "Sin"
1513
#StepCounter = 3
16-
#Gamestate = "none"
14+
#Gamestate = "Djose"
1715
#StepCounter = 1
16+
Gamestate = "none"
17+
StepCounter = 1
1818

1919
#Game length. Full is the same as any%, short is about 35 minutes with memory manip.
2020
#gameLength = "short"
@@ -100,7 +100,7 @@ def reportGamestate():
100100
if Gamestate == "Luca" and StepCounter == 3: # after Oblitzerator, before Blitzball
101101
FFX_LoadGame.loadOffset(9)
102102
if Gamestate == "Luca" and StepCounter == 5: # After Blitzball, before battles.
103-
FFX_LoadGame.loadOffsetBattle(1)
103+
FFX_LoadGame.loadOffsetBattle(7)
104104
earlyHaste = 1
105105
#if Gamestate == "Luca" and StepCounter == 6: #After the talk with Auron
106106
# FFX_LoadGame.loadPostBlitz()
@@ -114,39 +114,39 @@ def reportGamestate():
114114
FFX_LoadGame.AfterGui()
115115
if Gamestate == "Djose" and StepCounter == 2: #Just before the Djose temple
116116
FFX_LoadGame.djoseTemple()
117-
if Gamestate == "Moonflow" and StepCounter == 2:
117+
if Gamestate == "Moonflow" and StepCounter == 2: #North bank, before Rikku
118118
FFX_LoadGame.moonflow2()
119119
if Gamestate == "Guadosalam" and StepCounter == 2: #After the Farplane
120120
FFX_LoadGame.loadGuadoSkip()
121121
if Gamestate == "Macalania" and StepCounter == 1: #1 = south, 2 = north
122-
FFX_LoadGame.loadOffset(5)
123-
if Gamestate == "Macalania" and StepCounter == 2: #1 = south, 2 = north
124122
FFX_LoadGame.loadOffset(6)
123+
if Gamestate == "Macalania" and StepCounter == 2: #1 = south, 2 = north
124+
FFX_LoadGame.loadOffset(7)
125125
if Gamestate == "Macalania" and StepCounter == 3: #between Spherimorph and Crawler. Move to lake
126126
FFX_LoadGame.loadMacLake()
127127
if Gamestate == "Macalania" and StepCounter == 4: #Right before Jyscal skip
128128
FFX_LoadGame.loadMacTemple()
129129
if Gamestate == "Macalania" and StepCounter == 5: #After Seymour, before trials
130130
FFX_LoadGame.loadMacTemple2()
131131
if Gamestate == "Macalania" and StepCounter == 6: #Outside temple, before escaping.
132-
FFX_LoadGame.loadOffset(10)
133-
time.sleep(2)
132+
FFX_LoadGame.loadOffset(15)
133+
time.sleep(0.5)
134134
FFXC.set_value('AxisLy', 1)
135135
time.sleep(1.5)
136136
FFXC.set_value('AxisLy', 0)
137137
time.sleep(0.5)
138138
if Gamestate == "Macalania" and StepCounter == 7: #Before Wendigo
139139
FFX_LoadGame.loadWendigo()
140140
if Gamestate == "Home" and StepCounter == 1:
141-
FFX_LoadGame.loadOffset(3)
141+
FFX_LoadGame.loadOffset(99)
142142
if Gamestate == "Home" and StepCounter == 2:
143-
FFX_LoadGame.loadOffset(2)
143+
FFX_LoadGame.loadOffset(4)
144144
if Gamestate == "rescueYuna" and StepCounter == 1: # Airship, before pathing to the deck
145145
FFX_LoadGame.loadRescue()
146146
if Gamestate == "rescueYuna" and StepCounter == 2: # Bevelle trials
147147
FFX_LoadGame.loadBahamut()
148148
if Gamestate == "rescueYuna" and StepCounter == 5: # Highbridge before Seymour Natus
149-
FFX_LoadGame.loadOffset(2)
149+
FFX_LoadGame.loadOffset(4)
150150
if Gamestate == "Gagazet" and StepCounter == 1: # Just before Calm Lands
151151
FFX_LoadGame.loadCalm()
152152
if Gamestate == "Gagazet" and StepCounter == 2: # Gagazet gates
@@ -163,8 +163,8 @@ def reportGamestate():
163163
FFX_LoadGame.loadOffset(1)
164164
if Gamestate == "Sin" and StepCounter == 2: #Save sphere on the Highbridge before talking to Shedinja
165165
FFX_LoadGame.loadOffset(22)
166-
if Gamestate == "Sin" and StepCounter == 3: #Before egg hunt
167-
FFX_LoadGame.loadOffset(46)
166+
if Gamestate == "Sin" and StepCounter == 3: #Before "inside sin" pathing
167+
FFX_LoadGame.loadOffset(2)
168168

169169

170170
#Movement files
@@ -516,13 +516,14 @@ def reportGamestate():
516516
FFX_rescueYuna.preEvrae()
517517
StepCounter = 1
518518
Gamestate = "rescueYuna"
519+
#Gamestate = "manualBreak" # Used for testing only.
519520

520521
if Gamestate == "rescueYuna" and StepCounter == 1:
521522
reportGamestate()
522523
FFX_rescueYuna.Evrae()
523524
FFX_rescueYuna.guards()
524525
StepCounter = 2
525-
Gamestate = "manualBreak" # Used for testing only.
526+
#Gamestate = "manualBreak" # Used for testing only.
526527

527528
if Gamestate == "rescueYuna" and StepCounter == 2:
528529
reportGamestate()
@@ -536,7 +537,8 @@ def reportGamestate():
536537

537538
if Gamestate == "rescueYuna" and StepCounter == 4:
538539
reportGamestate()
539-
gems = FFX_rescueYuna.evraeAltana()
540+
FFX_rescueYuna.evraeAltana()
541+
#Gamestate = "manualBreak" # Used for testing only.
540542
StepCounter = 5
541543

542544
if Gamestate == "rescueYuna" and StepCounter == 5:
@@ -545,6 +547,7 @@ def reportGamestate():
545547
StepCounter = 1
546548
Gamestate = "Gagazet"
547549
FFX_Logs.nextFile()
550+
#Gamestate = "manualBreak" # Used for testing only.
548551

549552
if Gamestate == "Gagazet" and StepCounter == 1:
550553
reportGamestate()
@@ -630,8 +633,10 @@ def reportGamestate():
630633
print("Time! The game is now over.")
631634

632635
except Exception as errMsg:
636+
print("--------------------------------------------------")
633637
print("Something went wrong during the run. Error:")
634638
print(errMsg)
639+
print("--------------------------------------------------")
635640
time.sleep(20)
636641
FFXC.set_value('AxisLx',0)
637642
FFXC.set_value('AxisLy',0)
@@ -655,6 +660,10 @@ def reportGamestate():
655660

656661

657662
FFX_memory.end()
663+
try:
664+
FFX_Screen.clickImage("stop_recording.JPG")
665+
except:
666+
print("Could not stop recording.")
658667

659668
print("Automation complete. Unplugging controller.")
660669
import Reset_Controller

FFX_Baaj.py

Lines changed: 40 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -40,39 +40,54 @@ def Entrance():
4040
print("Mark 2")
4141
FFXC.set_value('AxisLx', 0)
4242
FFXC.set_value('AxisLy', 0)
43-
FFX_Screen.clickToBattle()
4443

45-
#Once we lose control, just keep clicking until we regain control.
46-
FFX_Battle.attack('none')
47-
time.sleep(0.2)
48-
FFX_Screen.awaitTurn()
49-
FFX_Battle.attack('none')
50-
FFX_Screen.clickToBattle()
51-
while not FFX_memory.userControl():
44+
#Battles
45+
while FFX_memory.getStoryProgress() < 48:
5246
if FFX_Screen.BattleScreen():
53-
FFX_Battle.defend()
54-
else:
47+
if FFX_memory.getStoryProgress() == 44:
48+
FFX_Battle.attack('none')
49+
else:
50+
FFX_Battle.defend()
51+
elif FFX_memory.diagSkipPossible():
5552
FFX_Xbox.menuB()
5653

54+
#FFX_Battle.attack('none')
55+
#time.sleep(0.2)
56+
#FFX_Screen.awaitTurn()
57+
#FFX_Battle.attack('none')
58+
#FFX_Screen.clickToBattle()
59+
#while not FFX_memory.userControl():
60+
# if FFX_Screen.BattleScreen():
61+
# FFX_Battle.defend()
62+
# else:
63+
# FFX_Xbox.menuB()
64+
5765
#Out of the frying pan, into the furnace
66+
FFX_memory.awaitControl()
5867
pos = FFX_memory.getCoords()
5968
while FFX_memory.userControl():
6069
if pos[1] < 85:
70+
print("Path 1")
6171
FFXC.set_value('AxisLx', -1)
6272
FFXC.set_value('AxisLy', 0)
6373
elif pos[1] < 130:
74+
print("Path 2")
6475
FFXC.set_value('AxisLx', 0)
6576
FFXC.set_value('AxisLy', 1)
6677
elif pos[1] < 170:
78+
print("Path 3")
6779
FFXC.set_value('AxisLx', -1)
6880
FFXC.set_value('AxisLy', 1)
69-
elif pos[1] < 190:
81+
elif pos[1] < 180:
82+
print("Path 4")
7083
FFXC.set_value('AxisLx', 1)
7184
FFXC.set_value('AxisLy', 1)
72-
elif pos[1] < 225:
85+
elif pos[1] < 215:
86+
print("Path 5")
7387
FFXC.set_value('AxisLx', 0)
7488
FFXC.set_value('AxisLy', 1)
7589
else:
90+
print("Path 6")
7691
FFXC.set_value('AxisLx', -1)
7792
FFXC.set_value('AxisLy', 1)
7893
pos = FFX_memory.getCoords()
@@ -226,22 +241,12 @@ def ABswimming1() :
226241
complete = 0
227242

228243
print("Swimming towards airship")
229-
while complete == 0 :
244+
while FFX_memory.getMap() != 64 :
230245
pos = FFX_memory.getCoords()
231-
ffxMap = FFX_memory.getMap()
232-
#print(ffxMap)
233-
if not FFX_memory.userControl():
234-
FFXC.set_value('AxisLy', 0)
235-
FFXC.set_value('AxisLx', 0)
236-
FFXC.set_value('BtnA', 0)
237-
if FFX_Screen.BattleScreen() :
238-
FFX_Battle.stealAndAttack()
239-
else:
240-
if ffxMap == 71:
246+
if FFX_memory.userControl():
247+
if FFX_memory.getMap() == 71:
241248
FFXC.set_value('AxisLy', -1)
242249
FFXC.set_value('BtnA', 1)
243-
elif ffxMap == 64:
244-
complete = 1
245250
else:
246251
checkpoint = 1
247252
FFXC.set_value('AxisLy', 1)
@@ -250,6 +255,16 @@ def ABswimming1() :
250255
FFXC.set_value('AxisLx', 1)
251256
else:
252257
FFXC.set_value('AxisLx', 0)
258+
else:
259+
FFXC.set_value('AxisLy', 0)
260+
FFXC.set_value('AxisLx', 0)
261+
if FFX_Screen.BattleScreen() :
262+
print("Battle Start (Al Bhed swimming section)")
263+
FFX_Battle.stealAndAttack()
264+
print("Battle End (Al Bhed swimming section)")
265+
elif FFX_memory.menuOpen():
266+
print("Battle Complete screen")
267+
FFX_Xbox.menuB()
253268

254269
def ABswimming2() :
255270
#Quick heal-up to make sure we're full HP on Rikku

0 commit comments

Comments
 (0)