-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy patharenaPrep.py
3549 lines (3323 loc) · 125 KB
/
arenaPrep.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
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
import battle.boss
import battle.main
import memory.main
import menu
import nemesis.arenaSelect
import nemesis.menu
import nemesis.targetPath
import rng_track
import save_sphere
import screen
import vars
import xbox
game_vars = vars.vars_handle()
FFXC = xbox.controller_handle()
# The following functions extend the regular Bahamut run. Farming sections.
def auto_life():
while not (memory.main.turn_ready() and screen.turn_tidus()):
if memory.main.turn_ready():
if screen.turn_aeon():
battle.main.attack("none")
elif not screen.turn_tidus():
battle.main.defend()
while memory.main.battle_menu_cursor() != 22:
if screen.turn_tidus() == False:
print("Attempting Auto-life, but it's not Tidus's turn")
xbox.tap_up()
xbox.tap_up()
return
if memory.main.battle_menu_cursor() == 1:
xbox.tap_up()
else:
xbox.tap_down()
while not memory.main.other_battle_menu():
xbox.tap_b()
memory.main._navigate_to_position(1)
while memory.main.other_battle_menu():
xbox.tap_b()
xbox.tap_b()
xbox.tap_b()
xbox.tap_b()
xbox.tap_b()
xbox.tap_b()
# Default to Besaid. Maybe based on map number?
def air_ship_destination(dest_num=0, force_omega=False):
while not memory.main.get_map() in [382, 999]:
if memory.main.user_control():
nemesis.targetPath.set_movement([-251, 340])
else:
FFXC.set_neutral()
xbox.menu_b()
while memory.main.diag_progress_flag() != 4:
xbox.tap_b()
print("Destination select on screen now.")
while memory.main.map_cursor() != dest_num:
if dest_num < 8:
xbox.tap_down()
else:
xbox.tap_up()
xbox.tap_b()
memory.main.wait_frames(2)
xbox.tap_b()
while not memory.main.user_control():
if memory.main.cutscene_skip_possible():
xbox.skip_scene()
elif memory.main.diag_skip_possible():
xbox.tap_b()
def unlock_omega():
if game_vars.csr():
return
while not memory.main.get_map() in [382, 999]:
if memory.main.user_control():
nemesis.targetPath.set_movement([-251, 340])
else:
FFXC.set_neutral()
if memory.main.diag_progress_flag() == 4:
xbox.menu_a()
else:
xbox.menu_b()
while memory.main.diag_progress_flag() != 3:
xbox.tap_up()
while memory.main.diag_progress_flag() != 0:
xbox.tap_b()
while memory.main.diag_progress_flag() == 0:
print(memory.main.get_coords())
if memory.main.get_coords()[0] < 65:
FFXC.set_value("d_pad", 8)
if memory.main.get_coords()[0] < 70:
nemesis.menu.grid_right()
elif memory.main.get_coords()[0] > 78:
FFXC.set_value("d_pad", 4)
elif memory.main.get_coords()[0] > 73:
nemesis.menu.grid_left()
elif memory.main.get_coords()[1] > -28:
FFXC.set_value("d_pad", 2)
elif memory.main.get_coords()[1] > -34:
nemesis.menu.grid_down()
elif memory.main.get_coords()[1] < -40:
FFXC.set_value("d_pad", 1)
elif memory.main.get_coords()[1] < -37:
nemesis.menu.grid_up()
else:
xbox.menu_b()
memory.main.wait_frames(30)
xbox.menu_b()
while not memory.main.get_map() in [194, 374]:
xbox.menu_a()
def get_save_sphere_details():
return memory.main.get_save_sphere_details()
def get_save_sphere_details_old():
map_val = memory.main.get_map()
story_val = memory.main.get_story_progress()
print("Map:", map_val, "| Story:", story_val)
x = 0
y = 0
diag = 0
if map_val == 322:
# Inside Sin, next to airship
x = 225
y = -250
diag = 15
if map_val == 19:
# Besaid beach
x = -310
y = -475
diag = 55
if map_val == 263:
# Thunder Plains agency
x = -30
y = -10
diag = 114
if map_val == 307:
# Monster Arena
x = 4
y = 5
diag = 166
if map_val == 98:
# Kilika docks
x = 46
y = -252
diag = 34
if map_val == 92:
# MRR start
x = -1
y = -740
diag = 43
if map_val == 266:
# Calm Lands Gorge
x = -310
y = 190
diag = 43
if map_val == 82:
# Djose temple
x = 100
y = -240
diag = 89
if map_val == 221:
# Macalania Woods, near Spherimorph
x = 197
y = -120
diag = 23
if map_val == 137:
# Bikanel Desert
x = -15
y = 240
diag = 31
if map_val == 313:
# Zanarkand campfire
x = 135
y = -1
diag = 4
if map_val == 327:
# Sin, end zone
x = -37
y = -508
diag = 10
if map_val == 258:
# Omega (only used in Nemesis)
x = -112
y = -1066
diag = 23
if map_val == 259:
# Gagazet (only used in Nemesis)
x = -59
y = 99
diag = 219
if map_val == 128:
# MRR upper lift (only used in Nemesis)
x = 230
y = 140
diag = 68
print("Values: [", x, ",", y, "] - ", diag)
return [x, y, diag]
def return_to_airship():
print("Attempting Return to Airship")
ss_details = get_save_sphere_details()
if memory.main.get_map() == 307: # Monster arena
while not nemesis.targetPath.set_movement([-4, -3]):
pass
save_sphere.approach_save_sphere()
FFXC.set_neutral()
while memory.main.save_menu_cursor() != 1:
FFXC.set_neutral()
xbox.menu_down()
memory.main.wait_frames(1)
xbox.menu_b()
memory.main.await_control()
print("Return to Airship Complete.")
memory.main.clear_save_menu_cursor()
memory.main.clear_save_menu_cursor_2()
def battle_farm_all(ap_cp_limit: int = 255, yuna_attack=True, fayth_cave=True):
print("### Battle Start:", memory.main.get_encounter_id())
FFXC.set_neutral()
if fayth_cave == True and memory.main.battle_type() == 2:
screen.await_turn()
battle.main.flee_all()
else:
while memory.main.battle_active():
if memory.main.turn_ready():
if screen.turn_tidus():
if memory.main.get_encounter_id() in [154, 156, 164]:
# Confusion is a dumb mechanic in this game.
battle.main.attack_by_num(22, "l")
elif memory.main.get_encounter_id() == 281:
battle.main.attack_by_num(22, "r")
elif memory.main.get_encounter_id() == 283:
battle.main.attack_by_num(21, "u")
elif memory.main.get_encounter_id() == 284:
battle.main.attack_by_num(23, "d")
else:
battle.main.attack("none")
elif screen.turn_yuna():
if yuna_attack:
if memory.main.get_encounter_id() in [154, 156, 164]:
# Confusion is a dumb mechanic in this game.
battle.main.attack_by_num(22, "l")
elif memory.main.get_encounter_id() == 281:
battle.main.attack_by_num(21, "l")
elif memory.main.get_encounter_id() == 283:
battle.main.attack_by_num(22, "d")
elif memory.main.get_encounter_id() == 284:
battle.main.attack_by_num(22, "d")
else:
battle.main.attack("none")
else:
battle.main.escape_one()
elif screen.turn_rikku() or screen.turn_wakka():
if not battle.main.check_tidus_ok():
battle.main.escape_one()
elif memory.main.get_encounter_id() == 219:
battle.main.escape_one()
else:
battle.main.defend()
else:
battle.main.escape_one()
memory.main.click_to_control()
if float(memory.main.get_hp()[0]) / float(memory.main.get_max_hp()[0]) < 0.4:
battle.main.heal_up(3)
nemesis.menu.perform_next_grid(limit=ap_cp_limit)
def advanced_complete_check():
encounter_id = memory.main.get_encounter_id()
arenaArray = memory.main.arena_array()
# Common monsters
if False:
pass
# Inside Sin
elif encounter_id == 374: # Ahriman
print("For this battle, count:", arenaArray[37])
if arenaArray[37] == 10:
return True
elif encounter_id in [375, 380]: # Exoray (with a bonus Ahriman)
print("For this battle, count:", arenaArray[93])
if arenaArray[93] == 10 and arenaArray[37] == 10:
return True
elif encounter_id in [376, 381]: # Adamantoise
print("For this battle, count:", arenaArray[81])
if arenaArray[81] == 10:
return True
elif encounter_id in [377, 382]: # Both kinds of Gemini
print("For this battle, count:", arenaArray[77])
print("For this battle, count:", arenaArray[78])
if arenaArray[77] == 10 and arenaArray[78] == 10:
return True
elif encounter_id in [378, 384]: # Behemoth King
print("For this battle, count:", arenaArray[70])
if arenaArray[70] == 10:
return True
elif encounter_id == 383: # Demonolith
print("For this battle, count:", arenaArray[75])
if arenaArray[75] == 10:
return True
elif encounter_id == 385: # Great Malboro
print("For this battle, count:", arenaArray[56])
if arenaArray[56] == 10:
return True
elif encounter_id == 386: # Barbatos
print("For this battle, count:", arenaArray[90])
if arenaArray[90] == 10:
return True
elif encounter_id == 387: # Wraith
print("For this battle, count:", arenaArray[97])
if arenaArray[97] == 10:
return True
# Omega dungeon
elif encounter_id == 421: # Master Coeurl and Floating Death
print("For this battle, count:", arenaArray[74])
print("For this battle, count:", arenaArray[102])
if arenaArray[74] == 10 and arenaArray[102] == 10:
return True
elif encounter_id == 422: # Halma and Spirit
print("For this battle, count:", arenaArray[96])
print("For this battle, count:", arenaArray[101])
if arenaArray[96] == 10 and arenaArray[101] == 10:
return True
elif encounter_id == 423: # Zaurus and Floating Death
print("For this battle, count:", arenaArray[100])
print("For this battle, count:", arenaArray[102])
if arenaArray[100] == 10 and arenaArray[102] == 10:
return True
elif encounter_id == 424: # Black Element and Spirit
print("For this battle, count:", arenaArray[67])
print("For this battle, count:", arenaArray[96])
if arenaArray[67] == 10 and arenaArray[96] == 10:
return True
elif encounter_id == 425: # Varuna
print("For this battle, count:", arenaArray[82])
if arenaArray[82] == 10:
return True
elif encounter_id == 426: # Master Tonberry
print("For this battle, count:", arenaArray[99])
if arenaArray[99] == 10:
return True
elif encounter_id == 428: # Machea (blade thing)
print("For this battle, count:", arenaArray[103])
if arenaArray[103] == 10:
return True
elif encounter_id == 430: # Demonolith x2
print("For this battle, count:", arenaArray[75])
if arenaArray[75] == 10:
return True
elif encounter_id in [432, 433, 434, 435, 436]: # Just Zaurus
print("For this battle, count:", arenaArray[100])
if arenaArray[100] == 10:
return True
elif encounter_id == 437: # Puroboros
print("For this battle, count:", arenaArray[95])
if arenaArray[95] == 10:
return True
elif encounter_id == 438: # Wraith
print("For this battle, count:", arenaArray[97])
if arenaArray[97] == 10:
return True
# Other
if encounter_id in [429, 445]:
# Rock monsters, just leave.
return True
if encounter_id == 383:
# Demonolith inside Sin, not worth.
return True
if encounter_id == 427:
# Adamantoise in Omega, dealt with inside Sin
return True
return False
def advanced_battle_logic():
print("### Battle Start:", memory.main.get_encounter_id())
print("### Ambush flag (2 is bad):", memory.main.battle_type())
while not memory.main.turn_ready():
pass
autoLifeUsed = False
FFXC.set_neutral()
if memory.main.battle_type() == 2:
print(">>>>Ambushed! Escaping!")
battle.main.tidus_flee()
elif advanced_complete_check():
print(">>>>Complete collecting this monster.")
battle.main.tidus_flee()
else:
if memory.main.get_encounter_id() == 449:
# Omega himself, not yet working.
aeonComplete = False
while memory.main.battle_active():
if memory.main.turn_ready():
if screen.turn_rikku():
if not aeonComplete:
battle.main.buddy_swap_yuna()
battle.main.aeon_summon(4)
else:
battle.main.defend()
elif screen.turn_yuna():
battle.main.buddy_swap_rikku()
elif screen.turn_tidus():
battle.main.use_skill(1) # Quick hit
else:
battle.main.defend()
else:
print("---Regular battle:", memory.main.get_encounter_id())
sleepPowder = False
while memory.main.battle_active():
encounter_id = memory.main.get_encounter_id()
if memory.main.turn_ready():
if encounter_id in [442]:
# Damned malboros in Omega
battle.main.buddy_swap_yuna()
battle.main.aeon_summon(4)
battle.main.attack("none")
elif screen.turn_tidus():
if memory.main.get_encounter_id() in [386] and not autoLifeUsed:
auto_life()
autoLifeUsed = True
elif (
encounter_id == 383
and memory.main.get_enemy_current_hp()[0] > 9999
):
if memory.main.get_use_items_slot(41) < 100:
battle.main.use_item_tidus(
memory.main.get_use_items_slot(41)
)
else:
battle.main.use_skill(1)
elif (
encounter_id == 426
and memory.main.get_enemy_current_hp()[0] > 9999
):
if memory.main.get_use_items_slot(41) < 100:
battle.main.use_item_tidus(
memory.main.get_use_items_slot(41)
)
else:
battle.main.use_skill(1)
elif (
encounter_id == 430
and memory.main.get_enemy_current_hp()[0] > 9999
):
if memory.main.get_use_items_slot(41) < 100:
battle.main.use_item_tidus(
memory.main.get_use_items_slot(41)
)
else:
battle.main.use_skill(1)
elif (
encounter_id == 437
and memory.main.get_enemy_current_hp()[0] > 9999
):
if memory.main.get_use_items_slot(41) < 100:
battle.main.use_item_tidus(
memory.main.get_use_items_slot(41)
)
else:
battle.main.use_skill(1)
elif encounter_id == 431:
battle.main.tidus_flee()
else:
battle.main.use_skill(1) # Quick hit
elif screen.turn_rikku():
if encounter_id in [377, 382]:
print(
"Shining Gems for Gemini, better to save other items for other enemies."
)
# Double Gemini, two different locations
if memory.main.get_use_items_slot(42) < 100:
battle.main.use_item(
memory.main.get_use_items_slot(42), rikku_flee=True
)
else:
battle.main.defend()
elif encounter_id == 386:
# Armor bomber guys
if memory.main.get_use_items_slot(41) < 100:
battle.main.use_item(
memory.main.get_use_items_slot(41), rikku_flee=True
)
else:
battle.main.defend()
elif encounter_id in [430]:
# Demonolith
if memory.main.get_use_items_slot(41) < 100:
battle.main.use_item(
memory.main.get_use_items_slot(41), rikku_flee=True
)
else:
battle.main.defend()
elif encounter_id == 422:
# Provoke on Spirit
battle.main.use_special(
position=3, target=21, direction="u"
)
if memory.main.get_use_items_slot(41) < 100:
battle.main.use_item(
memory.main.get_use_items_slot(41), rikku_flee=True
)
else:
battle.main.defend()
elif encounter_id == 424:
# Provoke on Spirit
battle.main.use_special(
position=3, target=21, direction="r"
)
elif (
encounter_id == 425
and memory.main.get_enemy_current_hp()[0] > 9999
):
# Varuna, use purifying salt to remove haste
# Safety potions are fun.
battle.main.use_item(
memory.main.get_use_items_slot(63), rikku_flee=True
)
elif encounter_id == 426:
# Master Tonberry
if not sleepPowder:
battle.main.use_item(
memory.main.get_use_items_slot(37), rikku_flee=True
)
else:
if memory.main.get_use_items_slot(41) < 100:
battle.main.use_item_tidus(
memory.main.get_use_items_slot(41)
)
else:
battle.main.defend()
elif encounter_id == 431:
battle.main.tidus_flee()
elif (
encounter_id == 437
and memory.main.get_enemy_current_hp()[0] > 9999
):
if not sleepPowder:
battle.main.use_item(
memory.main.get_use_items_slot(37), rikku_flee=True
)
else:
if memory.main.get_use_items_slot(41) < 100:
battle.main.use_item_tidus(
memory.main.get_use_items_slot(41)
)
else:
battle.main.defend()
else:
battle.main.defend()
else:
battle.main.defend()
memory.main.click_to_control()
memory.main.full_party_format("initiative")
nemesis.menu.perform_next_grid()
if float(memory.main.get_hp()[0]) / float(memory.main.get_max_hp()[0]) < 0.3:
battle.main.heal_up(3)
def bribe_battle(spare_change_value: int = 12000):
while memory.main.battle_active():
if memory.main.turn_ready():
if screen.turn_lulu():
while memory.main.battle_menu_cursor() != 20:
if memory.main.battle_menu_cursor() == 0:
xbox.tap_down()
else:
xbox.tap_up()
if game_vars.use_pause():
memory.main.wait_frames(6)
memory.main.wait_frames(8)
xbox.tap_b()
memory.main.wait_frames(8)
xbox.tap_b()
memory.main.wait_frames(8)
battle.main.calculate_spare_change_movement(spare_change_value)
while memory.main.spare_change_open():
xbox.tap_b()
xbox.tap_b()
xbox.tap_b()
else:
battle.main.buddy_swap_lulu()
print("Battle is complete.")
while not memory.main.menu_open():
pass
FFXC.set_value("btn_b", 1)
memory.main.wait_frames(150)
FFXC.set_value("btn_b", 0)
print("Now back in control.")
def arena_npc():
memory.main.await_control()
if memory.main.get_map() != 307:
return
while not (
memory.main.diag_progress_flag() == 74 and memory.main.diag_skip_possible()
):
if memory.main.user_control():
if memory.main.get_coords()[1] > -12:
FFXC.set_movement(0, -1)
memory.main.wait_frames(1)
else:
nemesis.targetPath.set_movement([2, -15])
xbox.tap_b()
else:
FFXC.set_neutral()
if memory.main.diag_progress_flag() == 59:
xbox.menu_a()
xbox.menu_a()
xbox.menu_a()
xbox.tap_b()
elif memory.main.diag_skip_possible():
xbox.tap_b()
print("Mark 1")
memory.main.wait_frames(30) # This buffer can be improved later.
print("Mark 2")
def arena_return(checkpoint: int = 0):
if checkpoint == 0:
air_ship_destination(dest_num=12)
# menu.equip_armor(character=game_vars.neArmor(),ability=0x801D)
while memory.main.get_map() != 307:
if memory.main.user_control():
if checkpoint == 2:
while memory.main.user_control():
nemesis.targetPath.set_movement([-641, -268])
xbox.tap_b()
FFXC.set_neutral()
checkpoint += 1
elif nemesis.targetPath.set_movement(
nemesis.targetPath.arena_return(checkpoint)
):
checkpoint += 1
print("Checkpoint reached: ", checkpoint)
else:
FFXC.set_neutral()
if memory.main.diag_skip_possible():
xbox.tap_b()
def transition():
memory.main.click_to_control()
return_to_airship()
memory.main.await_control()
menu.add_ability(
owner=0,
equipment_type=0,
ability_array=[0x807A, 255, 255, 255],
ability_index=0x8001,
slotcount=2,
navigateToEquipMenu=True,
fullMenuClose=True,
)
def kilika_shop():
arena_npc()
xbox.tap_a()
xbox.tap_b()
memory.main.wait_frames(60)
arena_npc()
xbox.tap_a()
xbox.tap_b()
arena_npc()
# xbox.tapDown()
# xbox.tapDown()
# xbox.tap_b()
# memory.wait_frames(30)
# xbox.tap_b() #Buy
# memory.wait_frames(30)
# getEquipment(equip=False) #Tidus second catcher weapon
# xbox.menuA()
# memory.wait_frames(30)
# xbox.menuA()
# memory.wait_frames(30)
xbox.menu_a()
xbox.tap_b() # Exit
memory.main.wait_frames(60)
while not nemesis.targetPath.set_movement([-6, -23]):
pass
while not nemesis.targetPath.set_movement([0, -3]):
pass
return_to_airship()
memory.main.await_control()
# menu.equip_weapon(character=0,ability=0x807A, fullMenuClose=False)
air_ship_destination(dest_num=2)
while not nemesis.targetPath.set_movement([-25, -246]):
pass
while not nemesis.targetPath.set_movement([-47, -209]):
pass
while not nemesis.targetPath.set_movement([-91, -199]):
pass
while not nemesis.targetPath.set_movement([-108, -169]):
pass
while memory.main.user_control():
FFXC.set_movement(-1, 0)
xbox.tap_b()
FFXC.set_neutral() # Now talking to vendor
memory.main.wait_frames(60)
xbox.tap_b() # Intro dialog
memory.main.wait_frames(60)
xbox.tap_b() # Buy equipment
memory.main.wait_frames(60)
# getEquipment(equip=False) #Weapon for Yuna
xbox.tap_down()
xbox.tap_down()
xbox.tap_down()
xbox.tap_down()
xbox.tap_down()
xbox.tap_down()
get_equipment(equip=True) # Weapon for Rikku
xbox.tap_down()
get_equipment(equip=True) # Armor for Tidus
xbox.tap_down()
get_equipment(equip=True) # Armor for Yuna
xbox.tap_down()
get_equipment(equip=True) # Armor for Wakka
xbox.tap_down()
xbox.tap_down()
xbox.tap_down()
get_equipment(equip=True) # Armor for Wakka
xbox.tap_down()
get_equipment(equip=True) # Armor for Rikku
memory.main.close_menu()
menu.add_ability(
owner=6,
equipment_type=0,
ability_array=[0x800B, 0x8000, 255, 255],
ability_index=0x8001,
slotcount=4,
navigateToEquipMenu=True,
fullMenuClose=True,
)
menu.add_ability(
owner=0,
equipment_type=1,
ability_array=[0x8072, 255, 255, 255],
ability_index=0x8056,
slotcount=4,
navigateToEquipMenu=True,
fullMenuClose=True,
)
while not nemesis.targetPath.set_movement([-91, -199]):
pass
while not nemesis.targetPath.set_movement([-47, -209]):
pass
while not nemesis.targetPath.set_movement([-25, -246]):
pass
while not nemesis.targetPath.set_movement([29, -252]):
pass
return_to_airship()
def od_to_ap(): # Calm Lands purchases
arena_return()
arena_npc()
xbox.tap_a()
xbox.tap_b()
arena_npc()
xbox.tap_a()
xbox.tap_b()
arena_npc()
xbox.tap_a()
xbox.tap_b()
arena_npc()
xbox.tap_a()
xbox.tap_b()
arena_npc()
xbox.tap_down()
xbox.tap_down()
xbox.tap_b()
memory.main.wait_frames(60)
xbox.tap_b()
memory.main.wait_frames(6)
xbox.tap_b()
memory.main.wait_frames(6)
xbox.tap_up()
xbox.tap_b()
memory.main.wait_frames(6)
xbox.tap_up()
xbox.tap_b()
print("Now to sell items.")
memory.main.wait_frames(6)
xbox.menu_a()
memory.main.wait_frames(6)
xbox.tap_right()
xbox.menu_b()
print("Should now be attempting to sell items.")
menu.sell_all()
xbox.menu_a()
memory.main.wait_frames(60)
xbox.tap_a()
memory.main.wait_frames(60)
xbox.tap_a()
memory.main.wait_frames(60)
xbox.tap_a()
xbox.tap_b()
menu.auto_sort_equipment(manual="n")
menu.add_ability(
owner=0,
equipment_type=0,
ability_array=[0x807A, 255, 255, 255],
ability_index=0x8011,
slotcount=2,
navigateToEquipMenu=True,
exitOutOfCurrentWeapon=True,
closeMenu=True,
fullMenuClose=False,
)
menu.equip_weapon(character=0, ability=0x8011)
xbox.tap_up()
xbox.tap_up()
xbox.tap_up()
menu.tidus_slayer()
memory.main.await_control()
FFXC.set_movement(-1, 0)
memory.main.wait_frames(30)
return_to_airship()
def farm_feathers():
arena_npc()
nemesis.arenaSelect.arena_menu_select(1)
nemesis.arenaSelect.start_fight(area_index=7, monster_index=5)
memory.main.wait_frames(1)
wait_counter = 0
while memory.main.battle_active():
if memory.main.turn_ready():
if screen.turn_rikku():
print("+++ Qactar steal command")
battle.main.steal()
print("+++ Qactar steal command done")
elif screen.turn_tidus():
print("+++ Qactar flee command")
battle.main.tidus_flee()
print("+++ Qactar flee command done")
else:
print("+++ Qactar defend command")
battle.main.defend()
print("+++ Qactar defend command done")
wait_counter += 1
if wait_counter % 10 == 0:
print("Waiting for next turn: ", wait_counter)
print("Battle is complete.")
while not memory.main.menu_open():
pass
# memory.wait_frames(300)
FFXC.set_value("btn_b", 1)
memory.main.wait_frames(150)
FFXC.set_value("btn_b", 0)
print("Now back in control.")
nemesis.arenaSelect.arena_menu_select(4)
def auto_phoenix(): # Calm Lands items
menu.auto_sort_equipment()
nemesis.menu.lulu_bribe()
arena_npc()
nemesis.arenaSelect.arena_menu_select(1)
nemesis.arenaSelect.start_fight(area_index=7, monster_index=0)
bribe_battle()
nemesis.arenaSelect.arena_menu_select(4)
memory.main.full_party_format("initiative")
arena_npc()
nemesis.arenaSelect.arena_menu_select(1)
nemesis.arenaSelect.start_fight(area_index=7, monster_index=0)
bribe_battle()
nemesis.arenaSelect.arena_menu_select(4)
memory.main.full_party_format("initiative")
arena_npc()
nemesis.arenaSelect.arena_menu_select(1)
nemesis.arenaSelect.start_fight(area_index=7, monster_index=0)
bribe_battle()
nemesis.arenaSelect.arena_menu_select(4)
memory.main.full_party_format("initiative")
arena_npc()
while memory.main.get_item_count_slot(memory.main.get_item_slot(7)) != 99:
print("Trying to obtain mega-phoenix downs")
nemesis.arenaSelect.arena_menu_select(4)
arena_npc()
nemesis.arenaSelect.arena_menu_select(2) # Equipment menu
memory.main.wait_frames(90)
xbox.tap_right()
xbox.menu_b() # Sell
menu.sell_all()
memory.main.wait_frames(3)
xbox.tap_a()
memory.main.wait_frames(90)
xbox.tap_a()
memory.main.wait_frames(90)
xbox.tap_a()
xbox.tap_b()
menu.auto_sort_equipment() # This to make sure equipment is in the right place
menu.add_ability(
owner=4,
equipment_type=1,
ability_array=[0x8072, 255, 255, 255],
ability_index=0x800A,
slotcount=4,
navigateToEquipMenu=True,
exitOutOfCurrentWeapon=True,
closeMenu=True,
fullMenuClose=False,
)
memory.main.wait_frames(30)
initArray = memory.main.check_ability(ability=0x8002)
print("Initiative weapons: ", initArray)
if initArray[4]:
menu.add_ability(
owner=6,
equipment_type=1,
ability_array=[0x8072, 255, 255, 255],
ability_index=0x800A,
slotcount=4,
navigateToEquipMenu=True,
exitOutOfCurrentWeapon=True,
closeMenu=True,
fullMenuClose=False,
)
menu.equip_weapon(character=4, ability=0x8002) # Initiative
memory.main.close_menu()
else:
menu.add_ability(
owner=6,
equipment_type=1,
ability_array=[0x8072, 255, 255, 255],
ability_index=0x800A,
slotcount=4,
navigateToEquipMenu=True,
exitOutOfCurrentWeapon=True,
closeMenu=True,
fullMenuClose=True,
)
memory.main.close_menu()
featherSlot = memory.main.get_item_slot(item_num=54)
if featherSlot == 255 or memory.main.get_item_count_slot(featherSlot) < 6:
while (
featherSlot == 255 or memory.main.get_item_count_slot(featherSlot) < 6
):
farm_feathers()
featherSlot = memory.main.get_item_slot(item_num=54)
menu.add_ability(
owner=6,
equipment_type=0,
ability_array=[0x800B, 0x8000, 0x8001, 255],
ability_index=0x8002,
slotcount=4,
navigateToEquipMenu=True,
exitOutOfCurrentWeapon=True,
closeMenu=True,
fullMenuClose=True,
)
FFXC.set_movement(-1, 0)
memory.main.wait_frames(15)
FFXC.set_movement(0, 1)
memory.main.wait_frames(15)
FFXC.set_neutral()
memory.main.full_party_format("initiative")
return_to_airship()
# menu.equip_armor(character=0,ability=0x8056) #Auto-Haste
menu.equip_armor(character=4, ability=0x800A) # Auto-Phoenix
menu.equip_armor(character=6, ability=0x800A) # Auto-Phoenix
if not game_vars.ne_armor() in [0, 4, 6]:
menu.equip_armor(character=game_vars.ne_armor(), ability=99) # Unequip
memory.main.close_menu()
def restock_downs():
print("Restocking phoenix downs")
arena_npc()
nemesis.arenaSelect.arena_menu_select(3)