state("gk") { // nothing to do here; we need to grab the pointers ourselves instead of hardcoding them } // Runs once, the only place you can add custom settings, before the process is connected to! startup { // NOTE: Enable Log Output Action DebugOutput = (text, setting) => { if (setting) { print("[OpenGOAL] " + text); } }; vars.DebugOutput = DebugOutput; Action>, string, int, Type, dynamic, bool, string, bool> AddOption = (list, id, offset, type, splitVal, defaultEnabled, name, debug) => { var d = new Dictionary(); d.Add("id", id); d.Add("offset", offset); d.Add("type", type); d.Add("splitVal", splitVal); d.Add("defaultEnabled", defaultEnabled); d.Add("name", name); d.Add("debug", debug); list.Add(d); }; Action AddToSettings = (options, parent) => { foreach (Dictionary option in options) { settings.Add(option["id"], option["defaultEnabled"], option["name"], parent); } }; settings.Add("asl_settings", true, "Autosplitter Settings"); settings.Add("asl_settings_debug", false, "Enable Debug Logs", "asl_settings"); vars.optionLists = new List>>(); vars.endingConditions = new List>(); AddOption(vars.endingConditions, "endingConditions_kor-death", 12, typeof(byte), 1, false, "Kor Death", false); AddOption(vars.endingConditions, "endingConditions_all-collectables", 13, typeof(byte), 1, false, "All Collectables", false); AddOption(vars.endingConditions, "endingConditions_all-orbs", 4, typeof(uint), 286, false, "All Orbs", false); settings.Add("group_endingConditions", true, "Ending Conditions"); AddToSettings(vars.endingConditions, "group_endingConditions"); // NOTE: This section is autogenerated. Do not edit it directly. // __AUTOGENERATED__ START vars.anyPercent = new List>(); AddOption(vars.anyPercent, "anyPercent_res-fortress-escape", 418, typeof(byte), 1, false, "res-fortress-escape", false); AddOption(vars.anyPercent, "anyPercent_res-city-help-kid", 419, typeof(byte), 1, false, "res-city-help-kid", false); AddOption(vars.anyPercent, "anyPercent_res-tomb-poles", 461, typeof(byte), 1, false, "res-tomb-poles", false); AddOption(vars.anyPercent, "anyPercent_res-tomb-water", 462, typeof(byte), 1, false, "res-tomb-water", false); AddOption(vars.anyPercent, "anyPercent_res-tomb-boss", 463, typeof(byte), 1, false, "res-tomb-boss", false); AddOption(vars.anyPercent, "anyPercent_res-fortress-save-friends", 464, typeof(byte), 1, false, "res-fortress-save-friends", false); AddOption(vars.anyPercent, "anyPercent_res-sewer-escort", 465, typeof(byte), 1, false, "res-sewer-escort", false); AddOption(vars.anyPercent, "anyPercent_res-city-stop-bomb-bots", 468, typeof(byte), 1, false, "res-city-stop-bomb-bots", false); AddOption(vars.anyPercent, "anyPercent_res-stadium-race-class2", 467, typeof(byte), 1, false, "res-stadium-race-class2", false); AddOption(vars.anyPercent, "anyPercent_res-city-dark-gun-training", 466, typeof(byte), 1, false, "res-city-dark-gun-training", false); AddOption(vars.anyPercent, "anyPercent_res-city-errol-challenge", 469, typeof(byte), 1, false, "res-city-errol-challenge", false); AddOption(vars.anyPercent, "anyPercent_res-ruins-mech", 471, typeof(byte), 1, false, "res-ruins-mech", false); AddOption(vars.anyPercent, "anyPercent_res-forest-protect", 472, typeof(byte), 1, false, "res-forest-protect", false); AddOption(vars.anyPercent, "anyPercent_res-strip-drop", 470, typeof(byte), 1, false, "res-strip-drop", false); AddOption(vars.anyPercent, "anyPercent_res-drill-mech", 473, typeof(byte), 1, false, "res-drill-mech", false); AddOption(vars.anyPercent, "anyPercent_res-city-save-lurkers", 474, typeof(byte), 1, false, "res-city-save-lurkers", false); AddOption(vars.anyPercent, "anyPercent_res-stadium-race-class", 475, typeof(byte), 1, false, "res-stadium-race-class", false); AddOption(vars.anyPercent, "anyPercent_res-palace-sneak-in", 476, typeof(byte), 1, false, "res-palace-sneak-in", false); AddOption(vars.anyPercent, "anyPercent_res-castle-break-in", 477, typeof(byte), 1, false, "res-castle-break-in", false); AddOption(vars.anyPercent, "anyPercent_res-castle-boss", 478, typeof(byte), 1, false, "res-castle-boss", false); AddOption(vars.anyPercent, "anyPercent_res-city-whack", 479, typeof(byte), 1, false, "res-city-whack", false); AddOption(vars.anyPercent, "anyPercent_res-under-mech", 480, typeof(byte), 1, false, "res-under-mech", false); AddOption(vars.anyPercent, "anyPercent_res-under-sig", 481, typeof(byte), 1, false, "res-under-sig", false); AddOption(vars.anyPercent, "anyPercent_res-city-defend-stadium", 482, typeof(byte), 1, false, "res-city-defend-stadium", false); AddOption(vars.anyPercent, "anyPercent_res-consite-find-baron", 483, typeof(byte), 1, false, "res-consite-find-baron", false); AddOption(vars.anyPercent, "anyPercent_res-nest-get-to-gun", 484, typeof(byte), 1, false, "res-nest-get-to-gun", false); AddOption(vars.anyPercent, "anyPercent_res-nest-enter", 485, typeof(byte), 1, false, "res-nest-enter", false); AddOption(vars.anyPercent, "anyPercent_res-nest-boss", 486, typeof(byte), 1, false, "res-nest-boss", false); settings.Add("preset_anyPercent", false, "Any%"); AddToSettings(vars.anyPercent, "preset_anyPercent"); vars.optionLists.Add(vars.anyPercent); vars.allMissions = new List>(); AddOption(vars.allMissions, "allMissions_res-fortress-escape", 418, typeof(byte), 1, false, "res-fortress-escape", false); AddOption(vars.allMissions, "allMissions_res-city-help-kid", 419, typeof(byte), 1, false, "res-city-help-kid", false); AddOption(vars.allMissions, "allMissions_res-ruins-tower", 421, typeof(byte), 1, false, "res-ruins-tower", false); AddOption(vars.allMissions, "allMissions_res-atoll-water", 422, typeof(byte), 1, false, "res-atoll-water", false); AddOption(vars.allMissions, "allMissions_res-fortress-dump", 423, typeof(byte), 1, false, "res-fortress-dump", false); AddOption(vars.allMissions, "allMissions_res-city-krew-delivery", 424, typeof(byte), 1, false, "res-city-krew-delivery", false); AddOption(vars.allMissions, "allMissions_res-city-red-gun-training", 425, typeof(byte), 1, false, "res-city-red-gun-training", false); AddOption(vars.allMissions, "allMissions_res-atoll-sig", 426, typeof(byte), 1, false, "res-atoll-sig", false); AddOption(vars.allMissions, "allMissions_res-sewer-enemy", 427, typeof(byte), 1, false, "res-sewer-enemy", false); AddOption(vars.allMissions, "allMissions_res-city-yellow-gun-training", 437, typeof(byte), 1, false, "res-city-yellow-gun-training", false); AddOption(vars.allMissions, "allMissions_res-city-keira-delivery", 434, typeof(byte), 1, false, "res-city-keira-delivery", false); AddOption(vars.allMissions, "allMissions_res-strip-rescue", 428, typeof(byte), 1, false, "res-strip-rescue", false); AddOption(vars.allMissions, "allMissions_res-drill-eggs", 438, typeof(byte), 1, false, "res-drill-eggs", false); AddOption(vars.allMissions, "allMissions_res-atoll-battle", 429, typeof(byte), 1, false, "res-atoll-battle", false); AddOption(vars.allMissions, "allMissions_res-mountain-lens", 430, typeof(byte), 1, false, "res-mountain-lens", false); AddOption(vars.allMissions, "allMissions_res-mountain-gear", 431, typeof(byte), 1, false, "res-mountain-gear", false); AddOption(vars.allMissions, "allMissions_res-mountain-shard", 432, typeof(byte), 1, false, "res-mountain-shard", false); AddOption(vars.allMissions, "allMissions_res-stadium-board1", 435, typeof(byte), 1, false, "res-stadium-board1", false); AddOption(vars.allMissions, "allMissions_res-city-power", 439, typeof(byte), 1, false, "res-city-power", false); AddOption(vars.allMissions, "allMissions_res-palace-cable", 440, typeof(byte), 1, false, "res-palace-cable", false); AddOption(vars.allMissions, "allMissions_res-palace-boss", 441, typeof(byte), 1, false, "res-palace-boss", false); AddOption(vars.allMissions, "allMissions_res-city-krew-collection", 436, typeof(byte), 1, false, "res-city-krew-collection", false); AddOption(vars.allMissions, "allMissions_res-city-shuttle", 442, typeof(byte), 1, false, "res-city-shuttle", false); AddOption(vars.allMissions, "allMissions_res-ruins-enemy", 443, typeof(byte), 1, false, "res-ruins-enemy", false); AddOption(vars.allMissions, "allMissions_res-forest-scouts", 445, typeof(byte), 1, false, "res-forest-scouts", false); AddOption(vars.allMissions, "allMissions_res-city-port-run", 450, typeof(byte), 1, false, "res-city-port-run", false); AddOption(vars.allMissions, "allMissions_res-city-meet-brutter", 451, typeof(byte), 1, false, "res-city-meet-brutter", false); AddOption(vars.allMissions, "allMissions_res-city-intercept-tanker", 454, typeof(byte), 1, false, "res-city-intercept-tanker", false); AddOption(vars.allMissions, "allMissions_res-sewer-board", 452, typeof(byte), 1, false, "res-sewer-board", false); AddOption(vars.allMissions, "allMissions_res-city-escort-kid", 446, typeof(byte), 1, false, "res-city-escort-kid", false); AddOption(vars.allMissions, "allMissions_res-dig-knock-down", 447, typeof(byte), 1, false, "res-dig-knock-down", false); AddOption(vars.allMissions, "allMissions_res-strip-grenade", 448, typeof(byte), 1, false, "res-strip-grenade", false); AddOption(vars.allMissions, "allMissions_res-drill-ship", 449, typeof(byte), 1, false, "res-drill-ship", false); AddOption(vars.allMissions, "allMissions_res-dig-find-totem", 457, typeof(byte), 1, false, "res-dig-find-totem", false); AddOption(vars.allMissions, "allMissions_res-city-destroy-guard-vehicles", 458, typeof(byte), 1, false, "res-city-destroy-guard-vehicles", false); AddOption(vars.allMissions, "allMissions_res-city-protect-water-slums", 456, typeof(byte), 1, false, "res-city-protect-water-slums", false); AddOption(vars.allMissions, "allMissions_res-stadium-race-class3", 455, typeof(byte), 1, false, "res-stadium-race-class3", false); AddOption(vars.allMissions, "allMissions_res-forest-hunt", 453, typeof(byte), 1, false, "res-forest-hunt", false); AddOption(vars.allMissions, "allMissions_res-city-play-onin-game", 459, typeof(byte), 1, false, "res-city-play-onin-game", false); AddOption(vars.allMissions, "allMissions_res-canyon-insert-items", 460, typeof(byte), 1, false, "res-canyon-insert-items", false); AddOption(vars.allMissions, "allMissions_res-tomb-poles", 461, typeof(byte), 1, false, "res-tomb-poles", false); AddOption(vars.allMissions, "allMissions_res-tomb-water", 462, typeof(byte), 1, false, "res-tomb-water", false); AddOption(vars.allMissions, "allMissions_res-tomb-boss", 463, typeof(byte), 1, false, "res-tomb-boss", false); AddOption(vars.allMissions, "allMissions_res-fortress-save-friends", 464, typeof(byte), 1, false, "res-fortress-save-friends", false); AddOption(vars.allMissions, "allMissions_res-sewer-escort", 465, typeof(byte), 1, false, "res-sewer-escort", false); AddOption(vars.allMissions, "allMissions_res-city-stop-bomb-bots", 468, typeof(byte), 1, false, "res-city-stop-bomb-bots", false); AddOption(vars.allMissions, "allMissions_res-stadium-race-class2", 467, typeof(byte), 1, false, "res-stadium-race-class2", false); AddOption(vars.allMissions, "allMissions_res-city-errol-challenge", 469, typeof(byte), 1, false, "res-city-errol-challenge", false); AddOption(vars.allMissions, "allMissions_res-ruins-mech", 471, typeof(byte), 1, false, "res-ruins-mech", false); AddOption(vars.allMissions, "allMissions_res-forest-protect", 472, typeof(byte), 1, false, "res-forest-protect", false); AddOption(vars.allMissions, "allMissions_res-strip-drop", 470, typeof(byte), 1, false, "res-strip-drop", false); AddOption(vars.allMissions, "allMissions_res-drill-mech", 473, typeof(byte), 1, false, "res-drill-mech", false); AddOption(vars.allMissions, "allMissions_res-city-save-lurkers", 474, typeof(byte), 1, false, "res-city-save-lurkers", false); AddOption(vars.allMissions, "allMissions_res-stadium-race-class", 475, typeof(byte), 1, false, "res-stadium-race-class", false); AddOption(vars.allMissions, "allMissions_res-palace-sneak-in", 476, typeof(byte), 1, false, "res-palace-sneak-in", false); AddOption(vars.allMissions, "allMissions_res-castle-break-in", 477, typeof(byte), 1, false, "res-castle-break-in", false); AddOption(vars.allMissions, "allMissions_res-castle-boss", 478, typeof(byte), 1, false, "res-castle-boss", false); AddOption(vars.allMissions, "allMissions_res-city-whack", 479, typeof(byte), 1, false, "res-city-whack", false); AddOption(vars.allMissions, "allMissions_res-under-mech", 480, typeof(byte), 1, false, "res-under-mech", false); AddOption(vars.allMissions, "allMissions_res-under-sig", 481, typeof(byte), 1, false, "res-under-sig", false); AddOption(vars.allMissions, "allMissions_res-city-defend-stadium", 482, typeof(byte), 1, false, "res-city-defend-stadium", false); AddOption(vars.allMissions, "allMissions_res-consite-find-baron", 483, typeof(byte), 1, false, "res-consite-find-baron", false); AddOption(vars.allMissions, "allMissions_res-nest-get-to-gun", 484, typeof(byte), 1, false, "res-nest-get-to-gun", false); AddOption(vars.allMissions, "allMissions_res-nest-enter", 485, typeof(byte), 1, false, "res-nest-enter", false); AddOption(vars.allMissions, "allMissions_res-nest-boss", 486, typeof(byte), 1, false, "res-nest-boss", false); settings.Add("preset_allMissions", false, "All Missions"); AddToSettings(vars.allMissions, "preset_allMissions"); vars.optionLists.Add(vars.allMissions); vars.hundredPercent = new List>(); AddOption(vars.hundredPercent, "hundredPercent_res-fortress-escape", 418, typeof(byte), 1, false, "res-fortress-escape", true); AddOption(vars.hundredPercent, "hundredPercent_res-city-help-kid", 419, typeof(byte), 1, false, "res-city-help-kid", false); AddOption(vars.hundredPercent, "hundredPercent_res-ruins-tower", 421, typeof(byte), 1, false, "res-ruins-tower", false); AddOption(vars.hundredPercent, "hundredPercent_res-atoll-water", 422, typeof(byte), 1, false, "res-atoll-water", false); AddOption(vars.hundredPercent, "hundredPercent_res-fortress-dump", 423, typeof(byte), 1, false, "res-fortress-dump", false); AddOption(vars.hundredPercent, "hundredPercent_res-city-krew-delivery", 424, typeof(byte), 1, false, "res-city-krew-delivery", false); AddOption(vars.hundredPercent, "hundredPercent_res-city-red-gun-training", 425, typeof(byte), 1, false, "res-city-red-gun-training", false); AddOption(vars.hundredPercent, "hundredPercent_res-city-burning-bush-ring-1", 489, typeof(byte), 1, false, "res-city-burning-bush-ring-1", false); AddOption(vars.hundredPercent, "hundredPercent_res-atoll-sig", 426, typeof(byte), 1, false, "res-atoll-sig", false); AddOption(vars.hundredPercent, "hundredPercent_res-city-burning-bush-get-to-2", 491, typeof(byte), 1, false, "res-city-burning-bush-get-to-2", false); AddOption(vars.hundredPercent, "hundredPercent_res-sewer-enemy", 427, typeof(byte), 1, false, "res-sewer-enemy", false); AddOption(vars.hundredPercent, "hundredPercent_res-city-yellow-gun-training", 437, typeof(byte), 1, false, "res-city-yellow-gun-training", false); AddOption(vars.hundredPercent, "hundredPercent_res-city-keira-delivery", 434, typeof(byte), 1, false, "res-city-keira-delivery", false); AddOption(vars.hundredPercent, "hundredPercent_res-strip-rescue", 428, typeof(byte), 1, false, "res-strip-rescue", false); AddOption(vars.hundredPercent, "hundredPercent_res-drill-eggs", 438, typeof(byte), 1, false, "res-drill-eggs", false); AddOption(vars.hundredPercent, "hundredPercent_res-city-burning-bush-get-to-1", 490, typeof(byte), 1, false, "res-city-burning-bush-get-to-1", false); AddOption(vars.hundredPercent, "hundredPercent_res-atoll-battle", 429, typeof(byte), 1, false, "res-atoll-battle", false); AddOption(vars.hundredPercent, "hundredPercent_res-city-burning-bush-get-to-4", 493, typeof(byte), 1, false, "res-city-burning-bush-get-to-4", false); AddOption(vars.hundredPercent, "hundredPercent_res-mountain-lens", 430, typeof(byte), 1, false, "res-mountain-lens", false); AddOption(vars.hundredPercent, "hundredPercent_res-mountain-gear", 431, typeof(byte), 1, false, "res-mountain-gear", false); AddOption(vars.hundredPercent, "hundredPercent_res-mountain-shard", 432, typeof(byte), 1, false, "res-mountain-shard", false); AddOption(vars.hundredPercent, "hundredPercent_res-city-burning-bush-racepoint-1", 495, typeof(byte), 1, false, "res-city-burning-bush-racepoint-1", false); AddOption(vars.hundredPercent, "hundredPercent_res-stadium-board1", 435, typeof(byte), 1, false, "res-stadium-board1", false); AddOption(vars.hundredPercent, "hundredPercent_res-city-power", 439, typeof(byte), 1, false, "res-city-power", false); AddOption(vars.hundredPercent, "hundredPercent_res-palace-cable", 440, typeof(byte), 1, false, "res-palace-cable", false); AddOption(vars.hundredPercent, "hundredPercent_res-palace-boss", 441, typeof(byte), 1, false, "res-palace-boss", false); AddOption(vars.hundredPercent, "hundredPercent_res-city-krew-collection", 436, typeof(byte), 1, false, "res-city-krew-collection", false); AddOption(vars.hundredPercent, "hundredPercent_res-city-shuttle", 442, typeof(byte), 1, false, "res-city-shuttle", false); AddOption(vars.hundredPercent, "hundredPercent_res-ruins-enemy", 443, typeof(byte), 1, false, "res-ruins-enemy", false); AddOption(vars.hundredPercent, "hundredPercent_res-forest-scouts", 445, typeof(byte), 1, false, "res-forest-scouts", false); AddOption(vars.hundredPercent, "hundredPercent_res-city-port-run", 450, typeof(byte), 1, false, "res-city-port-run", false); AddOption(vars.hundredPercent, "hundredPercent_res-city-meet-brutter", 451, typeof(byte), 1, false, "res-city-meet-brutter", false); AddOption(vars.hundredPercent, "hundredPercent_res-city-intercept-tanker", 454, typeof(byte), 1, false, "res-city-intercept-tanker", false); AddOption(vars.hundredPercent, "hundredPercent_res-sewer-board", 452, typeof(byte), 1, false, "res-sewer-board", false); AddOption(vars.hundredPercent, "hundredPercent_res-city-escort-kid", 446, typeof(byte), 1, false, "res-city-escort-kid", false); AddOption(vars.hundredPercent, "hundredPercent_res-dig-knock-down", 447, typeof(byte), 1, false, "res-dig-knock-down", false); AddOption(vars.hundredPercent, "hundredPercent_res-strip-grenade", 448, typeof(byte), 1, false, "res-strip-grenade", false); AddOption(vars.hundredPercent, "hundredPercent_res-drill-ship", 449, typeof(byte), 1, false, "res-drill-ship", false); AddOption(vars.hundredPercent, "hundredPercent_res-dig-find-totem", 457, typeof(byte), 1, false, "res-dig-find-totem", false); AddOption(vars.hundredPercent, "hundredPercent_res-city-burning-bush-get-to-3", 492, typeof(byte), 1, false, "res-city-burning-bush-get-to-3", false); AddOption(vars.hundredPercent, "hundredPercent_res-city-burning-bush-ring-2", 496, typeof(byte), 1, false, "res-city-burning-bush-ring-2", false); AddOption(vars.hundredPercent, "hundredPercent_res-city-destroy-guard-vehicles", 458, typeof(byte), 1, false, "res-city-destroy-guard-vehicles", false); AddOption(vars.hundredPercent, "hundredPercent_res-city-protect-water-slums", 456, typeof(byte), 1, false, "res-city-protect-water-slums", false); AddOption(vars.hundredPercent, "hundredPercent_res-city-burning-bush-collection-1", 494, typeof(byte), 1, false, "res-city-burning-bush-collection-1", false); AddOption(vars.hundredPercent, "hundredPercent_res-stadium-race-class3", 455, typeof(byte), 1, false, "res-stadium-race-class3", false); AddOption(vars.hundredPercent, "hundredPercent_res-forest-hunt", 453, typeof(byte), 1, false, "res-forest-hunt", false); AddOption(vars.hundredPercent, "hundredPercent_res-city-play-onin-game", 459, typeof(byte), 1, false, "res-city-play-onin-game", false); AddOption(vars.hundredPercent, "hundredPercent_res-city-burning-bush-get-to-8", 501, typeof(byte), 1, false, "res-city-burning-bush-get-to-8", false); AddOption(vars.hundredPercent, "hundredPercent_res-canyon-insert-items", 460, typeof(byte), 1, false, "res-canyon-insert-items", false); AddOption(vars.hundredPercent, "hundredPercent_res-tomb-poles", 461, typeof(byte), 1, false, "res-tomb-poles", false); AddOption(vars.hundredPercent, "hundredPercent_res-tomb-water", 462, typeof(byte), 1, false, "res-tomb-water", false); AddOption(vars.hundredPercent, "hundredPercent_res-tomb-boss", 463, typeof(byte), 1, false, "res-tomb-boss", false); AddOption(vars.hundredPercent, "hundredPercent_res-city-burning-bush-shuttle-1", 499, typeof(byte), 1, false, "res-city-burning-bush-shuttle-1", false); AddOption(vars.hundredPercent, "hundredPercent_res-fortress-save-friends", 464, typeof(byte), 1, false, "res-fortress-save-friends", false); AddOption(vars.hundredPercent, "hundredPercent_res-sewer-escort", 465, typeof(byte), 1, false, "res-sewer-escort", false); AddOption(vars.hundredPercent, "hundredPercent_res-city-stop-bomb-bots", 468, typeof(byte), 1, false, "res-city-stop-bomb-bots", false); AddOption(vars.hundredPercent, "hundredPercent_res-city-burning-bush-get-to-9", 502, typeof(byte), 1, false, "res-city-burning-bush-get-to-9", false); AddOption(vars.hundredPercent, "hundredPercent_res-stadium-race-class2", 467, typeof(byte), 1, false, "res-stadium-race-class2", false); AddOption(vars.hundredPercent, "hundredPercent_res-city-burning-bush-collection-2", 503, typeof(byte), 1, false, "res-city-burning-bush-collection-2", false); AddOption(vars.hundredPercent, "hundredPercent_res-city-errol-challenge", 469, typeof(byte), 1, false, "res-city-errol-challenge", false); AddOption(vars.hundredPercent, "hundredPercent_res-ruins-mech", 471, typeof(byte), 1, false, "res-ruins-mech", false); AddOption(vars.hundredPercent, "hundredPercent_res-city-burning-bush-ring-3", 506, typeof(byte), 1, false, "res-city-burning-bush-ring-3", false); AddOption(vars.hundredPercent, "hundredPercent_res-city-burning-bush-get-to-10", 504, typeof(byte), 1, false, "res-city-burning-bush-get-to-10", false); AddOption(vars.hundredPercent, "hundredPercent_res-city-burning-bush-get-to-7", 500, typeof(byte), 1, false, "res-city-burning-bush-get-to-7", false); AddOption(vars.hundredPercent, "hundredPercent_res-city-burning-bush-get-to-6", 498, typeof(byte), 1, false, "res-city-burning-bush-get-to-6", false); AddOption(vars.hundredPercent, "hundredPercent_res-forest-protect", 472, typeof(byte), 1, false, "res-forest-protect", false); AddOption(vars.hundredPercent, "hundredPercent_res-strip-drop", 470, typeof(byte), 1, false, "res-strip-drop", false); AddOption(vars.hundredPercent, "hundredPercent_res-drill-mech", 473, typeof(byte), 1, false, "res-drill-mech", false); AddOption(vars.hundredPercent, "hundredPercent_res-city-save-lurkers", 474, typeof(byte), 1, false, "res-city-save-lurkers", false); AddOption(vars.hundredPercent, "hundredPercent_res-stadium-race-class", 475, typeof(byte), 1, false, "res-stadium-race-class", false); AddOption(vars.hundredPercent, "hundredPercent_res-palace-sneak-in", 476, typeof(byte), 1, false, "res-palace-sneak-in", false); AddOption(vars.hundredPercent, "hundredPercent_res-castle-break-in", 477, typeof(byte), 1, false, "res-castle-break-in", false); AddOption(vars.hundredPercent, "hundredPercent_res-castle-boss", 478, typeof(byte), 1, false, "res-castle-boss", false); AddOption(vars.hundredPercent, "hundredPercent_res-city-whack", 479, typeof(byte), 1, false, "res-city-whack", false); AddOption(vars.hundredPercent, "hundredPercent_res-under-mech", 480, typeof(byte), 1, false, "res-under-mech", false); AddOption(vars.hundredPercent, "hundredPercent_res-under-sig", 481, typeof(byte), 1, false, "res-under-sig", false); AddOption(vars.hundredPercent, "hundredPercent_res-city-defend-stadium", 482, typeof(byte), 1, false, "res-city-defend-stadium", false); AddOption(vars.hundredPercent, "hundredPercent_res-consite-find-baron", 483, typeof(byte), 1, false, "res-consite-find-baron", false); AddOption(vars.hundredPercent, "hundredPercent_res-nest-get-to-gun", 484, typeof(byte), 1, false, "res-nest-get-to-gun", false); AddOption(vars.hundredPercent, "hundredPercent_res-nest-enter", 485, typeof(byte), 1, false, "res-nest-enter", false); AddOption(vars.hundredPercent, "hundredPercent_res-nest-boss", 486, typeof(byte), 1, false, "res-nest-boss", false); AddOption(vars.hundredPercent, "hundredPercent_res-city-burning-bush-race-port", 514, typeof(byte), 1, false, "res-city-burning-bush-race-port", false); AddOption(vars.hundredPercent, "hundredPercent_res-city-blue-gun-training", 444, typeof(byte), 1, false, "res-city-blue-gun-training", false); AddOption(vars.hundredPercent, "hundredPercent_res-city-dark-gun-training", 466, typeof(byte), 1, false, "res-city-dark-gun-training", false); AddOption(vars.hundredPercent, "hundredPercent_res-city-burning-bush-get-to-5", 497, typeof(byte), 1, false, "res-city-burning-bush-get-to-5", false); AddOption(vars.hundredPercent, "hundredPercent_res-city-burning-bush-get-to-12", 507, typeof(byte), 1, false, "res-city-burning-bush-get-to-12", false); AddOption(vars.hundredPercent, "hundredPercent_res-city-burning-bush-bombbot-1", 508, typeof(byte), 1, false, "res-city-burning-bush-bombbot-1", false); AddOption(vars.hundredPercent, "hundredPercent_res-city-burning-bush-get-to-15", 511, typeof(byte), 1, false, "res-city-burning-bush-get-to-15", false); AddOption(vars.hundredPercent, "hundredPercent_numSkullgems", 8, typeof(uint), 500, false, "500 Skull Gems", true); AddOption(vars.hundredPercent, "hundredPercent_res-city-burning-bush-collection-3", 512, typeof(byte), 1, false, "res-city-burning-bush-collection-3", false); AddOption(vars.hundredPercent, "hundredPercent_res-city-burning-bush-get-to-14", 510, typeof(byte), 1, false, "res-city-burning-bush-get-to-14", false); AddOption(vars.hundredPercent, "hundredPercent_res-city-burning-bush-get-to-11", 505, typeof(byte), 1, false, "res-city-burning-bush-get-to-11", false); AddOption(vars.hundredPercent, "hundredPercent_res-city-burning-bush-get-to-13", 509, typeof(byte), 1, false, "res-city-burning-bush-get-to-13", false); AddOption(vars.hundredPercent, "hundredPercent_res-stadium-burning-bush-race-class1-r", 521, typeof(byte), 1, false, "res-stadium-burning-bush-race-class1-r", false); AddOption(vars.hundredPercent, "hundredPercent_res-stadium-burning-bush-race-class2-r", 520, typeof(byte), 1, false, "res-stadium-burning-bush-race-class2-r", false); AddOption(vars.hundredPercent, "hundredPercent_res-stadium-burning-bush-race-class3-r", 519, typeof(byte), 1, false, "res-stadium-burning-bush-race-class3-r", false); settings.Add("preset_hundredPercent", false, "100%"); AddToSettings(vars.hundredPercent, "preset_hundredPercent"); vars.optionLists.Add(vars.hundredPercent); vars.manualOptions = new List>(); AddOption(vars.manualOptions, "res-fortress-escape", 418, typeof(byte), 1, false, "res-fortress-escape", false); AddOption(vars.manualOptions, "res-city-help-kid", 419, typeof(byte), 1, false, "res-city-help-kid", false); AddOption(vars.manualOptions, "res-city-vehicle-training", 420, typeof(byte), 1, false, "res-city-vehicle-training", false); AddOption(vars.manualOptions, "res-ruins-tower", 421, typeof(byte), 1, false, "res-ruins-tower", false); AddOption(vars.manualOptions, "res-atoll-water", 422, typeof(byte), 1, false, "res-atoll-water", false); AddOption(vars.manualOptions, "res-fortress-dump", 423, typeof(byte), 1, false, "res-fortress-dump", false); AddOption(vars.manualOptions, "res-city-krew-delivery", 424, typeof(byte), 1, false, "res-city-krew-delivery", false); AddOption(vars.manualOptions, "res-city-red-gun-training", 425, typeof(byte), 1, false, "res-city-red-gun-training", false); AddOption(vars.manualOptions, "res-atoll-sig", 426, typeof(byte), 1, false, "res-atoll-sig", false); AddOption(vars.manualOptions, "res-sewer-enemy", 427, typeof(byte), 1, false, "res-sewer-enemy", false); AddOption(vars.manualOptions, "res-strip-rescue", 428, typeof(byte), 1, false, "res-strip-rescue", false); AddOption(vars.manualOptions, "res-atoll-battle", 429, typeof(byte), 1, false, "res-atoll-battle", false); AddOption(vars.manualOptions, "res-mountain-lens", 430, typeof(byte), 1, false, "res-mountain-lens", false); AddOption(vars.manualOptions, "res-mountain-gear", 431, typeof(byte), 1, false, "res-mountain-gear", false); AddOption(vars.manualOptions, "res-mountain-shard", 432, typeof(byte), 1, false, "res-mountain-shard", false); AddOption(vars.manualOptions, "res-mountain-collection", 433, typeof(byte), 1, false, "res-mountain-collection", false); AddOption(vars.manualOptions, "res-city-keira-delivery", 434, typeof(byte), 1, false, "res-city-keira-delivery", false); AddOption(vars.manualOptions, "res-stadium-board1", 435, typeof(byte), 1, false, "res-stadium-board1", false); AddOption(vars.manualOptions, "res-city-krew-collection", 436, typeof(byte), 1, false, "res-city-krew-collection", false); AddOption(vars.manualOptions, "res-city-yellow-gun-training", 437, typeof(byte), 1, false, "res-city-yellow-gun-training", false); AddOption(vars.manualOptions, "res-drill-eggs", 438, typeof(byte), 1, false, "res-drill-eggs", false); AddOption(vars.manualOptions, "res-city-power", 439, typeof(byte), 1, false, "res-city-power", false); AddOption(vars.manualOptions, "res-palace-cable", 440, typeof(byte), 1, false, "res-palace-cable", false); AddOption(vars.manualOptions, "res-palace-boss", 441, typeof(byte), 1, false, "res-palace-boss", false); AddOption(vars.manualOptions, "res-city-shuttle", 442, typeof(byte), 1, false, "res-city-shuttle", false); AddOption(vars.manualOptions, "res-ruins-enemy", 443, typeof(byte), 1, false, "res-ruins-enemy", false); AddOption(vars.manualOptions, "res-city-blue-gun-training", 444, typeof(byte), 1, false, "res-city-blue-gun-training", false); AddOption(vars.manualOptions, "res-forest-scouts", 445, typeof(byte), 1, false, "res-forest-scouts", false); AddOption(vars.manualOptions, "res-city-escort-kid", 446, typeof(byte), 1, false, "res-city-escort-kid", false); AddOption(vars.manualOptions, "res-dig-knock-down", 447, typeof(byte), 1, false, "res-dig-knock-down", false); AddOption(vars.manualOptions, "res-strip-grenade", 448, typeof(byte), 1, false, "res-strip-grenade", false); AddOption(vars.manualOptions, "res-drill-ship", 449, typeof(byte), 1, false, "res-drill-ship", false); AddOption(vars.manualOptions, "res-city-port-run", 450, typeof(byte), 1, false, "res-city-port-run", false); AddOption(vars.manualOptions, "res-city-meet-brutter", 451, typeof(byte), 1, false, "res-city-meet-brutter", false); AddOption(vars.manualOptions, "res-sewer-board", 452, typeof(byte), 1, false, "res-sewer-board", false); AddOption(vars.manualOptions, "res-forest-hunt", 453, typeof(byte), 1, false, "res-forest-hunt", false); AddOption(vars.manualOptions, "res-city-intercept-tanker", 454, typeof(byte), 1, false, "res-city-intercept-tanker", false); AddOption(vars.manualOptions, "res-stadium-race-class3", 455, typeof(byte), 1, false, "res-stadium-race-class3", false); AddOption(vars.manualOptions, "res-city-protect-water-slums", 456, typeof(byte), 1, false, "res-city-protect-water-slums", false); AddOption(vars.manualOptions, "res-dig-find-totem", 457, typeof(byte), 1, false, "res-dig-find-totem", false); AddOption(vars.manualOptions, "res-city-destroy-guard-vehicles", 458, typeof(byte), 1, false, "res-city-destroy-guard-vehicles", false); AddOption(vars.manualOptions, "res-city-play-onin-game", 459, typeof(byte), 1, false, "res-city-play-onin-game", false); AddOption(vars.manualOptions, "res-canyon-insert-items", 460, typeof(byte), 1, false, "res-canyon-insert-items", false); AddOption(vars.manualOptions, "res-tomb-poles", 461, typeof(byte), 1, false, "res-tomb-poles", false); AddOption(vars.manualOptions, "res-tomb-water", 462, typeof(byte), 1, false, "res-tomb-water", false); AddOption(vars.manualOptions, "res-tomb-boss", 463, typeof(byte), 1, false, "res-tomb-boss", false); AddOption(vars.manualOptions, "res-fortress-save-friends", 464, typeof(byte), 1, false, "res-fortress-save-friends", false); AddOption(vars.manualOptions, "res-sewer-escort", 465, typeof(byte), 1, false, "res-sewer-escort", false); AddOption(vars.manualOptions, "res-city-dark-gun-training", 466, typeof(byte), 1, false, "res-city-dark-gun-training", false); AddOption(vars.manualOptions, "res-stadium-race-class2", 467, typeof(byte), 1, false, "res-stadium-race-class2", false); AddOption(vars.manualOptions, "res-city-stop-bomb-bots", 468, typeof(byte), 1, false, "res-city-stop-bomb-bots", false); AddOption(vars.manualOptions, "res-city-errol-challenge", 469, typeof(byte), 1, false, "res-city-errol-challenge", false); AddOption(vars.manualOptions, "res-strip-drop", 470, typeof(byte), 1, false, "res-strip-drop", false); AddOption(vars.manualOptions, "res-ruins-mech", 471, typeof(byte), 1, false, "res-ruins-mech", false); AddOption(vars.manualOptions, "res-forest-protect", 472, typeof(byte), 1, false, "res-forest-protect", false); AddOption(vars.manualOptions, "res-drill-mech", 473, typeof(byte), 1, false, "res-drill-mech", false); AddOption(vars.manualOptions, "res-city-save-lurkers", 474, typeof(byte), 1, false, "res-city-save-lurkers", false); AddOption(vars.manualOptions, "res-stadium-race-class", 475, typeof(byte), 1, false, "res-stadium-race-class", false); AddOption(vars.manualOptions, "res-palace-sneak-in", 476, typeof(byte), 1, false, "res-palace-sneak-in", false); AddOption(vars.manualOptions, "res-castle-break-in", 477, typeof(byte), 1, false, "res-castle-break-in", false); AddOption(vars.manualOptions, "res-castle-boss", 478, typeof(byte), 1, false, "res-castle-boss", false); AddOption(vars.manualOptions, "res-city-whack", 479, typeof(byte), 1, false, "res-city-whack", false); AddOption(vars.manualOptions, "res-under-mech", 480, typeof(byte), 1, false, "res-under-mech", false); AddOption(vars.manualOptions, "res-under-sig", 481, typeof(byte), 1, false, "res-under-sig", false); AddOption(vars.manualOptions, "res-city-defend-stadium", 482, typeof(byte), 1, false, "res-city-defend-stadium", false); AddOption(vars.manualOptions, "res-consite-find-baron", 483, typeof(byte), 1, false, "res-consite-find-baron", false); AddOption(vars.manualOptions, "res-nest-get-to-gun", 484, typeof(byte), 1, false, "res-nest-get-to-gun", false); AddOption(vars.manualOptions, "res-nest-enter", 485, typeof(byte), 1, false, "res-nest-enter", false); AddOption(vars.manualOptions, "res-nest-boss", 486, typeof(byte), 1, false, "res-nest-boss", false); AddOption(vars.manualOptions, "res-city-win", 487, typeof(byte), 1, false, "res-city-win", false); AddOption(vars.manualOptions, "res-city-oracle", 488, typeof(byte), 1, false, "res-city-oracle", false); AddOption(vars.manualOptions, "res-city-burning-bush-ring-1", 489, typeof(byte), 1, false, "res-city-burning-bush-ring-1", false); AddOption(vars.manualOptions, "res-city-burning-bush-get-to-1", 490, typeof(byte), 1, false, "res-city-burning-bush-get-to-1", false); AddOption(vars.manualOptions, "res-city-burning-bush-get-to-2", 491, typeof(byte), 1, false, "res-city-burning-bush-get-to-2", false); AddOption(vars.manualOptions, "res-city-burning-bush-get-to-3", 492, typeof(byte), 1, false, "res-city-burning-bush-get-to-3", false); AddOption(vars.manualOptions, "res-city-burning-bush-get-to-4", 493, typeof(byte), 1, false, "res-city-burning-bush-get-to-4", false); AddOption(vars.manualOptions, "res-city-burning-bush-collection-1", 494, typeof(byte), 1, false, "res-city-burning-bush-collection-1", false); AddOption(vars.manualOptions, "res-city-burning-bush-racepoint-1", 495, typeof(byte), 1, false, "res-city-burning-bush-racepoint-1", false); AddOption(vars.manualOptions, "res-city-burning-bush-ring-2", 496, typeof(byte), 1, false, "res-city-burning-bush-ring-2", false); AddOption(vars.manualOptions, "res-city-burning-bush-get-to-5", 497, typeof(byte), 1, false, "res-city-burning-bush-get-to-5", false); AddOption(vars.manualOptions, "res-city-burning-bush-get-to-6", 498, typeof(byte), 1, false, "res-city-burning-bush-get-to-6", false); AddOption(vars.manualOptions, "res-city-burning-bush-shuttle-1", 499, typeof(byte), 1, false, "res-city-burning-bush-shuttle-1", false); AddOption(vars.manualOptions, "res-city-burning-bush-get-to-7", 500, typeof(byte), 1, false, "res-city-burning-bush-get-to-7", false); AddOption(vars.manualOptions, "res-city-burning-bush-get-to-8", 501, typeof(byte), 1, false, "res-city-burning-bush-get-to-8", false); AddOption(vars.manualOptions, "res-city-burning-bush-get-to-9", 502, typeof(byte), 1, false, "res-city-burning-bush-get-to-9", false); AddOption(vars.manualOptions, "res-city-burning-bush-collection-2", 503, typeof(byte), 1, false, "res-city-burning-bush-collection-2", false); AddOption(vars.manualOptions, "res-city-burning-bush-get-to-10", 504, typeof(byte), 1, false, "res-city-burning-bush-get-to-10", false); AddOption(vars.manualOptions, "res-city-burning-bush-get-to-11", 505, typeof(byte), 1, false, "res-city-burning-bush-get-to-11", false); AddOption(vars.manualOptions, "res-city-burning-bush-ring-3", 506, typeof(byte), 1, false, "res-city-burning-bush-ring-3", false); AddOption(vars.manualOptions, "res-city-burning-bush-get-to-12", 507, typeof(byte), 1, false, "res-city-burning-bush-get-to-12", false); AddOption(vars.manualOptions, "res-city-burning-bush-bombbot-1", 508, typeof(byte), 1, false, "res-city-burning-bush-bombbot-1", false); AddOption(vars.manualOptions, "res-city-burning-bush-get-to-13", 509, typeof(byte), 1, false, "res-city-burning-bush-get-to-13", false); AddOption(vars.manualOptions, "res-city-burning-bush-get-to-14", 510, typeof(byte), 1, false, "res-city-burning-bush-get-to-14", false); AddOption(vars.manualOptions, "res-city-burning-bush-get-to-15", 511, typeof(byte), 1, false, "res-city-burning-bush-get-to-15", false); AddOption(vars.manualOptions, "res-city-burning-bush-collection-3", 512, typeof(byte), 1, false, "res-city-burning-bush-collection-3", false); AddOption(vars.manualOptions, "res-city-burning-bush-race-errol", 513, typeof(byte), 1, false, "res-city-burning-bush-race-errol", false); AddOption(vars.manualOptions, "res-city-burning-bush-race-port", 514, typeof(byte), 1, false, "res-city-burning-bush-race-port", false); AddOption(vars.manualOptions, "res-stadium-burning-bush-race-board", 515, typeof(byte), 1, false, "res-stadium-burning-bush-race-board", false); AddOption(vars.manualOptions, "res-stadium-burning-bush-race-class3", 516, typeof(byte), 1, false, "res-stadium-burning-bush-race-class3", false); AddOption(vars.manualOptions, "res-stadium-burning-bush-race-class2", 517, typeof(byte), 1, false, "res-stadium-burning-bush-race-class2", false); AddOption(vars.manualOptions, "res-stadium-burning-bush-race-class1", 518, typeof(byte), 1, false, "res-stadium-burning-bush-race-class1", false); AddOption(vars.manualOptions, "res-stadium-burning-bush-race-class3-r", 519, typeof(byte), 1, false, "res-stadium-burning-bush-race-class3-r", false); AddOption(vars.manualOptions, "res-stadium-burning-bush-race-class2-r", 520, typeof(byte), 1, false, "res-stadium-burning-bush-race-class2-r", false); AddOption(vars.manualOptions, "res-stadium-burning-bush-race-class1-r", 521, typeof(byte), 1, false, "res-stadium-burning-bush-race-class1-r", false); settings.Add("manual_options", false, "Manual Options"); AddToSettings(vars.manualOptions, "manual_options"); vars.optionLists.Add(vars.manualOptions); // __AUTOGENERATED__ END vars.DebugOutput("Finished {startup}", true); } init { vars.DebugOutput("Running {init} looking for `gk.exe`", true); var sw = new Stopwatch(); sw.Start(); var exported_ptr = IntPtr.Zero; vars.foundPointers = false; byte[] marker = Encoding.ASCII.GetBytes("UnLiStEdStRaTs_JaK2" + Char.MinValue); vars.debugTick = 0; // NOTE - the subtraction is a total hack. When we switched to SDL the statically linked binary now has this new `No Access` region of 0x1000 bytes near the end of the first module // This feels like a total hack and is brittle (memory layout can change in the future, sizes can change, new regions can be added). // // 28672 = 0x7000 and this is the size from the end of the first module to before the beginning of this No Access region at the time of writing. // // However, since this is a hack, we should probably be a bit more conservative incase more the region layout changes. // // LiveSplit tries to read the entire region it's given into memory and a partial read is a failure. vars.DebugOutput(String.Format("Scanning First Module - {0}->{1}", modules.First().BaseAddress.ToString("x8"), (modules.First().BaseAddress.ToInt64() + modules.First().ModuleMemorySize - 100000).ToString("x8")), true); exported_ptr = new SignatureScanner(game, modules.First().BaseAddress, modules.First().ModuleMemorySize - 200000).Scan( new SigScanTarget(marker.Length, marker) ); if (exported_ptr == IntPtr.Zero) { vars.DebugOutput("Could not find the AutoSplittingInfo struct, old version of gk.exe? Failing!", true); sw.Reset(); return false; } vars.DebugOutput(String.Format("Found AutoSplittingInfo struct - {0}", exported_ptr.ToString("x8")), true); // The offset to the GOAL struct is stored in a u64 next to the marker! var goal_struct_ptr = new IntPtr(memory.ReadValue(exported_ptr + 4)); while (goal_struct_ptr == IntPtr.Zero) { vars.DebugOutput("Could not find pointer to GOAL struct, game still loading? Retrying in 1000ms...!", true); Thread.Sleep(1000); sw.Reset(); throw new Exception("Could not find pointer to GOAL struct, game still loading? Retrying..."); } Action>> AddMemoryWatchers = (memList, bPtr, options) => { foreach (Dictionary option in options) { var finalOffset = bPtr + (option["offset"]); // Reflection magic to create a watcher targetting the correct type Type memoryWatcherType = typeof(MemoryWatcher<>); Type genericType = memoryWatcherType.MakeGenericType(option["type"]); object instance = Activator.CreateInstance(genericType, finalOffset); genericType.GetProperty("Name").SetValue(instance, option["id"]); memList.Add((MemoryWatcher)instance); if (option["debug"] == true) { memList[option["id"]].Update(game); vars.DebugOutput(String.Format("Debug ({0}) -> ptr [{1}]; val [{2}]", option["id"], finalOffset.ToString("x8"), memList[option["id"]].Current), true); } } }; var watchers = new MemoryWatcherList{ new MemoryWatcher(goal_struct_ptr + 212) { Name = "currentGameHash" } }; // Init current game has in case script is loaded while game is already started watchers["currentGameHash"].Update(game); foreach (List> optionList in vars.optionLists) { AddMemoryWatchers(watchers, goal_struct_ptr, optionList); } AddMemoryWatchers(watchers, goal_struct_ptr, vars.endingConditions); vars.foundPointers = true; vars.watchers = watchers; sw.Stop(); vars.DebugOutput("Script Initialized, Game Compatible.", true); vars.DebugOutput(String.Format("Found the exported struct at {0}", goal_struct_ptr.ToString("x8")), true); vars.DebugOutput(String.Format("It took {0} ms", sw.ElapsedMilliseconds), true); } update { if (!vars.foundPointers) { return false; } vars.watchers.UpdateAll(game); } reset { if (vars.watchers["currentGameHash"].Current != 0 && vars.watchers["currentGameHash"].Current != vars.watchers["currentGameHash"].Old) { vars.DebugOutput("Resetting!", settings["asl_settings_debug"]); vars.DebugOutput(String.Format("Reset -> Old: {0}, Curr: {1}", vars.watchers["currentGameHash"].Old, vars.watchers["currentGameHash"].Current), settings["asl_settings_debug"]); return true; } return false; } start { if (vars.watchers["currentGameHash"].Current != 0 && vars.watchers["currentGameHash"].Current != vars.watchers["currentGameHash"].Old) { vars.DebugOutput("Starting!", settings["asl_settings_debug"]); vars.DebugOutput(String.Format("Start -> Old: {0}, Curr: {1}", vars.watchers["currentGameHash"].Old, vars.watchers["currentGameHash"].Current), settings["asl_settings_debug"]); return true; } return false; } isLoading { // todo return false; } split { var debugThisIter = false; if (vars.debugTick++ % 60 == 0) { debugThisIter = true; } // ALWAYS split if an ending condition is true, so no matter what we exhaust all splits until the end foreach (Dictionary option in vars.endingConditions) { var watcher = vars.watchers[option["id"]]; if (option["debug"] && debugThisIter) { vars.DebugOutput(String.Format("Debug ({0}) -> old [{1}]; current [{2}]; splitVal: [{3}]", option["id"], watcher.Old, watcher.Current, option["splitVal"]), settings["asl_settings_debug"]); } if (settings[option["id"]]) { if (watcher.Current == option["splitVal"]) { return true; } } } Func>, bool> InspectValues = (list) => { foreach (Dictionary option in list) { var watcher = vars.watchers[option["id"]]; if (option["debug"] && debugThisIter) { vars.DebugOutput(String.Format("Debug ({0}) -> old [{1}]; current [{2}]; splitVal: [{3}]", option["id"], watcher.Old, watcher.Current, option["splitVal"]), settings["asl_settings_debug"]); } if (settings[option["id"]]) { // if we don't care about the amount, split on any change if (option["splitVal"] == null && watcher.Current != watcher.Old) { return true; } // Else, make sure we've hit that goal amount else if (option["splitVal"] != null && watcher.Current != watcher.Old && watcher.Current == option["splitVal"]) { return true; } } } return false; }; foreach (List> optionList in vars.optionLists) { if (InspectValues(optionList)) { vars.DebugOutput("Splitting!", settings["asl_settings_debug"]); return true; } } }