Before Width: | Height: | Size: 778 B |
Before Width: | Height: | Size: 3.5 KiB |
Before Width: | Height: | Size: 4.2 KiB |
Before Width: | Height: | Size: 3.7 KiB |
Before Width: | Height: | Size: 2.3 KiB |
Before Width: | Height: | Size: 514 B |
Before Width: | Height: | Size: 1.0 KiB |
Before Width: | Height: | Size: 791 B |
Before Width: | Height: | Size: 3.0 KiB |
Before Width: | Height: | Size: 1.6 KiB |
Before Width: | Height: | Size: 2.3 KiB |
Before Width: | Height: | Size: 4.3 KiB |
Before Width: | Height: | Size: 2.3 KiB |
Before Width: | Height: | Size: 2.1 KiB |
Before Width: | Height: | Size: 9.2 KiB |
Before Width: | Height: | Size: 2.0 KiB |
Before Width: | Height: | Size: 1.9 KiB |
Before Width: | Height: | Size: 3.4 KiB |
Before Width: | Height: | Size: 2.7 KiB |
Before Width: | Height: | Size: 327 B |
Before Width: | Height: | Size: 2.4 KiB |
Before Width: | Height: | Size: 374 B |
Before Width: | Height: | Size: 822 B |
Before Width: | Height: | Size: 972 B |
Before Width: | Height: | Size: 861 B |
Before Width: | Height: | Size: 453 B |
Before Width: | Height: | Size: 2.8 KiB |
Before Width: | Height: | Size: 3.1 KiB |
Before Width: | Height: | Size: 2.5 KiB |
Before Width: | Height: | Size: 592 B |
Before Width: | Height: | Size: 303 B |
Before Width: | Height: | Size: 3.1 KiB |
Before Width: | Height: | Size: 551 B |
Before Width: | Height: | Size: 557 B |
Before Width: | Height: | Size: 416 B |
Before Width: | Height: | Size: 20 KiB |
Before Width: | Height: | Size: 1.7 KiB |
Before Width: | Height: | Size: 2.0 KiB |
Before Width: | Height: | Size: 1.8 KiB |
Before Width: | Height: | Size: 2.1 KiB |
Before Width: | Height: | Size: 1.3 KiB |
Before Width: | Height: | Size: 1.3 KiB |
Before Width: | Height: | Size: 1.3 KiB |
Before Width: | Height: | Size: 1.3 KiB |
Before Width: | Height: | Size: 1.7 KiB |
Before Width: | Height: | Size: 1.7 KiB |
Before Width: | Height: | Size: 522 B |
After Width: | Height: | Size: 1.4 KiB |
After Width: | Height: | Size: 1.1 KiB |
Before Width: | Height: | Size: 80 B |
Before Width: | Height: | Size: 3.3 KiB |
Before Width: | Height: | Size: 5.5 KiB |
Before Width: | Height: | Size: 2.3 KiB |
Before Width: | Height: | Size: 169 B |
Before Width: | Height: | Size: 92 B |
Before Width: | Height: | Size: 1.0 KiB |
Before Width: | Height: | Size: 1.1 KiB |
Before Width: | Height: | Size: 6.4 KiB |
Before Width: | Height: | Size: 2.2 KiB |
Before Width: | Height: | Size: 1.9 KiB |
Before Width: | Height: | Size: 1.4 KiB |
Before Width: | Height: | Size: 3.1 KiB |
Before Width: | Height: | Size: 7.3 KiB |
Before Width: | Height: | Size: 1.7 KiB |
Before Width: | Height: | Size: 1.4 KiB |
Before Width: | Height: | Size: 2.3 KiB |
Before Width: | Height: | Size: 4.2 KiB |
Before Width: | Height: | Size: 6.5 KiB |
Before Width: | Height: | Size: 1.7 KiB |
Before Width: | Height: | Size: 5.0 KiB |
Before Width: | Height: | Size: 2.2 KiB |
Before Width: | Height: | Size: 3.4 KiB |
Before Width: | Height: | Size: 1.2 KiB |
Before Width: | Height: | Size: 1.5 KiB |
Before Width: | Height: | Size: 2.8 KiB |
Before Width: | Height: | Size: 974 B |
Before Width: | Height: | Size: 2.6 KiB |
Before Width: | Height: | Size: 1.7 KiB |
Before Width: | Height: | Size: 3.9 KiB |
Before Width: | Height: | Size: 3.4 KiB |
Before Width: | Height: | Size: 10 KiB |
Before Width: | Height: | Size: 3.0 KiB |
Before Width: | Height: | Size: 4.9 KiB |
Before Width: | Height: | Size: 3.9 KiB |
Before Width: | Height: | Size: 316 B |
Before Width: | Height: | Size: 521 B |
Before Width: | Height: | Size: 458 B |
Before Width: | Height: | Size: 578 B |
Before Width: | Height: | Size: 439 B |
Before Width: | Height: | Size: 560 B |
Before Width: | Height: | Size: 492 B |
Before Width: | Height: | Size: 612 B |
Before Width: | Height: | Size: 2.3 KiB |
@ -1,64 +0,0 @@
|
||||
package xyz.wbsite.jmacro.wjdr.task;
|
||||
|
||||
import xyz.wbsite.jmacro.JMacro;
|
||||
import xyz.wbsite.jmacro.JMainService;
|
||||
import xyz.wbsite.jmacro.base.ViewRect;
|
||||
import xyz.wbsite.jmacro.ex.MacroErrorException;
|
||||
import xyz.wbsite.jmacro.util.Logger;
|
||||
|
||||
/**
|
||||
* 基础任务类
|
||||
*/
|
||||
public abstract class BaseTask {
|
||||
|
||||
/**
|
||||
* 脚本持有对象
|
||||
*/
|
||||
protected JMacro macro;
|
||||
|
||||
/**
|
||||
* 应用窗口
|
||||
*/
|
||||
protected ViewRect viewRect;
|
||||
|
||||
public BaseTask(JMacro macro, ViewRect viewRect) {
|
||||
this.macro = macro;
|
||||
this.viewRect = viewRect;
|
||||
}
|
||||
|
||||
public void run() {
|
||||
if (!JMainService.getInstance().run) {
|
||||
Logger.error("服务中断");
|
||||
return;
|
||||
}
|
||||
String name = getClass().getSimpleName();
|
||||
try {
|
||||
Logger.info("》》》任务[{}]开始》》》", name);
|
||||
this.task(macro, viewRect);
|
||||
Logger.info("》》》任务[{}]结束》》》", name);
|
||||
} catch (Exception e) {
|
||||
Logger.info("》》》任务[{}]异常中断》》》", name);
|
||||
throw e;
|
||||
}
|
||||
}
|
||||
|
||||
public void isReady() {
|
||||
for (int i = 0; i < 10; i++) {
|
||||
ViewRect rect = macro.matchLegend("野外", 0.9);
|
||||
if (rect != null) {
|
||||
return;
|
||||
}
|
||||
macro.delay(100);
|
||||
}
|
||||
|
||||
throw new MacroErrorException("请返回城镇");
|
||||
}
|
||||
|
||||
/**
|
||||
* 任务
|
||||
*
|
||||
* @param macro 脚本
|
||||
* @param viewRect 视口
|
||||
*/
|
||||
public abstract void task(JMacro macro, ViewRect viewRect);
|
||||
}
|