Skip to content

Commit c4b77c8

Browse files
authored
Merge pull request #10 from HannibalSnekter/main
Minor Updates to fix bugs
2 parents 4b01981 + 302ecd8 commit c4b77c8

File tree

4 files changed

+69
-26
lines changed

4 files changed

+69
-26
lines changed

FFX_Auto_Main.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -437,7 +437,7 @@ def reportGamestate():
437437
FFX_Logs.nextFile()
438438

439439
if Gamestate == "ThunderPlains" and StepCounter == 1:
440-
status = [False,False,False]
440+
status = [False,False,False,False]
441441
reportGamestate()
442442
status = FFX_ThunderPlains.southPathing(blitzWin)
443443
StepCounter = 2

FFX_Battle.py

Lines changed: 48 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1836,6 +1836,10 @@ def thunderPlains(status, section):
18361836
nadeSlot = FFX_memory.getUseItemsSlot(35)
18371837
print("Grenade Slot %d" % nadeSlot)
18381838

1839+
startingstatus = []
1840+
for i in range(len(status)):
1841+
startingstatus.append(status[i])
1842+
18391843
tidusturns = 0
18401844
wakkaturns = 0
18411845
auronturns = 0
@@ -1847,7 +1851,7 @@ def thunderPlains(status, section):
18471851
turnchar = FFX_memory.getBattleCharTurn()
18481852
rikkucharge = FFX_memory.getOverdriveValue(6)
18491853
if bNum == 152 or bNum == 155 or bNum == 162: # Any battle with Larvae
1850-
if status[2] == False:
1854+
if startingstatus[2] == False:
18511855
if turnchar == 0:
18521856
if tidusturns == 0:
18531857
rikkuposition = FFX_memory.getBattleCharSlot(6)
@@ -1857,6 +1861,7 @@ def thunderPlains(status, section):
18571861
tidusturns += 1
18581862
elif turnchar == 6:
18591863
Steal()
1864+
status[2] = True
18601865
else:
18611866
tidusposition = FFX_memory.getBattleCharSlot(0)
18621867
buddySwap_new(tidusposition)
@@ -1865,7 +1870,7 @@ def thunderPlains(status, section):
18651870
else:
18661871
fleeAll()
18671872
elif bNum == 160:
1868-
if status[1] == False:
1873+
if startingstatus[1] == False:
18691874
if turnchar == 0:
18701875
if tidusturns == 0:
18711876
defend()
@@ -1885,7 +1890,7 @@ def thunderPlains(status, section):
18851890
else:
18861891
fleeAll()
18871892
elif bNum == 161:
1888-
if status[1] == False and FFX_memory.getStoryProgress == 1375:
1893+
if startingstatus[1] == False and FFX_memory.getStoryProgress == 1375:
18891894
if turnchar == 0:
18901895
if tidusturns == 0:
18911896
rikkuposition = FFX_memory.getBattleCharSlot(6)
@@ -1907,19 +1912,22 @@ def thunderPlains(status, section):
19071912
else:
19081913
tidusposition = FFX_memory.getBattleCharSlot(0)
19091914
buddySwap_new(tidusposition)
1915+
wakkaturns += 1
19101916
elif turnchar == 6:
19111917
Steal()
19121918
status[1] = True
19131919
elif turnchar == 2:
1914-
if auronturns == 0:
1920+
rikkuposition = FFX_memory.getBattleCharSlot(6)
1921+
rikkuHP = FFX_memory.getBattleHP()[rikkuposition]
1922+
if rikkuHP > 0:
19151923
defend()
19161924
else:
19171925
tidusposition = FFX_memory.getBattleCharSlot(0)
19181926
buddySwap_new(tidusposition)
19191927
auronturns += 1
19201928
else:
19211929
fleeAll()
1922-
elif status[3] == False and speedcount < 14 and section == 2:
1930+
elif startingstatus[3] == False and speedcount < 14 and section == 2:
19231931
if turnchar == 0:
19241932
if tidusturns == 0:
19251933
rikkuposition = FFX_memory.getBattleCharSlot(6)
@@ -1928,30 +1936,37 @@ def thunderPlains(status, section):
19281936
tidusFlee()
19291937
tidusturns += 1
19301938
elif turnchar == 4:
1931-
wakkaposition = FFX_memory.getBattleCharSlot(4)
1932-
rikkuposition = FFX_memory.getBattleCharSlot(6)
1933-
wakkaHP = FFX_memory.getBattleHP()[wakkaposition]
1934-
rikkuHP = FFX_memory.getBattleHP()[rikkuposition]
1935-
if wakkaHP > rikkuHP > 0 and rikkucharge < 100:
1936-
defend()
1939+
if wakkaturns == 0:
1940+
wakkaposition = FFX_memory.getBattleCharSlot(4)
1941+
rikkuposition = FFX_memory.getBattleCharSlot(6)
1942+
wakkaHP = FFX_memory.getBattleHP()[wakkaposition]
1943+
rikkuHP = FFX_memory.getBattleHP()[rikkuposition]
1944+
if wakkaHP > rikkuHP > 0 and rikkucharge < 100:
1945+
defend()
1946+
else:
1947+
tidusposition = FFX_memory.getBattleCharSlot(0)
1948+
buddySwap_new(tidusposition)
19371949
else:
19381950
tidusposition = FFX_memory.getBattleCharSlot(0)
19391951
buddySwap_new(tidusposition)
1952+
wakkaturns += 1
19401953
elif turnchar == 6:
19411954
grenadeslot = FFX_memory.getUseItemsSlot(35)
19421955
print("Grenade Slot %d" % grenadeslot)
19431956
useItem(grenadeslot,'none')
19441957
status[3] = True
19451958
elif turnchar == 2:
1946-
if auronturns == 0:
1959+
rikkuposition = FFX_memory.getBattleCharSlot(6)
1960+
rikkuHP = FFX_memory.getBattleHP()[rikkuposition]
1961+
if rikkuHP > 0:
19471962
defend()
19481963
else:
19491964
tidusposition = FFX_memory.getBattleCharSlot(0)
19501965
buddySwap_new(tidusposition)
19511966
auronturns += 1
19521967
else:
19531968
fleeAll()
1954-
elif status[1] == False:
1969+
elif startingstatus[1] == False:
19551970
if turnchar == 0:
19561971
if tidusturns == 0:
19571972
rikkuposition = FFX_memory.getBattleCharSlot(6)
@@ -1960,20 +1975,27 @@ def thunderPlains(status, section):
19601975
tidusFlee()
19611976
tidusturns += 1
19621977
elif turnchar == 4:
1963-
wakkaposition = FFX_memory.getBattleCharSlot(4)
1964-
rikkuposition = FFX_memory.getBattleCharSlot(6)
1965-
wakkaHP = FFX_memory.getBattleHP()[wakkaposition]
1966-
rikkuHP = FFX_memory.getBattleHP()[rikkuposition]
1967-
if wakkaHP > rikkuHP > 0 and rikkucharge < 100:
1968-
defend()
1978+
if wakkaturns == 0:
1979+
wakkaposition = FFX_memory.getBattleCharSlot(4)
1980+
rikkuposition = FFX_memory.getBattleCharSlot(6)
1981+
wakkaHP = FFX_memory.getBattleHP()[wakkaposition]
1982+
rikkuHP = FFX_memory.getBattleHP()[rikkuposition]
1983+
if wakkaHP > rikkuHP > 0 and rikkucharge < 100:
1984+
defend()
1985+
else:
1986+
tidusposition = FFX_memory.getBattleCharSlot(0)
1987+
buddySwap_new(tidusposition)
19691988
else:
19701989
tidusposition = FFX_memory.getBattleCharSlot(0)
19711990
buddySwap_new(tidusposition)
1991+
wakkaturns += 1
19721992
elif turnchar == 6:
19731993
Steal()
19741994
status[1] = True
19751995
elif turnchar == 2:
1976-
if auronturns == 0:
1996+
rikkuposition = FFX_memory.getBattleCharSlot(6)
1997+
rikkuHP = FFX_memory.getBattleHP()[rikkuposition]
1998+
if rikkuHP > 0:
19771999
defend()
19782000
else:
19792001
tidusposition = FFX_memory.getBattleCharSlot(0)
@@ -1990,7 +2012,7 @@ def thunderPlains(status, section):
19902012
else:
19912013
fleeAll()
19922014
elif bNum == 154 or bNum == 156 or bNum == 164:
1993-
if status[3] == False and speedcount < 10 and section == 2 and FFX_memory.getStoryProgress == 1375:
2015+
if startingstatus[3] == False and speedcount < 10 and section == 2 and FFX_memory.getStoryProgress == 1375:
19942016
if turnchar == 0:
19952017
if tidusturns == 0:
19962018
rikkuposition = FFX_memory.getBattleCharSlot(6)
@@ -2180,6 +2202,10 @@ def mWoods(woodsVars):
21802202
StealDown()
21812203
elif battleNum == 171 and woodsVars[1] == False:
21822204
StealRight()
2205+
else:
2206+
attack('none')
2207+
else:
2208+
escapeOne()
21832209
elif woodsVars[1] == False or woodsVars[2] == False:
21842210
if battleNum == 175 and woodsVars[2] == False:
21852211
if turnchar == 0:
@@ -4260,7 +4286,6 @@ def isaaru():
42604286

42614287

42624288
def altanaheal():
4263-
direction = "up"
42644289

42654290
if FFX_memory.getThrowItemsSlot(2) < 255:
42664291
itemnum = 2
@@ -4304,9 +4329,8 @@ def altanaheal():
43044329
FFX_Xbox.menuDown()
43054330
cursor += 2
43064331
FFX_Xbox.menuB()
4307-
print("Direction: ", direction)
4308-
FFX_Xbox.menuUp()
43094332

4333+
FFX_Xbox.menuUp()
43104334
FFX_Xbox.menuB()
43114335
FFX_Xbox.menuB()
43124336

FFX_MRR.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ def arrival():
108108
FFX_Xbox.menuB()
109109
hpCheck = FFX_memory.getHP()
110110
print(hpCheck)
111-
if hpCheck[0] != 520 or hpCheck[5] != 644 or hpCheck[4] != 1030:
111+
if hpCheck[0] != 520 or hpCheck[3] != 644 or hpCheck[2] != 1030:
112112
FFX_Battle.healUp(3)
113113
else:
114114
print("No need to heal up. Moving onward.")

FFX_memory.py

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -357,6 +357,22 @@ def getBattleNum():
357357
#print("Battle Number: ", formation)
358358
return formation
359359

360+
def getActiveBattleFormation():
361+
global baseValue
362+
363+
key = baseValue + 0x00F3F76C
364+
char1 = process.readBytes(key, 1)
365+
key = baseValue + 0x00F3F76E
366+
char2 = process.readBytes(key, 1)
367+
key = baseValue + 0x00F3F770
368+
char3 = process.readBytes(key, 1)
369+
370+
battleForm = [char1, char2, char3]
371+
if 255 in battleForm:
372+
while 255 in battleForm:
373+
battleForm.remove(255)
374+
return battleForm
375+
360376
def getBattleFormation():
361377
global baseValue
362378

@@ -1206,6 +1222,9 @@ def desertFormat(rikkuCharge):
12061222
def partySize():
12071223
return len(getBattleFormation())
12081224

1225+
def activepartySize():
1226+
return len(getActiveBattleFormation())
1227+
12091228
def fullPartyFormat_New(frontLine, menusize):
12101229
partyMembers = 7
12111230
frontLine = frontLine.lower()

0 commit comments

Comments
 (0)