| | |
| | | |
| | | |
| | | |
| | | public override bool Start(ZTRectangle gameRect, CancellationToken cancelToken, Int32 runningStep) |
| | | public override ZTResult Start(ZTRectangle gameRect, CancellationToken cancelToken, Int32 runningStep) |
| | | { |
| | | this.GameRect = gameRect; |
| | | this.cancellationToken = cancelToken; |
| | |
| | | if (!OpenSkillWindow()) |
| | | { |
| | | G.Instance.InfoWriter("打开技能窗口失败"); |
| | | return false; |
| | | return ZTResult.Failed; |
| | | } |
| | | G.Instance.InfoWriter("技能窗口已打开"); |
| | | |
| | |
| | | if (!InitSkills()) |
| | | { |
| | | G.Instance.InfoWriter("初始化技能失败"); |
| | | return false; |
| | | return ZTResult.Failed; |
| | | } |
| | | G.Instance.InfoWriter("技能已初始化"); |
| | | |
| | |
| | | if (!SettingTopSkills()) |
| | | { |
| | | G.Instance.InfoWriter("通用技能设置失败"); |
| | | return false; |
| | | return ZTResult.Failed; |
| | | } |
| | | G.Instance.InfoWriter("通用技能已设置"); |
| | | |
| | |
| | | if (!SettingSPSkills()) |
| | | { |
| | | G.Instance.InfoWriter("SP技能设置失败"); |
| | | return false; |
| | | return ZTResult.Failed; |
| | | } |
| | | G.Instance.InfoWriter("SP技能已设置"); |
| | | |
| | |
| | | if (!SettingTPSkills()) |
| | | { |
| | | G.Instance.InfoWriter("TP技能设置失败"); |
| | | return false; |
| | | return ZTResult.Failed; |
| | | } |
| | | G.Instance.InfoWriter("TP技能已设置"); |
| | | |
| | |
| | | if (!Studay()) |
| | | { |
| | | G.Instance.InfoWriter("技能学习失败"); |
| | | return false; |
| | | return ZTResult.Failed; |
| | | } |
| | | G.Instance.InfoWriter("技能已学习"); |
| | | |
| | |
| | | if (!FormatSkillColumn()) |
| | | { |
| | | G.Instance.InfoWriter("技能摆放失败"); |
| | | return false; |
| | | return ZTResult.Failed; |
| | | } |
| | | G.Instance.InfoWriter("技能摆放成功"); |
| | | |
| | | |
| | | CloseAllAlertWindow(this.cancellationToken, this.GameRect); |
| | | return true; |
| | | return ZTResult.Success; |
| | | } |
| | | |
| | | /// <summary> |
| | |
| | | //识别技能窗 |
| | | return SkillCVHelper.FindSkillWindow(out innertitleRect, out innerlvRect, out innerupKeyRect, out innerdownKeyRect,out isGray, this.GameRect); |
| | | }); |
| | | |
| | | if (result) |
| | | { |
| | | titleRect = innertitleRect; |
| | |
| | | { |
| | | //如果当前选的是tp技能学习(tp技能学习的右侧滚动条跟sp右侧的不一样),则: |
| | | //选中sp技能学习 |
| | | ZTPoint spPoint = new ZTPoint(lvRect.End.X + 55, lvRect.Start.Y - 80); |
| | | Utility.Structs.ZTPoint spPoint = new Utility.Structs.ZTPoint(lvRect.End.X + 55, lvRect.Start.Y - 80); |
| | | G.Instance.InputControl.MoveToAndClick(spPoint); |
| | | |
| | | result = FuncUtils.TimeoutCancelableWrap(3000, this.cancellationToken, () => { |
| | |
| | | private bool InitSkills() |
| | | { |
| | | //点击初始化 |
| | | ZTPoint initButton = new ZTPoint(this.upKeyRect.Start.X - 37, this.upKeyRect.Start.Y - 86); |
| | | Utility.Structs.ZTPoint initButton = new Utility.Structs.ZTPoint(this.upKeyRect.Start.X - 37, this.upKeyRect.Start.Y - 86); |
| | | G.Instance.InputControl.MoveToAndClick(initButton); |
| | | |
| | | //是否已打开确认对话框 |
| | |
| | | G.Instance.DebugWriter("公告未找到"); |
| | | return false; |
| | | } |
| | | |
| | | //点击确认 |
| | | G.Instance.InputControl.Move(0, 0, true, false, false); |
| | | Thread.Sleep(RandomUtils.MouseClickDuration); |
| | | G.Instance.InputControl.Move(0, 0, false, false, false); |
| | | Thread.Sleep(1000); |
| | | |
| | | |
| | | //是否已打开完毕对话框 |
| | | result = FuncUtils.TimeoutCancelableWrap(3000, this.cancellationToken, () => { |
| | |
| | | return false; |
| | | } |
| | | //点击确认 |
| | | ZTPoint okPosition = new ZTPoint(notificationRect.GetCenterPoint().X, notificationRect.End.Y + 70); |
| | | Utility.Structs.ZTPoint okPosition = new Utility.Structs.ZTPoint(notificationRect.GetCenterPoint().X, notificationRect.End.Y + 60); |
| | | G.Instance.InputControl.MoveToAndClick(okPosition); |
| | | Thread.Sleep(RandomUtils.G(500,800)); |
| | | return true; |
| | |
| | | private bool SettingTopSkills() |
| | | { |
| | | //物理暴击 |
| | | ZTPoint skillPoint = new ZTPoint(lvRect.End.X + 200, lvRect.Start.Y - 42); |
| | | Utility.Structs.ZTPoint skillPoint = new Utility.Structs.ZTPoint(lvRect.End.X + 200, lvRect.Start.Y - 42); |
| | | SettingSkill(skillPoint); |
| | | |
| | | //物理背击 |
| | | skillPoint = new ZTPoint(lvRect.End.X + 280, lvRect.Start.Y - 42); |
| | | skillPoint = new Utility.Structs.ZTPoint(lvRect.End.X + 280, lvRect.Start.Y - 42); |
| | | SettingSkill(skillPoint); |
| | | return true; |
| | | } |
| | |
| | | /// 要点的技能列表 |
| | | /// 内部为每个节所相对于节的相对位置 |
| | | /// </summary> |
| | | private List<ZTPoint>[] toAddLevelSkills = new List<ZTPoint>[] { |
| | | new List<ZTPoint> (){ |
| | | new ZTPoint(762-346,450-237),//疾风之棍棒精通 |
| | | private List<Utility.Structs.ZTPoint>[] toAddLevelSkills = new List<Utility.Structs.ZTPoint>[] { |
| | | new List<Utility.Structs.ZTPoint> (){ |
| | | new Utility.Structs.ZTPoint(762-346,450-237),//疾风之棍棒精通 |
| | | }, |
| | | new List<ZTPoint> (){ |
| | | new ZTPoint(182,17),//朔风牵引 |
| | | new ZTPoint(274,17),//流风决 |
| | | new ZTPoint(481-251,342-262),//风鸣冲击 |
| | | new ZTPoint(323,82),//游离之风 |
| | | new ZTPoint(574-251,409-262),//双翼风刃 |
| | | new ZTPoint(574-251,477-262),//风暴之眼 |
| | | new ZTPoint(529-251,544-262),//真空旋风破 |
| | | new List<Utility.Structs.ZTPoint> (){ |
| | | new Utility.Structs.ZTPoint(182,17),//朔风牵引 |
| | | new Utility.Structs.ZTPoint(274,17),//流风决 |
| | | new Utility.Structs.ZTPoint(481-251,342-262),//风鸣冲击 |
| | | new Utility.Structs.ZTPoint(323,82),//游离之风 |
| | | new Utility.Structs.ZTPoint(574-251,409-262),//双翼风刃 |
| | | new Utility.Structs.ZTPoint(574-251,477-262),//风暴之眼 |
| | | new Utility.Structs.ZTPoint(529-251,544-262),//真空旋风破 |
| | | }, |
| | | new List<ZTPoint> (){ |
| | | new ZTPoint(432-251,275-329),//风暴之拳 |
| | | new ZTPoint(479-251,342-329),//万象风龙阵 |
| | | new ZTPoint(572-251,340-329),//御风之力 |
| | | new ZTPoint(433-251,478-329),//风神决 |
| | | new ZTPoint(526-251,475-329),//风卷残云 |
| | | new ZTPoint(574-251,476-329),//游龙惊风破 |
| | | new ZTPoint(431-251,542-329),//九霄风雷 |
| | | new ZTPoint(663-295,545-331),//无限风域 |
| | | new List<Utility.Structs.ZTPoint> (){ |
| | | new Utility.Structs.ZTPoint(432-251,275-329),//风暴之拳 |
| | | new Utility.Structs.ZTPoint(479-251,342-329),//万象风龙阵 |
| | | new Utility.Structs.ZTPoint(572-251,340-329),//御风之力 |
| | | new Utility.Structs.ZTPoint(433-251,478-329),//风神决 |
| | | new Utility.Structs.ZTPoint(526-251,475-329),//风卷残云 |
| | | new Utility.Structs.ZTPoint(574-251,476-329),//游龙惊风破 |
| | | new Utility.Structs.ZTPoint(431-251,542-329),//九霄风雷 |
| | | new Utility.Structs.ZTPoint(663-295,545-331),//无限风域 |
| | | } |
| | | }; |
| | | |
| | |
| | | private bool SettingSPSkills() |
| | | { |
| | | //选中sp技能学习 |
| | | ZTPoint spPoint = new ZTPoint(lvRect.End.X + 55, lvRect.Start.Y - 80); |
| | | Utility.Structs.ZTPoint spPoint = new Utility.Structs.ZTPoint(lvRect.End.X + 55, lvRect.Start.Y - 80); |
| | | G.Instance.InputControl.MoveToAndClick(spPoint); |
| | | |
| | | ZTRectangle numberLimitArea = new ZTRectangle(lvRect.Start.X-5,lvRect.End.Y,lvRect.End.X+21,lvRect.End.Y+340); |
| | |
| | | private bool SettingTPSkills() |
| | | { |
| | | //选中tp技能学习 |
| | | ZTPoint spPoint = new ZTPoint(lvRect.End.X + 253, lvRect.Start.Y - 80); |
| | | Utility.Structs.ZTPoint spPoint = new Utility.Structs.ZTPoint(lvRect.End.X + 253, lvRect.Start.Y - 80); |
| | | G.Instance.InputControl.MoveToAndClick(spPoint); |
| | | |
| | | ZTPoint[] skills = new ZTPoint[] { |
| | | Utility.Structs.ZTPoint[] skills = new Utility.Structs.ZTPoint[] { |
| | | |
| | | new ZTPoint(334-296,277-251),//1.第一行第一个 |
| | | new ZTPoint(381-296,545-251),//2.第三行第二个 |
| | | new ZTPoint(664-296,413-251),//3.第二行倒数第三个 |
| | | new ZTPoint(567-296,410-251),//4.第二行倒数第五个 |
| | | new ZTPoint(758-296,411-251),//5.第二行倒数第一个 |
| | | new Utility.Structs.ZTPoint(334-296,277-251),//1.第一行第一个 |
| | | new Utility.Structs.ZTPoint(381-296,545-251),//2.第三行第二个 |
| | | new Utility.Structs.ZTPoint(664-296,413-251),//3.第二行倒数第三个 |
| | | new Utility.Structs.ZTPoint(567-296,410-251),//4.第二行倒数第五个 |
| | | new Utility.Structs.ZTPoint(758-296,411-251),//5.第二行倒数第一个 |
| | | }; |
| | | |
| | | for (int i = 0; i < skills.Length; i++) |
| | |
| | | /// <returns></returns> |
| | | private bool Studay() |
| | | { |
| | | ZTPoint studayPoint = new ZTPoint(this.downKeyRect.Start.X-331,this.downKeyRect.End.Y+27); |
| | | Utility.Structs.ZTPoint studayPoint = new Utility.Structs.ZTPoint(this.downKeyRect.Start.X-331,this.downKeyRect.End.Y+27); |
| | | G.Instance.InputControl.MoveToAndClick(studayPoint); |
| | | Thread.Sleep(1000); |
| | | //点击确认 |
| | |
| | | /// </summary> |
| | | /// <param name="skillPoint"></param> |
| | | /// <returns></returns> |
| | | private bool SettingSkill(ZTPoint skillPoint) |
| | | private bool SettingSkill(Utility.Structs.ZTPoint skillPoint) |
| | | { |
| | | //84,71 |
| | | ZTRectangle limitRect = new ZTRectangle(skillPoint.X-84,skillPoint.Y-71,skillPoint.X+84,skillPoint.Y+71); |
| | |
| | | { |
| | | studayTextRect = ZTRectangle.Empty; |
| | | ZTRectangle innerstudyTextRect = ZTRectangle.Empty; |
| | | ZTPoint openwindowButton = new ZTPoint(this.titleRect.Start.X + 194, this.titleRect.Start.Y + 517); |
| | | Utility.Structs.ZTPoint openwindowButton = new Utility.Structs.ZTPoint(this.titleRect.Start.X + 194, this.titleRect.Start.Y + 517); |
| | | for (int i = 0; i < 2; i++) |
| | | { |
| | | if (this.cancellationToken.IsCancellationRequested) |
| | |
| | | return false; |
| | | } |
| | | //获取位置,并将鼠标移到位置,显示出技能名 |
| | | ZTPoint studayPoint = GetStudaySkillRect(studayTextRect, i).GetCenterPoint(); |
| | | Utility.Structs.ZTPoint studayPoint = GetStudaySkillRect(studayTextRect, i).GetCenterPoint(); |
| | | G.Instance.InputControl.MoveTo(studayPoint.X, studayPoint.Y, false, false, false); |
| | | Thread.Sleep(1000); |
| | | |
| | |
| | | if (skillToExpressMap.ContainsKey(skillIndex)) |
| | | { |
| | | //要放到技能栏的位置 |
| | | ZTPoint to = GetExpressSkillRect(skillToExpressMap[skillIndex]).GetCenterPoint(); |
| | | Utility.Structs.ZTPoint to = GetExpressSkillRect(skillToExpressMap[skillIndex]).GetCenterPoint(); |
| | | MoveSkill(studayPoint, to); |
| | | count--; |
| | | continue; |
| | |
| | | /// <param name="from"></param> |
| | | /// <param name="to"></param> |
| | | /// <returns></returns> |
| | | private bool MoveSkill(ZTPoint from, ZTPoint to) |
| | | private bool MoveSkill(Utility.Structs.ZTPoint from, Utility.Structs.ZTPoint to) |
| | | { |
| | | //移动指定位置 |
| | | G.Instance.InputControl.MoveTo(from.X, from.Y, false, false, false); |