forked from coderwilson/FFX_TAS_Python
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathzz_eggHunt.py
65 lines (57 loc) · 1.85 KB
/
zz_eggHunt.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
import pyxinput
import time
import FFX_Xbox
import FFX_Battle
import FFX_Screen
import FFX_core
import FFX_memory
FFXC = FFX_Xbox.FFXC
selfAuto = True
if selfAuto == True:
print("Starting egg-hunt-only program.")
print("Waiting to initialize - waiting on New Game screen")
#---------- 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.
FFX_memory.start()
import FFX_LoadGame
FFX_LoadGame.loadOffset(37)
FFXC.set_value('AxisLy',1)
FFXC.set_value('AxisLx',1)
time.sleep(0.7)
FFXC.set_value('AxisLx',0)
time.sleep(34)
FFXC.set_value('AxisLy',0)
print("Start egg hunt only program")
print("--------------------------No-control method")
import zz_eggHuntAuto
zz_eggHuntAuto.engage()
else:
#Initiate memory reading, after we know the game is open.
print("Start egg hunt only program")
print("--------------------------No-control method")
FFX_memory.start()
import FFX_Logs
FFX_Logs.nextPlot()
waitCount = 0
while FFX_memory.getMap() == 324:
if FFX_memory.battleActive():
print("GTFO battle.")
FFX_Battle.fleeAll()
elif FFX_memory.menuOpen():
FFX_Xbox.menuB()
else:
waitCount += 1
if waitCount % 10 == 0:
print(waitCount)
cam = FFX_memory.getCamera()
FFX_Logs.writePlot(str(cam[0]) + "," + str(cam[4]))
else:
time.sleep(0.035)
if waitCount > 10000:
break