state("Journey") { // These pointer paths are from Paleologos' cheat table // https://github.com/Paleologos1261/Journey-Cheat-Engine-table uint levelID: 0x03CFCA80, 0x70, 0x28, 0xD0, 0x100, 0x30, 0x368, 0x30; float posX: 0x03C47B18, 0x60, 0x28, 0xD0, 0x100, 0x30, 0x370, 0xC0; float posY: 0x03C47B18, 0x70, 0x178, 0x78, 0xD0, 0x108, 0x3A8, 0xC4; float posZ: 0x03C47B18, 0x70, 0x28, 0xD0, 0x108, 0x30, 0x370, 0xC8; uint isCSHL: 0x37C0998; } startup { settings.Add("coop", false, "Don't split at the end of Paradise (Co-op mode)"); settings.Add("glitchless", false, "Also split when sitting at the CS HL (Glitchless mode)"); } init { int delay = 3000; int sleep = 1000; vars.resetEnabled = true; vars.splitsEnabled = true; vars.csAddr = IntPtr.Zero; vars.CancelSource = new CancellationTokenSource(); System.Threading.Thread.Sleep(delay); System.Threading.Tasks.Task.Run(async () => { TaskStart: try { IntPtr addr = IntPtr.Zero; DeepPointer ptr = new DeepPointer(0x03C94570, 0x8, 0x8, 0x8, 0x8, 0xD8); while (addr == IntPtr.Zero) { if (vars.CancelSource.IsCancellationRequested) { break; } ptr.DerefOffsets(game, out addr); await System.Threading.Tasks.Task.Delay(sleep); } vars.csAddr = addr; } catch (Exception e) { System.Threading.Tasks.Task.Delay(sleep); goto TaskStart; } }); } update { current.cSelect = 0; if (vars.csAddr != IntPtr.Zero) { current.cSelect = game.ReadValue((IntPtr)vars.csAddr); if (current.cSelect == 0 && !vars.resetEnabled) { vars.resetEnabled = true; } } } start { // this changes to 1032358025 specifically if (current.cSelect != 0) { return true; } } reset { if (current.cSelect != 0 && vars.resetEnabled) { vars.resetEnabled = false; vars.splitsEnabled = false; System.Threading.Tasks.Task.Delay(5000).ContinueWith(t => vars.splitsEnabled = true); return true; } } split { if (vars.splitsEnabled) { // normal level transition if (current.levelID - 1 == old.levelID && current.levelID < 8) { return true; } // Paradise walk into the light if ( current.levelID == 7 && current.posZ >= 993.1323 && current.posX >= 218.0 && current.posX <= 295.0 && current.posY <= 770.0 && !settings["coop"] ) { return true; } // CS HL split if (current.levelID == 0 && old.isCSHL == 9 && current.isCSHL == 0 && settings["glitchless"]) { return true; } } } exit { vars.CancelSource.Cancel(); } shutdown { vars.CancelSource.Cancel(); }