-
Notifications
You must be signed in to change notification settings - Fork 0
/
SS-stage-autosplitter-nyutie.asl
188 lines (169 loc) · 6.56 KB
/
SS-stage-autosplitter-nyutie.asl
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
state("ThankYouVeryCool-Win64-Shipping", "epic patch 5.5") {
float levelTimer: 0x5E33E00, 0x118, 0xB64;
bool isOnMainMenu: 0x5BFE7B8, 0x460, 0x3F0, 0x320;
int stage: 0x5E33E00, 0x118, 0xD80, 0x2E0, 0x360;
uint isFFx4WhenLevelIsNewType: 0x5E33E00, 0x118, 0xD80, 0x2E0, 0x398;
}
state("ThankYouVeryCool-Win64-Shipping", "gog patch 5.5") {
float levelTimer: 0x5B7E1C0, 0x118, 0xB64;
bool isOnMainMenu: 0x5B7A860, 0x8, 0x8, 0x1F0, 0x18;
int stage: 0x5B7E1C0, 0x118, 0xD80, 0x2E0, 0x360;
uint isFFx4WhenLevelIsNewType: 0x5B7E1C0, 0x118, 0xD80, 0x2E0, 0x398;
}
state("ThankYouVeryCool-Win64-Shipping", "steam patch 5.1") {
float levelTimer: 0x5B1A2C0, 0x118, 0xB64;
bool isOnMainMenu: 0x59D2C60, 0x2190, 0x0, 0xEA0, 0x27C;
int stage: 0x5B1A2C0, 0x118, 0xD80, 0x2E0, 0x360;
uint isFFx4WhenLevelIsNewType: 0x5B1A2C0, 0x118, 0xD80, 0x2E0, 0x398; // I know, it's dirty but it works. if you got a better way dm me
}
state("ThankYouVeryCool-Win64-Shipping", "steam patch 5.2") {
float levelTimer: 0x5B1A300, 0x118, 0xB64;
bool isOnMainMenu: 0x59D2CA0, 0x8F0, 0xA0, 0x3E0, 0x320;
int stage: 0x5B1A300, 0x118, 0xD80, 0x2E0, 0x360;
uint isFFx4WhenLevelIsNewType: 0x5B1A300, 0x118, 0xD80, 0x2E0, 0x398;
}
state("ThankYouVeryCool-Win64-Shipping", "steam patch 5.3") {
float levelTimer: 0x5B28C00, 0x118, 0xB64;
bool isOnMainMenu: 0x59E15A0, 0xF70, 0xA0, 0x3E0, 0x320;
int stage: 0x5B28C00, 0x118, 0xD80, 0x2E0, 0x360;
uint isFFx4WhenLevelIsNewType: 0x5B28C00, 0x118, 0xD80, 0x2E0, 0x398;
}
state("ThankYouVeryCool-Win64-Shipping", "steam patch 5.3.1") {
float levelTimer: 0x5B28C80, 0x118, 0xB64;
bool isOnMainMenu: 0x59E1620, 0xF70, 0xA0, 0x3E0, 0x320;
int stage: 0x5B28C80, 0x118, 0xD80, 0x2E0, 0x360;
uint isFFx4WhenLevelIsNewType: 0x5B28C80, 0x118, 0xD80, 0x2E0, 0x398;
}
state("ThankYouVeryCool-Win64-Shipping", "steam patch 5.3.2") {
float levelTimer: 0x5B1E480, 0x118, 0xB64;
bool isOnMainMenu: 0x59D6E20, 0xF70, 0xA0, 0x3E0, 0x320;
int stage: 0x5B1E480, 0x118, 0xD80, 0x2E0, 0x360;
uint isFFx4WhenLevelIsNewType: 0x5B1E480, 0x118, 0xD80, 0x2E0, 0x398;
}
state("ThankYouVeryCool-Win64-Shipping", "steam patch 5.4") {
float levelTimer: 0x5B29D40, 0x118, 0xB64;
bool isOnMainMenu: 0x5B16D10, 0xE10, 0xE60, 0x320; // couldn't find old value. this is shorter though
int stage: 0x5B29D40, 0x118, 0xD80, 0x2E0, 0x360;
uint isFFx4WhenLevelIsNewType: 0x5B29D40, 0x118, 0xD80, 0x2E0, 0x398;
}
state("ThankYouVeryCool-Win64-Shipping", "steam patch 5.5") {
float levelTimer: 0x5B831C0, 0x118, 0xB64;
bool isOnMainMenu: 0x5A3BB60, 0xF70, 0xA0, 0x3F0, 0x320; // guh
int stage: 0x5B831C0, 0x118, 0xD80, 0x2E0, 0x360;
uint isFFx4WhenLevelIsNewType: 0x5B831C0, 0x118, 0xD80, 0x2E0, 0x398;
}
startup
{
if(timer.CurrentTimingMethod == TimingMethod.RealTime) // copied this from somewhere lmao
{
var timingMessage = MessageBox.Show
(
"This game uses Game Time (time without loads) as the main timing method.\n"+
"LiveSplit is currently set to show Real Time (time INCLUDING loads).\n"+
"Would you like the timing method to be set to Game Time for you?",
vars.aslName+" | LiveSplit",
MessageBoxButtons.YesNo,
MessageBoxIcon.Question
);
if (timingMessage == DialogResult.Yes) timer.CurrentTimingMethod = TimingMethod.GameTime;
}
}
init
{
string MD5Hash;
using (var md5 = System.Security.Cryptography.MD5.Create())
using (var s = File.Open(modules.First().FileName, FileMode.Open, FileAccess.Read, FileShare.ReadWrite))
MD5Hash = md5.ComputeHash(s).Select(x => x.ToString("X2")).Aggregate((a, b) => a + b);
switch (MD5Hash)
{
case "F26391C54743E1C276663BE1B292338A":
version = "epic patch 5.5";
break;
case "2760F4F5197D180FEAC859A4D6A07719":
version = "gog patch 5.5";
break;
case "A8C57AD035ED26B6E1DCED0499EBFA22":
version = "steam patch 5.1";
break;
case "76EAB92EF3754360BAB05B7D535C6956":
version = "steam patch 5.2";
break;
case "5CB50DA54A0E6718DDE1E1767261E1E1":
version = "steam patch 5.3";
break;
case "A2A6EF0B983BC581FB7BEF6CA712DF93":
version = "steam patch 5.3.1";
break;
case "E07998E54FE179C0BD9B6FA8B47A37D9":
version = "steam patch 5.3.2";
break;
case "D6B612D7A26C563461AAAA9DB064E822":
version = "steam patch 5.4";
break;
case "8EAA5F06FAA6B53ECA2BB39B18C13F99":
version = "steam patch 5.5";
break;
default:
MessageBox.Show
(
"Unsupported version of the game! If you're on GOG, sorry, I don't have it.\n" +
"If you're on Steam/Epic, I'm probably already working on the update!\n\n" +
"If you have any questions you can find me on the official Greylock Discord server, or the official SS/EPN speedrun Discord server.\n\n" +
"modules.first().ModuleMemorySize: 0x" + modules.First().ModuleMemorySize.ToString("X") + "\n" +
"new FileInfo(modules.First().FileName).Length): 0x" + new FileInfo(modules.First().FileName).Length.ToString("X") + "\n" +
"MD5Hash: " + MD5Hash,
"SS-stage-autosplitter | LiveSplit",
MessageBoxButtons.OK,
MessageBoxIcon.Warning
);
print("Hash is: " + MD5Hash);
return false;
}
}
start
{
if (current.isOnMainMenu || !(current.levelTimer < 0.1f && current.levelTimer > 0f)) {
return false;
}
if (current.isFFx4WhenLevelIsNewType != 0xFFFFFFFF) {
MessageBox.Show
(
"This level seems to be the old type. This autosplitter isn't meant for normal campaign levels, and will not work.\n" +
"It should work for any single bonus or workshop level.",
"SS-stage-autosplitter | LiveSplit", // caption
MessageBoxButtons.OK,
MessageBoxIcon.Warning
);
return false;
}
if (current.stage == 0)
{
return true;
}
}
split
{
if (current.stage == old.stage + 1)
{
return true;
}
}
reset
{
if (current.isOnMainMenu || old.levelTimer > current.levelTimer)
{
return true;
}
}
isLoading
{
if (current.levelTimer == old.levelTimer)
{
return true;
}
return false;
}
gameTime
{
return TimeSpan.FromSeconds(current.levelTimer);
}