自动采集

wjdr
wangbing 11 months ago
parent a3f40a9683
commit 0354ebb5d9

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 522 B

After

Width:  |  Height:  |  Size: 522 B

@ -311,11 +311,7 @@ public abstract class JMacro {
*
*/
public ViewRect getFocusRect() {
if (focusRect != null) {
return focusRect;
}
// 返回屏幕区域
return getScreenRect();
return focusRect;
}
/**

@ -4,7 +4,8 @@ import cn.hutool.core.date.DateTime;
import cn.hutool.core.date.DateUtil;
import cn.hutool.core.lang.caller.CallerUtil;
import cn.hutool.core.util.StrUtil;
import xyz.wbsite.jmacro.JMainService;
import cn.hutool.log.level.Level;
import xyz.wbsite.jmacro.ex.MacroErrorException;
/**
*
@ -15,9 +16,10 @@ import xyz.wbsite.jmacro.JMainService;
*/
public class Logger {
public static void info(String format, Object... arg) {
DateTime date = DateUtil.date();
String level = "INFO";
String level = Level.INFO.toString();
String log = StrUtil.format(format, arg);
String name = CallerUtil.getCallerCaller().getSimpleName();
// 获取当前线程的堆栈追踪
@ -27,17 +29,16 @@ public class Logger {
System.out.println(StrUtil.format("[{}] [{}] {} [{}:{}]", date, level, log, name, lineNumber));
}
public static void error(String log, Object... arg) {
info(log, arg);
// 中断1分钟
for (int i = 0; i < 60; i++) {
if (JMainService.getInstance().run) {
try {
Thread.sleep(1000);
} catch (InterruptedException e) {
throw new RuntimeException(e);
}
}
}
public static void error(String format, Object... arg) {
DateTime date = DateUtil.date();
String level = Level.ERROR.toString();
String log = StrUtil.format(format, arg);
String name = CallerUtil.getCallerCaller().getSimpleName();
// 获取当前线程的堆栈追踪
StackTraceElement[] stackTrace = Thread.currentThread().getStackTrace();
// 通常堆栈追踪数组的第三个元素是logMessage方法的调用者
int lineNumber = stackTrace[2].getLineNumber();
System.out.println(StrUtil.format("[{}] [{}] {} [{}:{}]", date, level, log, name, lineNumber));
throw new MacroErrorException(StrUtil.format(format, arg));
}
}

@ -35,12 +35,21 @@ public class MacroForWJDR extends JMacro {
@Override
public synchronized ViewRect focus() {
Logger.info("请确保MuMu显示分辨率为540 x 960(DPI 240)");
Logger.info("请确保MuMu配置如下");
Logger.info("显卡渲染模式Vulkan模式");
Logger.info("性能配置:中性能");
Logger.info("显卡使用策略:画面标签更好");
Logger.info("其他优化:强制使用独立显卡");
Logger.info("分辨率设置显示分辨率为540 x 960(DPI 240)");
Logger.info("画面设置画面亮度【50】画面风格【普通】");
Logger.info("帧率设置60");
Logger.info("技术上次关闭时的窗口位置和大小60");
Logger.info("固定窗口大小,禁止手动拉伸");
ViewRect rect = getScreenRect();
Logger.info("查找定位MuMu工具栏");
ViewRect mumu = findLegend("慕慕_工具栏", 0.95d);
ViewRect mumu = findLegend("慕慕_工具栏", 0.98d);
if (mumu == null) {
Logger.info("聚焦窗口失败,默认全屏");
Logger.error("聚焦窗口失败");
} else {
// 计算应用窗口返回
rect.setLeft(mumu.getLeft() - 428);

Loading…
Cancel
Save

Powered by TurnKey Linux.