CrashNitroKart.asl 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. state("Dolphin")
  2. {
  3. //string50 CurMap : 0x0133A248, 0xDA8;
  4. //int Load : 0x196BFC8;
  5. }
  6. init
  7. {
  8. vars.doneMaps = new List<string>();
  9. //Thank you to Jujstme for pretty much teaching me all of this.
  10. vars.watchers = new MemoryWatcherList();
  11. IntPtr ptr = IntPtr.Zero;
  12. var scanner = new SignatureScanner(game, modules.First().BaseAddress, modules.First().ModuleMemorySize);
  13. ptr = game.MemoryPages(true).FirstOrDefault(p => p.Type == MemPageType.MEM_MAPPED && p.State == MemPageState.MEM_COMMIT && (int)p.RegionSize == 0x2000000).BaseAddress;
  14. print(" => MEM2 address found at 0x" + ptr.ToString("X"));
  15. if (ptr == IntPtr.Zero) throw new Exception("Sigscan failed!");
  16. //checkptr();
  17. vars.watchers.Add(new StringWatcher(ptr + 0x2000DA8, 40) { Name = "MapName" });
  18. vars.watchers.Add(new StringWatcher(ptr + 0x20A34DA, 50) { Name = "CurCutscene"});
  19. vars.watchers.Add(new MemoryWatcher<int> (ptr + 0x200B024) { Name = "Load"});
  20. }
  21. update
  22. {
  23. vars.watchers.UpdateAll(game);
  24. // print(vars.watchers["MapName"].Current);
  25. print(vars.watchers["Load"].Current.ToString());
  26. }
  27. split
  28. {
  29. if ((!vars.watchers["MapName"].Current.Contains("hub")) && (vars.watchers["MapName"].Current.Contains("tracks")) && (!vars.doneMaps.Contains(vars.watchers["MapName"].Current)) && (vars.watchers["MapName"].Current != ""|| vars.watchers["MapName"].Current != null))
  30. {
  31. vars.doneMaps.Add(vars.watchers["MapName"].Current);
  32. return true;
  33. }
  34. }
  35. onReset
  36. {
  37. vars.doneMaps.Clear();
  38. }
  39. isLoading
  40. {
  41. return ((vars.watchers["Load"].Current == 1) && (vars.watchers["CurCutscene"].Current == null || vars.watchers["CurCutscene"].Current == ""));
  42. }