Beispiel #1
0
        protected override void Loop()
        {
            if (!ProcessMemory.IsRunProcess())
            {
                ConsoleSpiner consoleSpiner = new ConsoleSpiner();
                Console.Write("Wait process ");
                while (!ProcessMemory.OpenProcess(Config.Game.Process))
                {
                    consoleSpiner.Turn();
                    Thread.Sleep(100);
                }
                Console.WriteLine("...");
                Console.WriteLine($"Found process: ID:{ProcessMemory.Process.Id}");
            }

            while (true)
            {
                Render2D.WindowRenderTarget.Resize(new Size2(RenderSurface.Size.Width, RenderSurface.Height));

                WriteMemory();
                ReadMemory();

                Render2D.BeginDraw();
                Render2D.Clear();

                Render2D.BrushColor = Color.Green;
                Render2D.DrawRectangle(new SharpDX.RectangleF(0, 0, 1920, 1080));
                Render2D.DrawLine(new Vector2(0, 0), new Vector2(1920, 1080));
                Render2D.DrawLine(new Vector2(1920, 0), new Vector2(0, 1080));

                Draw();

                Render2D.EndDraw();

                if (!ProcessMemory.IsRunProcess())
                {
                    break;
                }
            }
        }