diff options
Diffstat (limited to 'Taiji.asl')
-rw-r--r-- | Taiji.asl | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/Taiji.asl b/Taiji.asl index 3505a86..9752860 100644 --- a/Taiji.asl +++ b/Taiji.asl | |||
@@ -2,6 +2,7 @@ state("Taiji") | |||
2 | { | 2 | { |
3 | // v9.10.2022 | 3 | // v9.10.2022 |
4 | int solveCount: "GameAssembly.dll", 0x0168ED88, 0x80, 0x100, 0xD94; | 4 | int solveCount: "GameAssembly.dll", 0x0168ED88, 0x80, 0x100, 0xD94; |
5 | byte10 worldsCompleted: "GameAssembly.dll", 0x015C8010, 0x48, 0x40, 0x80, 0x290, 0xB8, 0x10, 0x20; | ||
5 | } | 6 | } |
6 | 7 | ||
7 | startup | 8 | startup |
@@ -10,19 +11,36 @@ startup | |||
10 | print("[Taiji ASL] " + logLine); | 11 | print("[Taiji ASL] " + logLine); |
11 | }); | 12 | }); |
12 | 13 | ||
14 | settings.Add("solveCount", true, "Split on solve count increasing"); | ||
15 | settings.Add("world", false, "Split on completing a world"); | ||
16 | |||
13 | vars.log("Autosplitter loaded"); | 17 | vars.log("Autosplitter loaded"); |
14 | } | 18 | } |
15 | 19 | ||
16 | onStart | 20 | onStart |
17 | { | 21 | { |
18 | vars.maxSolve = 0; | 22 | vars.maxSolve = 0; |
23 | vars.numWorlds = 0; | ||
19 | } | 24 | } |
20 | 25 | ||
21 | split | 26 | split |
22 | { | 27 | { |
23 | if (current.solveCount > vars.maxSolve) { | 28 | if (settings["solveCount"] && current.solveCount > vars.maxSolve) { |
24 | vars.log(String.Format("Solve count increased from {0} to {1}", vars.maxSolve, current.solveCount)); | 29 | vars.log(String.Format("Solve count increased from {0} to {1}", vars.maxSolve, current.solveCount)); |
25 | vars.maxSolve = current.solveCount; | 30 | vars.maxSolve = current.solveCount; |
26 | return true; | 31 | return true; |
27 | } | 32 | } |
33 | if (settings["world"]) { | ||
34 | int curWorlds = 0; | ||
35 | foreach (byte b in current.worldsCompleted) { | ||
36 | if (b == 1) { | ||
37 | curWorlds += 1; | ||
38 | } | ||
39 | } | ||
40 | if (curWorlds > vars.numWorlds) { | ||
41 | vars.log(String.Format("World count increased from {0} to {1}", vars.numWorlds, curWorlds)); | ||
42 | vars.numWorlds = curWorlds; | ||
43 | return true; | ||
44 | } | ||
45 | } | ||
28 | } | 46 | } |