about summary refs log tree commit diff stats
path: root/Lingo.asl
diff options
context:
space:
mode:
Diffstat (limited to 'Lingo.asl')
-rw-r--r--Lingo.asl50
1 files changed, 31 insertions, 19 deletions
diff --git a/Lingo.asl b/Lingo.asl index f53eee9..2916ad9 100644 --- a/Lingo.asl +++ b/Lingo.asl
@@ -13,12 +13,15 @@ startup
13 print("[Lingo ASL] " + logLine); 13 print("[Lingo ASL] " + logLine);
14 }); 14 });
15 15
16 settings.Add("every",false,"Split on every panel solve");
16 settings.Add("end", false, "Split on The End"); 17 settings.Add("end", false, "Split on The End");
17 settings.Add("unchallenged", false, "Split on The Unchallenged"); 18 settings.Add("unchallenged", false, "Split on The Unchallenged");
18 settings.Add("master", false, "Split on The Master"); 19 settings.Add("master", false, "Split on The Master");
19 settings.Add("pilgrimage", false, "Split on Pilgrimage"); 20 settings.Add("pilgrimage", false, "Split on Pilgrimage");
20 settings.Add("showLastPanel",false, "Override first text component with the name of the most recently solved panel"); 21 settings.Add("showLastPanel",false, "Override first text component with the name of the most recently solved panel");
21 22
23 vars.prevPanel = "";
24
22 vars.log("Autosplitter loaded"); 25 vars.log("Autosplitter loaded");
23} 26}
24 27
@@ -40,7 +43,7 @@ init
40 throw new Exception("Could not find magic autosplitter array!"); 43 throw new Exception("Could not find magic autosplitter array!");
41 } 44 }
42 vars.firstInput = new MemoryWatcher<byte>(ptr + 8); 45 vars.firstInput = new MemoryWatcher<byte>(ptr + 8);
43 vars.lastPanel = new StringWatcher(ptr + 9, 32); 46 vars.panel = new StringWatcher(ptr + 9, 32);
44 47
45 vars.log(String.Format("Magic autosplitter array: {0}", ptr.ToString("X"))); 48 vars.log(String.Format("Magic autosplitter array: {0}", ptr.ToString("X")));
46 49
@@ -61,10 +64,10 @@ init
61update 64update
62{ 65{
63 vars.firstInput.Update(game); 66 vars.firstInput.Update(game);
64 vars.lastPanel.Update(game); 67 vars.panel.Update(game);
65 68
66 if (settings["showLastPanel"] && vars.updateText && vars.lastPanel.Old != vars.lastPanel.Current) { 69 if (settings["showLastPanel"] && vars.updateText && vars.panel.Old != vars.panel.Current) {
67 vars.tcs.Text2 = vars.lastPanel.Current; 70 vars.tcs.Text2 = vars.panel.Current;
68 } 71 }
69} 72}
70 73
@@ -75,6 +78,8 @@ start
75 78
76onStart 79onStart
77{ 80{
81 vars.prevPanel = vars.panel.Current;
82
78 if (settings["showLastPanel"] && vars.updateText) { 83 if (settings["showLastPanel"] && vars.updateText) {
79 vars.tcs.Text1 = "Last Panel:"; 84 vars.tcs.Text1 = "Last Panel:";
80 vars.tcs.Text2 = ""; 85 vars.tcs.Text2 = "";
@@ -83,20 +88,27 @@ onStart
83 88
84split 89split
85{ 90{
86 if (settings["end"] && vars.lastPanel.Old != "Panel_end_end" && vars.lastPanel.Current == "Panel_end_end") { 91 if (vars.panel.Current != vars.prevPanel) {
87 vars.log("Split on The End"); 92 string action = "NO SPLIT";
88 return true; 93
89 } 94 if (settings["every"]) {
90 if (settings["unchallenged"] && vars.lastPanel.Old == "Panel_challenged_unchallenged" && vars.lastPanel.Current == "Panel_challenged_unchallenged") { 95 action = "SPLIT";
91 vars.log("Split on The Unchallenged"); 96 vars.log("Split on any panel: " + vars.panel.Current);
92 return true; 97 } else if (settings["end"] && vars.panel.Current == "Panel_end_end") {
93 } 98 action = "SPLIT";
94 if (settings["master"] && vars.lastPanel.Old == "Panel_master_master" && vars.lastPanel.Current == "Panel_master_master") { 99 vars.log("Split on The End");
95 vars.log("Split on The Master"); 100 } else if (settings["unchallenged"] && vars.panel.Current == "Panel_challenged_unchallenged") {
96 return true; 101 action = "SPLIT";
97 } 102 vars.log("Split on The Unchallenged");
98 if (settings["pilgrimage"] && vars.lastPanel.Old == "Panel_pilgrim" && vars.lastPanel.Current == "Panel_pilgrim") { 103 } else if (settings["master"] && vars.panel.Current == "Panel_master_master") {
99 vars.log("Split on Pilgrimage"); 104 action = "SPLIT";
100 return true; 105 vars.log("Split on The Master");
106 } else if (settings["pilgrimage"] && vars.panel.Current == "Panel_pilgrim") {
107 action = "SPLIT";
108 vars.log("Split on Pilgrimage");
109 }
110
111 vars.prevPanel = vars.panel.Current;
112 return action.StartsWith("SPLIT");
101 } 113 }
102} 114}