public Object listGameProcess(DataSourceLoadOptions loadOptions) { string name = "梦幻西游"; var gameProcesses = Finder.findGameProcesses(name); foreach (var gameProcess in gameProcesses) { int pid = 0; GetWindowThreadProcessId(gameProcess.hwnd, out pid); GameAuto.resetPosition((IntPtr)pid); var currentWindow = GetForegroundWindow(); SetForegroundWindow(gameProcess.hwnd); System.IO.MemoryStream stream = new MemoryStream(); var rectangle = new Rectangle(470, 200, 100, 50); var bitmap = Capture.CaptureWindowRectangle(gameProcess.hwnd, rectangle); gameProcess.isLogin = ValidateStatus.isLoginPage(gameProcess.hwnd); var key = gameProcess.hwnd.ToString() + "-" + DateTime.Now.Millisecond.ToString() + ".png"; var putResult = OSSService.uploadBitmap("wingsworker", key, bitmap); gameProcess.pid = (IntPtr)pid; gameProcess.windowImageUrl = OSSService.url + "/" + key; gameProcess.status = "active"; SetForegroundWindow(currentWindow); } return(DataSourceLoader.Load(gameProcesses.ToArray(), loadOptions)); }
public static void autoPlayByHwnd(object source, System.Timers.ElapsedEventArgs e) { GameAuto.isInJuqing(hwnd); GameAuto.autoPlayTask(hwnd); GameAuto.autoUseDrug(hwnd); GameAuto.autoCloseSubWindow(hwnd); }
public bool autoFlight(int hwnd) { return(GameAuto.autoFlight(hwnd)); }
public bool isInJuqing(int hwnd) { return(GameAuto.isInJuqing(hwnd)); }
public bool autoUseDrug(int hwnd) { return(GameAuto.autoUseDrug(hwnd)); }
public bool autoPlayTask(int hwnd) { return(GameAuto.autoPlayTask(hwnd)); }
public bool resetPosition() { GameAuto.zhuagui(ProcessId); return(true); }
void Start() { Init(3, 1, 5, 74); tempParent = _parent; instance = this; }