Last active
February 12, 2025 01:02
-
-
Save wRadion/5a0d04974044e881f63c3fbfd2f7a2e1 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Get Tilted! :) (v1.1) autosplitter | |
* by wRadion | |
*/ | |
state("GetTilted-Win64-Shipping") | |
{ | |
double PosX : "GetTilted-Win64-Shipping.exe", 0x6D3BDA8, 0x228, 0x200, 0x0, 0x50, 0x0, 0x28, 0x0; | |
double PosY : "GetTilted-Win64-Shipping.exe", 0x6D3BDA8, 0x228, 0x200, 0x0, 0x50, 0x0, 0x28, 0x8; | |
double PosZ : "GetTilted-Win64-Shipping.exe", 0x6D3BDA8, 0x228, 0x200, 0x0, 0x50, 0x0, 0x28, 0x10; | |
double Timer : "GetTilted-Win64-Shipping.exe", 0x6D3BDA8, 0x1B8, 0x5F8; | |
bool Credits : "GetTilted-Win64-Shipping.exe", 0x6D3BDA8, 0x1B8, 0x1C0, 0x5A0, 0x160, 0x20, 0x8C2; | |
} | |
startup { | |
vars.splitsCoords = new Dictionary<string, double[]> { | |
{ "Reach Maintenance Tunnel", new double[] { 1067.216, 475.162, 240.775, 73.0 } }, | |
{ "Reach Upper Prison of Pipes", new double[] { 799.441, 530.296, 602.334, 75.0 } }, | |
{ "Reach Bygone Factory", new double[] { -74.541, 636.783, 1097.571, 60.0 } }, | |
{ "Reach Chamber of Echoes", new double[] { 1567.504, -166.599, 1657.014, 568.0 } }, | |
{ "Reach Rumbling Ruins", new double[] { 590.811, 551.905, 2259.758, 211.0 } }, | |
{ "Reach Ichor Mines", new double[] { -554.186, 226.823, 3060.433, 242.0, 3110.0 } }, | |
{ "Reach Golden City", new double[] { 960.457, -1499.769, 5579.300, 104.0 } }, | |
{ "Reach Cathedral", new double[] { 218.897, 2236.348, 5734.182, 150.0 } }, | |
{ "Reach Suspended City", new double[] { -367.691, 2200.843, 7807.735, 100.0 } }, | |
{ "Reach Salty Dragon Inn", new double[] { -382.317, 785.617, 10048.722, 100.0 } }, | |
{ "Reach Ancient Ruins", new double[] { 26.603, -355.226, 45067.383, 100.0 } }, | |
{ "End", new double[] {} } | |
}; | |
foreach (KeyValuePair<string, double[]> pos in vars.splitsCoords) | |
{ | |
if (pos.Key != "End") | |
settings.Add(pos.Key, true, pos.Key); | |
} | |
Func<double, double, double, double[], double> GetDistance = (x1, y1, z1, pos2) => { | |
double dx = pos2[0] - x1; | |
double dy = pos2[1] - y1; | |
double dz = pos2[2] - z1; | |
return Math.Sqrt(dx * dx + dy * dy + dz * dz); | |
}; | |
vars.GetDistance = GetDistance; | |
Func<double, bool> IsZero = (val) => val >= 0 && val < 0.05; | |
vars.IsZero = IsZero; | |
vars.splits = new List<string>(); | |
} | |
start { | |
if (vars.IsZero(old.Timer) && current.Timer > old.Timer) { | |
vars.splits.Clear(); | |
vars.endReached = false; | |
return true; | |
} | |
} | |
reset { | |
if (vars.IsZero(current.Timer) && old.Timer > current.Timer) { | |
vars.splits.Clear(); | |
vars.endReached = false; | |
return true; | |
} | |
} | |
gameTime | |
{ | |
return TimeSpan.FromSeconds(current.Timer); | |
} | |
split | |
{ | |
if (old.Credits != current.Credits && current.Credits && !vars.splits.Contains("End")) { | |
vars.splits.Add("End"); | |
return true; | |
} | |
foreach (KeyValuePair<string, double[]> pos in vars.splitsCoords) | |
{ | |
if (pos.Key == "End" || !settings[pos.Key] || vars.splits.Contains(pos.Key)) | |
continue; | |
double[] coords = pos.Value; | |
double dist = vars.GetDistance(current.PosX, current.PosY, current.PosZ, coords); | |
double radius = (double)coords[3]; | |
if (dist <= radius || (coords.Length == 5 && current.PosZ > coords[4])) { | |
vars.splits.Add(pos.Key); | |
return true; | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment