mirror of
https://github.com/babalae/bettergi-scripts-list.git
synced 2026-04-01 06:09:50 +08:00
* docs: 重命名 * refactor: 更新页面滚动高度计算逻辑 * feat: 添加圣遗物属性命中功能并优化强化逻辑 * feat: 月落银 版本需求降至 0.49.0 * refactor(utils): 提取通用工具函数到独立文件 * refactor(utils): 提取语言配置到独立工具模块 * feat(language): 添加多语言支持功能 * feat(language): 多语言框架进一步完善 languageUtils 为 多语言模块框架 的全部配置 assets/language/ 为 多语言模块框架 的本地语言匹配图片 * docs: 添加多语言适配模块说明 * fix(holyRelicsUpUtils): 修复debug函数参数使用错误
102 lines
1.9 KiB
JavaScript
102 lines
1.9 KiB
JavaScript
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
|
||
}; |