forked from coderwilson/FFX_TAS_Python
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathFFX_Auto_Main.py
670 lines (579 loc) · 22 KB
/
FFX_Auto_Main.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
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
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
# Libraries and Core Files
import time
import FFX_Logs
#import FFX_core
import FFX_Screen
import FFX_Battle
import FFX_Xbox
FFXC = FFX_Xbox.FFXC
#Gamestate, "none" for new game, or set to a specific section to start from the first save.
#See the if statement tree below to determine starting position for Gamestate.
#Gamestate = "Sin"
#StepCounter = 3
#Gamestate = "Djose"
#StepCounter = 1
Gamestate = "none"
StepCounter = 1
#Game length. Full is the same as any%, short is about 35 minutes with memory manip.
#gameLength = "short"
gameLength = "full"
forceBlitzWin = True
autoEggHunt = True
print("Game type will be: ", gameLength)
#--------------------------------------------------------------------------------------
tasFinalHit = 0 #TAS-only, final hit will be this character number
#--------------------------------------------------------------------------------------
#Other variables
speedCount = 0
strengthCount = 0
endGameVersion = 0
gems = 0 #Set to 2 if loading in after Evrae Altana with two gems
earlyTidusGrid = False
if forceBlitzWin == True:
blitzWin = True
else:
blitzWin = False
#Main functions
def reportGamestate():
global Gamestate
global StepCounter
logText = "Gamestate: " + Gamestate + " : StepCounter: " + str(StepCounter)
FFX_Logs.writeLog(logText + "\n")
FFX_Screen.clearMouse(0)
#Main
print("FFX automation starting")
FFX_Logs.nextFile()
FFX_Logs.nextStats()
print("Please launch the game now.")
#time.sleep(5)
#print("Now attempting to activate FFX window")
reportGamestate()
#Press Start until the main menu comes up
#---------- MAKE SURE THIS IS ON FOR A FRESH RUN --------------------
while not FFX_Screen.PixelTest(1076,552,(157, 159, 157)):
FFXC.set_value('BtnStart', 1)
time.sleep(0.1)
FFXC.set_value('BtnStart', 0)
print("Game start screen")
FFX_Screen.clearMouse(0)
#Initiate memory reading, after we know the game is open.
import FFX_memory
FFX_memory.start()
#Next, check if we are loading to a save file
if Gamestate != "none" :
FFX_Logs.writeLog("Loading to a specific gamestate.\n")
startTime = FFX_Logs.timeStamp()
FFX_Logs.writeStats("Start time:")
FFX_Logs.writeStats(str(startTime))
reportGamestate()
import FFX_LoadGame
if Gamestate == "Baaj" and StepCounter == 1:
FFX_LoadGame.LoadBaaj()
if Gamestate == "Baaj" and StepCounter == 5:
FFX_LoadGame.LoadFirst()
if Gamestate == "Besaid" and StepCounter == 1 : #Save pop-up after falling off of Rikku's boat
FFX_LoadGame.loadOffset(45)
if Gamestate == "Besaid" and StepCounter == 2 : #Crusader's lodge before trials start
FFX_LoadGame.BesaidTrials()
if Gamestate == "Besaid" and StepCounter == 3 : #Crusader's lodge after "Enough, Wakka!"
FFX_LoadGame.loadOffset(25)
if Gamestate == "Boat1" : #Besaid beach before boarding SS Liki ( nice alliteration :D )
FFX_LoadGame.Boat1()
if Gamestate == "Kilika" and StepCounter == 1: #Just after entering the woods
FFX_LoadGame.loadOffset(22)
if Gamestate == "Kilika" and StepCounter == 3: #Temple save sphere before scene with Donna
FFX_LoadGame.KilikaTrials()
if Gamestate == "Luca" and StepCounter == 1: # Approaching Luca via boat
FFX_LoadGame.loadOffset(37)
if Gamestate == "Luca" and StepCounter == 3: # after Oblitzerator, before Blitzball
FFX_LoadGame.loadOffset(9)
if Gamestate == "Luca" and StepCounter == 5: # After Blitzball, before battles.
FFX_LoadGame.loadOffsetBattle(7)
earlyHaste = 1
#if Gamestate == "Luca" and StepCounter == 6: #After the talk with Auron
# FFX_LoadGame.loadPostBlitz()
if Gamestate == "Miihen" and StepCounter == 1: #After the talk with Auron
FFX_LoadGame.LoadMiihenStart()
if Gamestate == "MRR" and StepCounter == 1: #Mi'ihen North after meeting Seymour
FFX_LoadGame.LoadMRR()
if Gamestate == "MRR" and StepCounter == 2: #Just before the last lift to the battle site
FFX_LoadGame.LoadMRR2()
if Gamestate == "Djose" and StepCounter == 1: # Aftermath, after talking to Seymour and then Auron
FFX_LoadGame.AfterGui()
if Gamestate == "Djose" and StepCounter == 2: #Just before the Djose temple
FFX_LoadGame.djoseTemple()
if Gamestate == "Moonflow" and StepCounter == 2: #North bank, before Rikku
FFX_LoadGame.moonflow2()
if Gamestate == "Guadosalam" and StepCounter == 2: #After the Farplane
FFX_LoadGame.loadGuadoSkip()
if Gamestate == "Macalania" and StepCounter == 1: #1 = south, 2 = north
FFX_LoadGame.loadOffset(6)
if Gamestate == "Macalania" and StepCounter == 2: #1 = south, 2 = north
FFX_LoadGame.loadOffset(7)
if Gamestate == "Macalania" and StepCounter == 3: #between Spherimorph and Crawler. Move to lake
FFX_LoadGame.loadMacLake()
if Gamestate == "Macalania" and StepCounter == 4: #Right before Jyscal skip
FFX_LoadGame.loadMacTemple()
if Gamestate == "Macalania" and StepCounter == 5: #After Seymour, before trials
FFX_LoadGame.loadMacTemple2()
if Gamestate == "Macalania" and StepCounter == 6: #Outside temple, before escaping.
FFX_LoadGame.loadOffset(15)
time.sleep(0.5)
FFXC.set_value('AxisLy', 1)
time.sleep(1.5)
FFXC.set_value('AxisLy', 0)
time.sleep(0.5)
if Gamestate == "Macalania" and StepCounter == 7: #Before Wendigo
FFX_LoadGame.loadWendigo()
if Gamestate == "Home" and StepCounter == 1:
FFX_LoadGame.loadOffset(99)
if Gamestate == "Home" and StepCounter == 2:
FFX_LoadGame.loadOffset(4)
if Gamestate == "rescueYuna" and StepCounter == 1: # Airship, before pathing to the deck
FFX_LoadGame.loadRescue()
if Gamestate == "rescueYuna" and StepCounter == 2: # Bevelle trials
FFX_LoadGame.loadBahamut()
if Gamestate == "rescueYuna" and StepCounter == 5: # Highbridge before Seymour Natus
FFX_LoadGame.loadOffset(4)
if Gamestate == "Gagazet" and StepCounter == 1: # Just before Calm Lands
FFX_LoadGame.loadCalm()
if Gamestate == "Gagazet" and StepCounter == 2: # Gagazet gates
FFX_LoadGame.loadGagaGates()
if Gamestate == "Gagazet" and StepCounter == 3: # Just before Seymour Flux
FFX_LoadGame.LoadNeutral()
if Gamestate == "Gagazet" and StepCounter == 4: # After the dream
FFX_LoadGame.loadGagazetDream()
if Gamestate == "Zanarkand" and StepCounter == 1: # Intro scene revisited
FFX_LoadGame.zanEntrance()
if Gamestate == "Zanarkand" and StepCounter == 2: # Just before the trials.
FFX_LoadGame.zanTrials()
if Gamestate == "Zanarkand" and StepCounter == 4: # After Sanctuary Keeper
FFX_LoadGame.loadOffset(1)
if Gamestate == "Sin" and StepCounter == 2: #Save sphere on the Highbridge before talking to Shedinja
FFX_LoadGame.loadOffset(22)
if Gamestate == "Sin" and StepCounter == 3: #Before "inside sin" pathing
FFX_LoadGame.loadOffset(2)
#Movement files
import FFX_DreamZan
if gameLength != "short":
import FFX_Baaj
import FFX_Besaid1
import FFX_Besaid2
import FFX_Boats
import FFX_Kilika
import FFX_Luca
import FFX_Blitz
import FFX_Miihen
import FFX_MRR
import FFX_Djose
import FFX_Moonflow
import FFX_Guadosalam
import FFX_ThunderPlains
import FFX_mWoods
import FFX_mTemple
import FFX_home
import FFX_rescueYuna
import FFX_Gagazet
import FFX_Zanarkand
import FFX_Sin
try:
#Start of the game, start of Dream Zanarkand section
if Gamestate == "none" and StepCounter == 1:
reportGamestate()
Gamestate = "DreamZan"
time.sleep(0.5)
FFX_DreamZan.NewGame(gameLength)
startTime = FFX_Logs.timeStamp()
FFX_Logs.writeStats("Start time:")
FFX_Logs.writeStats(str(startTime))
print("Timer starts now.")
FFX_DreamZan.listenStory()
#Start of the game, up through Sinspawn Ammes fight
StepCounter = 2
if Gamestate == "DreamZan" and StepCounter == 2:
reportGamestate()
FFX_Battle.Ammes()
#Finishes Sinspawn Ammes fight
StepCounter = 3
reportGamestate()
if Gamestate == "DreamZan" and StepCounter == 3:
FFX_DreamZan.AfterAmmes()
#Sin drops us near Baaj temple.
StepCounter = 4
reportGamestate()
if Gamestate == "DreamZan" and StepCounter == 4:
if gameLength == "short":
FFX_DreamZan.SwimToJecht_shortGame()
Gamestate = "shortGame"
StepCounter = 1
else:
FFX_DreamZan.SwimToJecht()
Gamestate = "Baaj"
StepCounter = 1
if Gamestate == "shortGame" and StepCounter == 1:
#Only for the short game. Run these pieces then skip down to the last Sin section.
#If not a short game, continue as regular to the Baaj sections.
import FFX_cheater_cheese
FFX_cheater_cheese.BaajEntrance()
FFX_cheater_cheese.sphereGrid()
FFX_cheater_cheese.items()
FFX_cheater_cheese.BackToSin()
FFX_Sin.insideSin(gameLength, autoEggHunt)
FFX_Battle.BFA_TASonly(tasFinalHit)
Gamestate = "gameOver"
stepCounter = 999
if Gamestate == "Baaj" and StepCounter == 1 :
reportGamestate()
print ("Starting Baaj temple section")
FFX_Baaj.Entrance()
StepCounter = 2
if Gamestate == "Baaj" and StepCounter == 2 :
reportGamestate()
FFX_Baaj.Baaj_puzzle()
StepCounter = 3
#Gamestate = "manualBreak" # Used for testing only.
if Gamestate == "Baaj" and StepCounter == 3 :
FFX_Baaj.Klikk_fight()
StepCounter = 4
reportGamestate()
if Gamestate == "Baaj" and StepCounter == 4:
#Klikk fight done. Now to wait for the Al Bhed ship.
print("Al Bhed boat part 1")
FFX_Baaj.ABboat1()
StepCounter = 5
if Gamestate == "Baaj" and StepCounter == 5:
reportGamestate()
FFX_Baaj.ABswimming1()
StepCounter = 6
reportGamestate()
if Gamestate == "Baaj" and StepCounter == 6:
print("Underwater Airship section")
FFX_Baaj.ABswimming2()
Gamestate = "Besaid"
StepCounter = 1
reportGamestate()
if Gamestate == "Besaid" and StepCounter == 1 :
reportGamestate()
FFX_Besaid1.Beach()
FFX_Besaid1.swimming1()
FFX_Besaid1.enteringVillage()
StepCounter = 2
reportGamestate()
if Gamestate == "Besaid" and StepCounter == 2 :
FFX_Besaid2.trials()
FFX_Besaid2.aeonAndSleep()
StepCounter = 3
reportGamestate()
if Gamestate == "Besaid" and StepCounter == 3 :
earlyTidusGrid = FFX_Besaid2.leaving()
FFX_Besaid2.waterfalls()
Gamestate = "Boat1"
StepCounter = 1
reportGamestate()
if Gamestate == "Boat1" :
reportGamestate()
FFX_Boats.ssLiki(earlyTidusGrid)
FFX_Kilika.arrival()
Gamestate = "Kilika"
if Gamestate == "Kilika" and StepCounter == 1 :
reportGamestate()
FFX_Kilika.forest1()
FFX_Kilika.forest2()
reportGamestate()
#speedCount += FFX_Kilika.forest2()
#print ("Speed spheres: ",speedCount)
StepCounter = 2
FFX_Kilika.Geneaux()
StepCounter = 3
if Gamestate == "Kilika" and StepCounter == 3 :
reportGamestate()
FFX_Kilika.trials()
StepCounter = 4
if Gamestate == "Kilika" and StepCounter == 4 :
reportGamestate()
FFX_Kilika.forest3()
StepCounter = 5
if Gamestate == "Kilika" and StepCounter == 5 :
reportGamestate()
FFX_Kilika.departure()
StepCounter = 1
Gamestate = "Boat2"
FFX_Logs.nextFile()
if Gamestate == "Boat2" :
reportGamestate()
FFX_Boats.ssWinno()
Gamestate = "Luca"
if Gamestate == "Luca" and StepCounter == 1:
reportGamestate()
FFX_Luca.arrival()
FFX_Luca.followYuna()
StepCounter = 2
if Gamestate == "Luca" and StepCounter == 2:
reportGamestate()
earlyHaste = FFX_Luca.preBlitz()
StepCounter = 3
if Gamestate == "Luca" and StepCounter == 3:
reportGamestate()
FFX_Luca.blitzStart()
StepCounter = 4
if Gamestate == "Luca" and StepCounter == 4:
reportGamestate()
blitzWin = FFX_Blitz.blitzMain(forceBlitzWin)
FFX_Screen.awaitSave()
StepCounter = 5
if Gamestate == "Luca" and StepCounter == 5:
reportGamestate()
FFX_Luca.afterBlitz(earlyHaste)
StepCounter = 1
Gamestate = "Miihen"
#Gamestate = "manualBreak" # Used for testing only.
if Gamestate == "Miihen" and StepCounter == 1:
reportGamestate()
selfDestruct = FFX_Miihen.arrival()
FFX_Miihen.midPoint()
print("End of Miihen mid point section.")
FFX_Miihen.lowRoad(selfDestruct)
StepCounter = 2
if Gamestate == "Miihen" and StepCounter == 2:
reportGamestate()
FFX_Miihen.wrapUp()
StepCounter = 1
Gamestate = "MRR"
FFX_Logs.nextFile()
if Gamestate == "MRR" and StepCounter == 1:
reportGamestate()
wakkaLateMenu = FFX_MRR.arrival()
FFX_MRR.mainPath(wakkaLateMenu)
StepCounter = 2
#Gamestate = "manualBreak" # Used for testing only.
if Gamestate == "MRR" and StepCounter == 2:
reportGamestate()
success = FFX_MRR.battleSite()
if success == 2:
Gamestate = "Error"
reportGamestate()
time.sleep(90)
if success == 1:
Gamestate = "Djose"
StepCounter = 1
FFX_Logs.nextFile()
if Gamestate == "Djose" and StepCounter == 1:
reportGamestate()
FFX_Djose.path()
StepCounter = 2
if Gamestate == "Djose" and StepCounter == 2:
reportGamestate()
FFX_Djose.temple()
FFX_Djose.trials()
StepCounter = 3
if Gamestate == "Djose" and StepCounter == 3:
reportGamestate()
FFX_Djose.leavingDjose()
StepCounter = 1
Gamestate = "Moonflow"
if Gamestate == "Moonflow" and StepCounter == 1:
reportGamestate()
FFX_Moonflow.arrival()
FFX_Moonflow.southBank()
StepCounter = 2
if Gamestate == "Moonflow" and StepCounter == 2:
reportGamestate()
FFX_Moonflow.northBank()
StepCounter = 1
Gamestate = "Guadosalam"
if Gamestate == "Guadosalam" and StepCounter == 1:
reportGamestate()
FFX_Guadosalam.arrival()
FFX_Guadosalam.afterSpeech()
StepCounter = 2
if Gamestate == "Guadosalam" and StepCounter == 2:
reportGamestate()
FFX_Guadosalam.guadoSkip()
StepCounter = 1
Gamestate = "ThunderPlains"
FFX_Logs.nextFile()
if Gamestate == "ThunderPlains" and StepCounter == 1:
status = [False,False,False,False]
reportGamestate()
status = FFX_ThunderPlains.southPathing(blitzWin)
StepCounter = 2
if Gamestate == "ThunderPlains" and StepCounter == 2:
FFX_ThunderPlains.agency(blitzWin)
StepCounter = 3
if Gamestate == "ThunderPlains" and StepCounter == 3:
status = FFX_ThunderPlains.northPathing(status)
rikkucharged = status[0]
Gamestate = "Macalania"
StepCounter = 1
if Gamestate == "Macalania" and StepCounter == 1:
reportGamestate()
FFX_mWoods.arrival(rikkucharged)
StepCounter = 2
if Gamestate == "Macalania" and StepCounter == 2:
reportGamestate()
FFX_mWoods.lakeRoad()
StepCounter = 3
if Gamestate == "Macalania" and StepCounter == 3:
reportGamestate()
FFX_mWoods.lake()
FFX_mWoods.afterCrawler()
StepCounter = 4
#Gamestate = "manualBreak" # Used for testing only.
if Gamestate == "Macalania" and StepCounter == 4:
reportGamestate()
FFX_mTemple.arrival(blitzWin)
StepCounter = 5
if Gamestate == "Macalania" and StepCounter == 5:
reportGamestate()
FFX_mTemple.trials()
#Gamestate = "manualBreak" # Used for testing only.
StepCounter = 6
if Gamestate == "Macalania" and StepCounter == 6:
reportGamestate()
FFX_mTemple.escape()
StepCounter = 7
#Gamestate = "manualBreak" # Used for testing only.
if Gamestate == "Macalania" and StepCounter == 7:
FFX_mTemple.underLake()
StepCounter = 1
Gamestate = "Home"
#Gamestate = "manualBreak" # Used for testing only.
if Gamestate == "Home" and StepCounter == 1:
reportGamestate()
FFX_home.desert1()
StepCounter = 2
#Gamestate = "manualBreak" # Used for testing only.
if Gamestate == "Home" and StepCounter == 2:
reportGamestate()
FFX_home.findSummoners(blitzWin)
FFX_rescueYuna.preEvrae()
StepCounter = 1
Gamestate = "rescueYuna"
#Gamestate = "manualBreak" # Used for testing only.
if Gamestate == "rescueYuna" and StepCounter == 1:
reportGamestate()
FFX_rescueYuna.Evrae()
FFX_rescueYuna.guards()
StepCounter = 2
#Gamestate = "manualBreak" # Used for testing only.
if Gamestate == "rescueYuna" and StepCounter == 2:
reportGamestate()
FFX_rescueYuna.trials()
StepCounter = 3
if Gamestate == "rescueYuna" and StepCounter == 3:
reportGamestate()
FFX_rescueYuna.ViaPurifico()
StepCounter = 4
if Gamestate == "rescueYuna" and StepCounter == 4:
reportGamestate()
FFX_rescueYuna.evraeAltana()
#Gamestate = "manualBreak" # Used for testing only.
StepCounter = 5
if Gamestate == "rescueYuna" and StepCounter == 5:
reportGamestate()
FFX_rescueYuna.seymourNatus(blitzWin)
StepCounter = 1
Gamestate = "Gagazet"
FFX_Logs.nextFile()
#Gamestate = "manualBreak" # Used for testing only.
if Gamestate == "Gagazet" and StepCounter == 1:
reportGamestate()
FFX_Gagazet.calmLands(blitzWin)
FFX_Gagazet.defenderX()
StepCounter = 2
if Gamestate == "Gagazet" and StepCounter == 2:
reportGamestate()
endGameVersion = FFX_Gagazet.gagazetGates(blitzWin)
FFX_Gagazet.afterFlux()
StepCounter = 3
#In case we're loading mid game...
if endGameVersion == 0:
endGameVersion = 4
# 1 = two Return spheres, two Friend spheres
# 2 = two Return spheres, two Friend spheres
# 3 = Game over (four Friend spheres)
# 4 = four Return spheres
if Gamestate == "Gagazet" and StepCounter == 3:
reportGamestate()
FFX_Gagazet.dream()
StepCounter = 4
if Gamestate == "Gagazet" and StepCounter == 4:
reportGamestate()
FFX_Gagazet.cave()
FFX_Gagazet.wrapUp()
StepCounter = 1
Gamestate = "Zanarkand"
if Gamestate == "Zanarkand" and StepCounter == 1:
reportGamestate()
FFX_Zanarkand.arrival()
StepCounter = 2
if Gamestate == "Zanarkand" and StepCounter == 2:
reportGamestate()
FFX_Zanarkand.trials()
StepCounter = 3
if Gamestate == "Zanarkand" and StepCounter == 3:
reportGamestate()
if endGameVersion == 0:
endGameVersion = 1 #Used during segmented testing.
# 4 == four Return spheres
# 3 == four Friend spheres
# 1 or 2 == two of each.
FFX_Zanarkand.sanctuaryKeeper(endGameVersion)
StepCounter = 4
if Gamestate == "Zanarkand" and StepCounter == 4:
reportGamestate()
FFX_Zanarkand.yunalesca()
StepCounter = 1
Gamestate = "Sin"
if Gamestate == "Sin" and StepCounter == 1:
reportGamestate()
FFX_Sin.makingPlans()
StepCounter = 2
print("Mark1")
if Gamestate == "Sin" and StepCounter == 2:
reportGamestate()
FFX_Sin.Shedinja()
#FFX_Sin.auronWeap()
FFX_Sin.facingSin()
StepCounter = 3
print("Mark2")
if Gamestate == "Sin" and StepCounter == 3:
reportGamestate()
FFX_Sin.insideSin(gameLength, autoEggHunt)
FFX_Battle.BFA()
StepCounter = 4
print("Mark3")
#print("Waiting for Yu Yevon to die.")
#time.sleep(6)
print("Time! The game is now over.")
except Exception as errMsg:
print("--------------------------------------------------")
print("Something went wrong during the run. Error:")
print(errMsg)
print("--------------------------------------------------")
time.sleep(20)
FFXC.set_value('AxisLx',0)
FFXC.set_value('AxisLy',0)
FFXC.set_value('BtnB',0)
FFXC.set_value('BtnA',0)
FFXC.set_value('BtnX',0)
FFXC.set_value('BtnY',0)
FFXC.set_value('Dpad', 0)
FFXC.set_value('BtnShoulderL', 0)
FFXC.set_value('BtnShoulderR', 0)
endTime = FFX_Logs.timeStamp()
FFX_Logs.writeStats("End time:")
FFX_Logs.writeStats(str(endTime))
totalTime = endTime - startTime
FFX_Logs.writeStats("Total time:")
FFX_Logs.writeStats(str(totalTime))
print("The game duration was: ", str(totalTime))
time.sleep(10)
FFX_memory.end()
try:
FFX_Screen.clickImage("stop_recording.JPG")
except:
print("Could not stop recording.")
print("Automation complete. Unplugging controller.")
import Reset_Controller
print("Unplugging complete. Shutting it down! Have a great day!")