private void backgroundWorker1_DoWork(object sender, DoWorkEventArgs e) { Stopwatch jew = new Stopwatch(); var overlay = new OverlayWindow(0, 0, (int)SystemInformation.VirtualScreen.Width, (int)SystemInformation.VirtualScreen.Height); var rendererOptions = new Direct2DRendererOptions() { AntiAliasing = true, Hwnd = overlay.WindowHandle, MeasureFps = true, VSync = false }; var d2d = new Direct2DRenderer(rendererOptions); var whiteSmoke = d2d.CreateBrush(0, 0, 0, 0); var blackBrush = d2d.CreateBrush(0, 0, 0, 150); var redBrush = d2d.CreateBrush(255, 0, 0, 255); jew.Start(); while (drawRunning) { d2d.BeginScene(); d2d.ClearScene(whiteSmoke); int temp = findClosestEndPoint(listOfClicks, Form1.MousePosition, 10); if (temp != -1 && mousePressed) { listOfClicks[temp].x = MousePosition.X; listOfClicks[temp].y = MousePosition.Y; } d2d.FillCircle(listOfClicks[0].x, listOfClicks[0].y, 7, blackBrush); d2d.FillCircle(listOfClicks[1].x, listOfClicks[1].y, 7, blackBrush); d2d.FillCircle(listOfClicks[2].x, listOfClicks[2].y, 7, blackBrush); d2d.DrawLine(listOfClicks[0].x, listOfClicks[0].y, listOfClicks[1].x, listOfClicks[1].y, 5, redBrush); d2d.DrawLine(listOfClicks[0].x, listOfClicks[0].y, listOfClicks[2].x, listOfClicks[2].y, 5, redBrush); d2d.EndScene(); } d2d.BeginScene(); d2d.ClearScene(whiteSmoke); d2d.EndScene(); jew.Stop(); jew.Reset(); //running = false; }
private void drawThread() { Direct2DRenderer pDevice = overlay.Graphics; while (doLoop) { if (!isGameActive()) { pDevice.BeginScene(); pDevice.ClearScene(); pDevice.EndScene(); while (!isGameActive() && doLoop) { Thread.Sleep(100); } if (!doLoop) { break; } } watch.Reset(); watch.Start(); if ((GetAsyncKeyState((int)0x01) & 0x8000) != 0) { if (!mouseDown) { justToggled = true; mouseDown = true; } else { justToggled = false; } } else { mouseDown = false; justToggled = false; } GetCursorPos(out mousePos); handleInput(); pDevice.BeginScene(); pDevice.ClearScene(); if (Master.renderesp) { RenderESP(); } pDevice.FillRectangle(5 + Xshift, 5 + Yshift, 170, 210, blackBrush); pDevice.DrawRectangle(5 + Xshift, 5 + Yshift, 170, 210, 5, tealBrush); pDevice.DrawText("LysDick Hex", titleFont, tealBrush, 15 + Xshift, 10 + Yshift); pDevice.DrawRectangle(15 + Xshift, 50 + Yshift, 15, 15, 1, tealBrush); pDevice.DrawText("Enable Triggerbot", font, tealBrush, 35 + Xshift, 49 + Yshift); pDevice.DrawRectangle(15 + Xshift, 70 + Yshift, 15, 15, 1, tealBrush); pDevice.DrawText("Slow Mode", font, tealBrush, 35 + Xshift, 69 + Yshift); pDevice.DrawRectangle(15 + Xshift, 90 + Yshift, 15, 15, 1, tealBrush); pDevice.DrawText("ESP (15m)", font, tealBrush, 35 + Xshift, 89 + Yshift); pDevice.DrawRectangle(15 + Xshift, 110 + Yshift, 15, 15, 1, tealBrush); pDevice.DrawText("Bunny Hop (Space)", font, tealBrush, 35 + Xshift, 109 + Yshift); if (Master.enabled) { pDevice.FillRectangle(16 + Xshift, 51 + Yshift, 12, 12, tealBrush); } if (Master.mode == 1) { pDevice.FillRectangle(16 + Xshift, 71 + Yshift, 12, 12, tealBrush); } if (Master.renderesp) { pDevice.FillRectangle(16 + Xshift, 91 + Yshift, 12, 12, tealBrush); } if (Master.doBHop) { pDevice.FillRectangle(16 + Xshift, 111 + Yshift, 12, 12, tealBrush); } Yshift += 25; pDevice.DrawCircle(22 + Xshift, 117 + Yshift, 8, 1, tealBrush); pDevice.DrawText("0ms Delay", font, tealBrush, 35 + Xshift, 109 + Yshift); pDevice.DrawCircle(22 + Xshift, 137 + Yshift, 8, 1, tealBrush); pDevice.DrawText("20ms Delay", font, tealBrush, 35 + Xshift, 129 + Yshift); pDevice.DrawCircle(22 + Xshift, 157 + Yshift, 8, 1, tealBrush); pDevice.DrawText("80ms Delay", font, tealBrush, 35 + Xshift, 149 + Yshift); if (Master.delay == 0) { pDevice.FillCircle(22 + Xshift, 117 + Yshift, 7, tealBrush); } if (Master.delay == 20) { pDevice.FillCircle(22 + Xshift, 137 + Yshift, 7, tealBrush); } if (Master.delay == 80) { pDevice.FillCircle(22 + Xshift, 157 + Yshift, 7, tealBrush); } while (watch.ElapsedMilliseconds < (50 / 3)) { Thread.Sleep(1); } Yshift -= 25; pDevice.EndScene(); } }