private void WindowCapturing(object rev) { var ev = (ManualResetEvent)rev; while (ev.WaitOne()) { shot = WinAPIExt.GetPictureByWindowHandle(hwnd, 0, 0, WindowWidth, WindowHeight); Thread.Sleep(200); } }
public void Click(IntPtr hwnd, string button, bool post = true, byte times = 1) { if (post) { WinAPIExt.PMMouseClick(hwnd, button, HitPoint.X, HitPoint.Y, times); } else { WinAPIExt.SMMouseClick(hwnd, button, HitPoint.X, HitPoint.Y, times); } }
private void HeroPicking(object rev) { var ev = (ManualResetEvent)rev; while (ev.WaitOne()) { if (dotaObjects["SmileInHeroPick"].Availible(shot)) { PostMsg(this.PID, "SmileInHeroPick availible"); Thread.Sleep(2000); if (!dotaObjects["RepickButton"].Availible(shot)) { PostMsg(this.PID, "RepickButton availible"); if (dotaObjects["RandomButton"].Availible(shot)) { Thread.Sleep(2000); PostMsg(this.PID, "RandomButton availible"); dotaObjects["RandomButton"].Click(hwnd, "left", true, 1); PostMsg(this.PID, "RandomButton clicked"); Thread.Sleep(2000); WinAPIExt.PMMouseClick(hwnd, "left", 8, 8, 1); PostMsg(this.PID, "MainMenuButton clicked"); } else { } } else { Thread.Sleep(10000); //Установим флаг того, что мы пикнули героя } } Thread.Sleep(1000); } }