parent
f837faf724
commit
ee3aadaa7f
After Width: | Height: | Size: 3.5 KiB |
After Width: | Height: | Size: 3.4 KiB |
Before Width: | Height: | Size: 9.7 KiB |
After Width: | Height: | Size: 1.1 KiB |
After Width: | Height: | Size: 4.1 KiB |
After Width: | Height: | Size: 3.4 KiB |
@ -0,0 +1,93 @@
|
|||||||
|
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) {
|
||||||
|
while (true) {
|
||||||
|
{// 野外返回
|
||||||
|
ViewRect rect = macro.matchLegend("野外", 0.9);
|
||||||
|
if (rect != null) {
|
||||||
|
macro.mouseLeftClick(rect);
|
||||||
|
Logger.info("当前位置:城镇");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
{// 野外返回
|
||||||
|
ViewRect rect = macro.matchLegend("城镇", 0.9);
|
||||||
|
if (rect != null) {
|
||||||
|
macro.mouseLeftClick(rect);
|
||||||
|
Logger.info("返回城镇");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
{// 其他页面返回
|
||||||
|
ViewRect rect = macro.matchLegend("返回", 0.9);
|
||||||
|
if (rect != null) {
|
||||||
|
macro.mouseLeftClick(rect);
|
||||||
|
Logger.info("返回城镇");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
{ // 定位弹框,关闭弹框
|
||||||
|
ViewRect rect = macro.findLegend(macro.of(437, 28, 491, 106), "城镇_礼包", 0.7);
|
||||||
|
if (rect != null) {
|
||||||
|
macro.mouseLeftClick(rect);
|
||||||
|
Logger.info("关闭充值广告弹框");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
{// 定位离线收益
|
||||||
|
ViewRect rect = macro.matchLegend("城镇_离线收益", 0.9);
|
||||||
|
if (rect != null) {
|
||||||
|
macro.mouseLeftClick(rect);
|
||||||
|
Logger.info("关闭离线收益弹框");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
{// 无行军队列弹框
|
||||||
|
ViewRect rect = macro.matchLegend("野外_资源无对队列", 0.9);
|
||||||
|
if (rect != null) {
|
||||||
|
macro.mouseLeftClick(macro.of(471, 250));
|
||||||
|
Logger.info("关闭弹框无对队列弹框");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
{// 无行军队列弹框
|
||||||
|
ViewRect rect = macro.matchLegend("野外_搜索", 0.9);
|
||||||
|
if (rect != null) {
|
||||||
|
macro.mouseLeftClick(macro.of(253, 426));
|
||||||
|
Logger.info("关闭野外搜索弹框");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
{// 一键领取弹框
|
||||||
|
ViewRect rect = macro.matchLegend("一键领取", 0.9);
|
||||||
|
if (rect != null) {
|
||||||
|
macro.mouseLeftClick(rect);
|
||||||
|
Logger.info("一键领取");
|
||||||
|
macro.delay(500);
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
{// 点击任务位置退出
|
||||||
|
ViewRect rect = macro.matchLegend("点击任意位置退出", 0.9);
|
||||||
|
if (rect != null) {
|
||||||
|
macro.mouseLeftClick(rect);
|
||||||
|
Logger.info("点击任意位置退出");
|
||||||
|
macro.delay(500);
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
{// 每日任务
|
||||||
|
ViewRect rect = macro.matchLegend("每日任务关闭", 0.9);
|
||||||
|
if (rect != null) {
|
||||||
|
macro.mouseLeftClick(rect);
|
||||||
|
Logger.info("关闭每日任务关闭弹框");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in new issue