|
|
|
@ -13,16 +13,23 @@ public class Task_仓库奖励领取 extends BaseTask {
|
|
|
|
|
@Override
|
|
|
|
|
public void task(JMacro macro, ViewRect viewRect) {
|
|
|
|
|
Logger.info("打开面板");
|
|
|
|
|
boolean 城镇_打开面板 = macro.matchLegendAndClick("城镇_打开面板", 0.6);
|
|
|
|
|
if (!城镇_打开面板) {
|
|
|
|
|
Logger.error("打开面板失败");
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
Logger.info("检测关闭按钮");
|
|
|
|
|
ViewRect 城镇_关闭面板 = macro.matchLegend("城镇_关闭面板", 0.6);
|
|
|
|
|
if (城镇_关闭面板 == null) {
|
|
|
|
|
Logger.error("未检测到面板关闭按钮,中断任务");
|
|
|
|
|
return;
|
|
|
|
|
ViewRect[] viewRects = macro.matchLegends(macro.of("城镇_面板1选中", "城镇_面板2选中"), 0.9);
|
|
|
|
|
if (viewRects[0] == null && viewRects[1] == null) {
|
|
|
|
|
Logger.info("面板未打开");
|
|
|
|
|
Logger.info("检测面板打开按钮,打开面板");
|
|
|
|
|
boolean 城镇_打开面板 = macro.matchLegendAndClick("城镇_打开面板", 0.6);
|
|
|
|
|
if (!城镇_打开面板) {
|
|
|
|
|
Logger.error("打开面板失败");
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
Logger.info("检测关闭按钮");
|
|
|
|
|
ViewRect 城镇_关闭面板 = macro.matchLegend("城镇_关闭面板", 0.6);
|
|
|
|
|
if (城镇_关闭面板 == null) {
|
|
|
|
|
Logger.error("未检测到面板关闭按钮,打开失败");
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
Logger.info("面板已打开");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Logger.info("选中城镇");
|
|
|
|
@ -33,19 +40,23 @@ public class Task_仓库奖励领取 extends BaseTask {
|
|
|
|
|
macro.mouseLeftDrag(macro.of(158, 626), macro.of(163, 231), true);
|
|
|
|
|
macro.delay(1000);
|
|
|
|
|
|
|
|
|
|
ViewRect 仓库_补给完成 = macro.matchLegend("仓库_补给完成", 0.9);
|
|
|
|
|
if (仓库_补给完成 == null) {
|
|
|
|
|
ViewRect[] 补给完成 = macro.matchLegends(macro.of("仓库_补给完成", "仓库_补给完成2"), 0.9);
|
|
|
|
|
if (补给完成[0] == null && 补给完成[1] == null) {
|
|
|
|
|
Logger.info("未检测到仓库补给完成状态");
|
|
|
|
|
Logger.info("关闭面板");
|
|
|
|
|
boolean 关闭面板 = macro.matchLegendAndClick("城镇_关闭面板", 0.6);
|
|
|
|
|
if (!关闭面板) {
|
|
|
|
|
Logger.error("关闭面板失败");
|
|
|
|
|
}
|
|
|
|
|
macro.matchLegendAndClick("城镇_关闭面板", 0.6);
|
|
|
|
|
macro.delay(1000);
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Logger.info("仓库补给完成,去领取");
|
|
|
|
|
macro.delay(500);
|
|
|
|
|
macro.mouseLeftClick(macro.of(164, 621));
|
|
|
|
|
if (补给完成[0] != null) {
|
|
|
|
|
macro.mouseLeftClick(补给完成[0]);
|
|
|
|
|
}
|
|
|
|
|
if (补给完成[1] != null) {
|
|
|
|
|
macro.mouseLeftClick(补给完成[1]);
|
|
|
|
|
}
|
|
|
|
|
macro.delay(1000);
|
|
|
|
|
|
|
|
|
|
Logger.info("点击领取");
|
|
|
|
|