| | |
| | | |
| | | } |
| | | |
| | | private const bool isCreateGroup = true; |
| | | |
| | | public override ZTResult Start(Int32 runningStep) |
| | | {WindowUtils.SetDnfToTop(); |
| | | { |
| | | WindowUtils.SetDnfToTop(); |
| | | |
| | | |
| | | |
| | | |
| | | const bool isCreateGroup = true; |
| | | string groupName = "aabbccddee"; |
| | | if (isCreateGroup) |
| | | { |
| | |
| | | } |
| | | //沉默一段时间 |
| | | Thread.Sleep(50000000); |
| | | CloseAllAlertWindow(this.CancelToken, this.GameRect); |
| | | CloseAllAlertWindowByX(this.CancelToken, this.GameRect); |
| | | return ZTResult.Success; |
| | | } |
| | | |
| | |
| | | ZTRectangle innerGroupWindowTextRect = ZTRectangle.Empty, innerSearchButtonRect = ZTRectangle.Empty, innerCreateGroupButton = ZTRectangle.Empty; |
| | | for (int i = 0; i < 2; i++) |
| | | { |
| | | CloseAllAlertWindow(this.CancelToken, this.GameRect); |
| | | CloseAllAlertWindowByX(this.CancelToken, this.GameRect); |
| | | G.Instance.InputControl.PressKey(RandomUtils.KeyPressDuration, HIDCode.RightSquarebrackets); |
| | | |
| | | bool result = FuncUtils.TimeoutCancelableWrap(5000, this.CancelToken, () => { |
| | |
| | | return false; |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 关闭所有弹出窗 |
| | | /// </summary> |
| | | /// <param name="cancelToken"></param> |
| | | /// <param name="gameRect"></param> |
| | | /// <returns></returns> |
| | | private void CloseAllAlertWindow(CancellationToken cancelToken, ZTRectangle gameRect) |
| | | { |
| | | while (!cancelToken.IsCancellationRequested) |
| | | { |
| | | //G.Instance.InputControl.MoveTo(gameRect.Start.X,gameRect.Start.Y, false, false, false); |
| | | //Thread.Sleep(10); |
| | | //截图 |
| | | Image<Rgb, byte> image = ScreenCapture.Instance.CaptureScreenReturnImage(); |
| | | |
| | | ZTRectangle closeButtonRect = ZTRectangle.Empty; |
| | | if (!DnfCVHelper.GetAlertWindow(out closeButtonRect, image, gameRect)) |
| | | { |
| | | return; |
| | | } |
| | | |
| | | G.Instance.InputControl.MoveToAndClick(closeButtonRect.GetCenterPoint()); |
| | | Thread.Sleep(500); |
| | | } |
| | | } |
| | | |
| | | } |
| | | } |