parent
cde7464548
commit
f2cb1dda46
@ -0,0 +1,75 @@
|
||||
package xyz.wbsite.jmacro.wjdr.task;
|
||||
|
||||
import xyz.wbsite.jmacro.JMacro;
|
||||
import xyz.wbsite.jmacro.base.ViewRect;
|
||||
import xyz.wbsite.jmacro.util.Logger;
|
||||
|
||||
public class Task_英雄招募领取 extends BaseTask {
|
||||
|
||||
public Task_英雄招募领取(JMacro macro, ViewRect viewRect) {
|
||||
super(macro, viewRect);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void task(JMacro macro, ViewRect viewRect) {
|
||||
Logger.info("打开面板");
|
||||
boolean 城镇_打开面板 = macro.matchLegendAndClick("城镇_打开面板", 0.6);
|
||||
if (!城镇_打开面板) {
|
||||
Logger.error("打开面板失败");
|
||||
return;
|
||||
}
|
||||
|
||||
Logger.info("选中城镇");
|
||||
macro.mouseLeftClick(macro.of(85, 200));
|
||||
macro.delay(1000);
|
||||
|
||||
Logger.info("滑动到底部");
|
||||
macro.mouseLeftDrag(macro.of(158, 626), macro.of(163, 231), true);
|
||||
macro.delay(1000);
|
||||
|
||||
|
||||
ViewRect 英雄招募_免费招募 = macro.findLegend(macro.of(129, 448, 200, 630), "英雄招募_免费招募", 0.5);
|
||||
if (英雄招募_免费招募 == null) {
|
||||
Logger.info("未检测到【免费招募】");
|
||||
return;
|
||||
}
|
||||
|
||||
macro.mouseLeftClick(英雄招募_免费招募);
|
||||
macro.delay(1000);
|
||||
|
||||
{
|
||||
boolean 英雄招募_高级招募 = macro.matchLegendAndClick("英雄招募_高级招募", 0.9);
|
||||
if (英雄招募_高级招募) {
|
||||
macro.delay(500);
|
||||
macro.mouseLeftClick(macro.getFocusRect());
|
||||
macro.delay(1000);
|
||||
|
||||
Logger.info("检测任意位置继续");
|
||||
ViewRect 点击任意位置退出 = macro.waitAndMatchLegend("英雄招募_点击任意位置退出", 0.5, 3);
|
||||
if (点击任意位置退出 != null) {
|
||||
Logger.info("点击任意位置退出");
|
||||
macro.mouseLeftClick(点击任意位置退出);
|
||||
macro.delay(1500);
|
||||
}
|
||||
}
|
||||
}
|
||||
{
|
||||
boolean 英雄招募_史诗招募 = macro.matchLegendAndClick("英雄招募_史诗招募", 0.9);
|
||||
if (英雄招募_史诗招募) {
|
||||
macro.delay(500);
|
||||
macro.mouseLeftClick(macro.getFocusRect());
|
||||
macro.delay(1000);
|
||||
|
||||
Logger.info("检测任意位置继续");
|
||||
ViewRect 点击任意位置退出 = macro.waitAndMatchLegend("英雄招募_点击任意位置退出", 0.5, 3);
|
||||
if (点击任意位置退出 != null) {
|
||||
Logger.info("点击任意位置退出");
|
||||
macro.mouseLeftClick(点击任意位置退出);
|
||||
macro.delay(1500);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
macro.matchLegendAndClick("英雄招募_返回", 0.9);
|
||||
}
|
||||
}
|
Loading…
Reference in new issue