Files
bettergi-scripts-list/repo/js/HolyRelicsUp/utils/holyRelicsUpUtils.js
云端客 59fb3cfa4f [圣遗物批量强化]多语言框架进一步完善 (#1891)
* docs: 重命名

* refactor: 更新页面滚动高度计算逻辑

* feat: 添加圣遗物属性命中功能并优化强化逻辑

* feat: 月落银 版本需求降至 0.49.0

* refactor(utils): 提取通用工具函数到独立文件

* refactor(utils): 提取语言配置到独立工具模块

* feat(language): 添加多语言支持功能

* feat(language): 多语言框架进一步完善
languageUtils 为 多语言模块框架 的全部配置
assets/language/ 为 多语言模块框架 的本地语言匹配图片

* docs: 添加多语言适配模块说明

* fix(holyRelicsUpUtils): 修复debug函数参数使用错误
2025-09-13 22:16:28 +08:00

102 lines
1.9 KiB
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
function info(msg, must = false,log_off=false) {
if (log_off || must) {
log.info(msg)
}
}
function warn(msg, must = false,log_off=false) {
if (log_off || must) {
log.warn(msg)
}
}
function debug(msg, must = false,log_off=false) {
if (log_off || must) {
log.debug(msg)
}
}
function error(msg, must = false,log_off=false) {
if (log_off || must) {
log.error(msg)
}
}
function throwError(msg) {
notification.error(`${msg}`);
}
function openCaptureGameRegion() {
return captureGameRegion()
}
function closeCaptureGameRegion(region) {
region.Dispose()
}
function findByCaptureGameRegion(region, templateMatchObject) {
return region.find(templateMatchObject)
}
function findMultiByCaptureGameRegion(region, templateMatchObject) {
return region.findMulti(templateMatchObject)
}
function mTo(x, y) {
moveMouseTo(x, y);
}
function recognitionObjectOcr(x, y, width, height) {
return RecognitionObject.Ocr(x, y, width, height)
}
function downLeftButton() {
leftButtonDown();
}
function upLeftButton() {
leftButtonUp();
}
function moveByMouse(x, y) {
moveMouseBy(x, y);
}
async function wait(ms = 1000) {
// 等待300毫秒确保按下操作生效
await sleep(ms);
}
function downClick(x, y) {
click(x, y);
}
/**
* 检查资源是否存在
* @param {Object} res - 需要检查的资源对象
* @returns {Boolean} 返回资源是否存在的结果
* true表示资源存在false表示资源不存在
*/
function isExist(res) {
return res.isExist() // 调用资源对象的isExist方法获取存在状态
}
this.holyRelicsUpUtils = {
isExist,
info,
warn,
debug,
error,
throwError,
openCaptureGameRegion,
closeCaptureGameRegion,
findByCaptureGameRegion,
findMultiByCaptureGameRegion,
mTo,
recognitionObjectOcr,
downLeftButton,
upLeftButton,
moveByMouse,
wait,
downClick
};