static async Task MainAsync(string[] args) { string char1Name, char2Name, char3Name; int char1CurrentHP, char1MaxHP, char1CurrentMP, char1MaxMP, char2CurrentHP, char2MaxHP, char2CurrentMP, char2MaxMP, char3CurrentHP, char3MaxHP, char3CurrentMP, char3MaxMP; int familyLevel = 0; uint bufferSize = 255; var keyboard = KeyboardCustom.Create(); var chroma = await ColoreProvider.CreateNativeAsync(); await chroma.SetAllAsync(fadeRed); WaitGame: try { Process GameProcess = Process.GetProcessesByName("rGE").FirstOrDefault(); VAMemory vam = new VAMemory("rGE"); vam.ReadInt32(GameProcess.MainModule.BaseAddress); while (true) { Console.Clear(); //HP char1CurrentHP = vam.ReadInt32((IntPtr)(vam.getBaseAddress + CurrentHP[0])); char1MaxHP = vam.ReadInt32((IntPtr)(vam.getBaseAddress + MaxHP[0])); char2CurrentHP = vam.ReadInt32((IntPtr)(vam.getBaseAddress + CurrentHP[1])); char2MaxHP = vam.ReadInt32((IntPtr)(vam.getBaseAddress + MaxHP[1])); char3CurrentHP = vam.ReadInt32((IntPtr)(vam.getBaseAddress + CurrentHP[2])); char3MaxHP = vam.ReadInt32((IntPtr)(vam.getBaseAddress + MaxHP[2])); //MP char1CurrentMP = vam.ReadInt16((IntPtr)(vam.getBaseAddress + CurrentMP[0])); char1MaxMP = vam.ReadInt16((IntPtr)(vam.getBaseAddress + MaxMP[0])); char2CurrentMP = vam.ReadInt16((IntPtr)(vam.getBaseAddress + CurrentMP[1])); char2MaxMP = vam.ReadInt16((IntPtr)(vam.getBaseAddress + MaxMP[1])); char3CurrentMP = vam.ReadInt16((IntPtr)(vam.getBaseAddress + CurrentMP[2])); char3MaxMP = vam.ReadInt16((IntPtr)(vam.getBaseAddress + MaxMP[2])); var HP1Point = Math.Round((double)char1CurrentHP / char1MaxHP, 2); var HP2Point = Math.Round((double)char2CurrentHP / char2MaxHP, 2); var HP3Point = Math.Round((double)char3CurrentHP / char3MaxHP, 2); var MP1Point = Math.Round((double)char1CurrentMP / char1MaxMP, 2); var MP2Point = Math.Round((double)char2CurrentMP / char2MaxMP, 2); var MP3Point = Math.Round((double)char3CurrentMP / char3MaxMP, 2); RenderKeyboard(ref keyboard, new[] { (int)(HP1Point * 10), (int)(HP2Point * 10), (int)(HP3Point * 10) }, new[] { (int)(MP1Point * 10), (int)(MP2Point * 10), (int)(MP3Point * 10) }); await chroma.Keyboard.SetCustomAsync(keyboard); //char1Name = vam.ReadStringASCII((IntPtr)(vam.getBaseAddress + Name[0]), bufferSize); //char2Name = vam.ReadStringASCII((IntPtr)(vam.getBaseAddress + Name[1]), bufferSize); //char3Name = vam.ReadStringASCII((IntPtr)(vam.getBaseAddress + Name[2]), bufferSize); //char1Name = char1Name.Substring(0, char1Name.IndexOf("\0")); //char2Name = char2Name.Substring(0, char2Name.IndexOf("\0")); //char3Name = char3Name.Substring(0, char3Name.IndexOf("\0")); //Console.WriteLine($"\rName : {char1Name} {char1CurrentMP}/{char1MaxMP}[{HP1Point * 100}]% "); //Console.WriteLine($"\rName : {char2Name} {char2CurrentMP}/{char2MaxMP}[{HP2Point * 100}]% "); //Console.WriteLine($"\rName : {char3Name} {char3CurrentMP}/{char3MaxMP}[{HP3Point * 100}]% "); Thread.Sleep(500); } } catch { keyboard.Set(fadeRed); await chroma.Keyboard.SetCustomAsync(keyboard); Console.Write("\rWaiting for character info to allocate into memory..."); Thread.Sleep(500); goto WaitGame; } }
public static int Rating() => Game.ReadInt16(new IntPtr( 0x140599FF0 ));