v.1.4 参量质变仪 20250727 (#1417)
### v.1.4 20250727 - 优化当输入队伍名为空时的错误处理(设置过一次队伍再删除会判断为空而非未定义,之前没有触发错误提示)。 - 当质变仪在已经放入材料后,重新运行仍然尝试进行芭芭拉攻击流程。
This commit is contained in:
@@ -44,3 +44,10 @@
|
|||||||
|
|
||||||
- 更改下来滚动条方式,防止鼠标超出边界。
|
- 更改下来滚动条方式,防止鼠标超出边界。
|
||||||
- 规范化脚本名称,添加README.md文件。
|
- 规范化脚本名称,添加README.md文件。
|
||||||
|
|
||||||
|
### v.1.4 20250727
|
||||||
|
|
||||||
|
- 优化当输入队伍名为空时的错误处理(设置过一次队伍再删除会判断为空而非未定义,之前没有触发错误提示)。
|
||||||
|
- 当质变仪在已经放入材料后,重新运行仍然尝试进行芭芭拉攻击流程。
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
BIN
repo/js/ParametricTrans/assets/cha.png
Normal file
BIN
repo/js/ParametricTrans/assets/cha.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 2.2 KiB |
@@ -4,6 +4,7 @@
|
|||||||
var BH = typeof settings.BH === 'string' && settings.BH.trim() !== '' ? settings.BH : "assets/bh.png";
|
var BH = typeof settings.BH === 'string' && settings.BH.trim() !== '' ? settings.BH : "assets/bh.png";
|
||||||
var ZHIBIANYI = typeof settings.ZHIBIANY === 'string' && settings.ZHIBIANYI.trim() !== '' ? settings.ZHIBIANYI : "assets/zhibian.png";
|
var ZHIBIANYI = typeof settings.ZHIBIANY === 'string' && settings.ZHIBIANYI.trim() !== '' ? settings.ZHIBIANYI : "assets/zhibian.png";
|
||||||
var actiontime = settings.actiontime != undefined && ~~settings.actiontime > 0 ? ~~settings.actiontime : 50;
|
var actiontime = settings.actiontime != undefined && ~~settings.actiontime > 0 ? ~~settings.actiontime : 50;
|
||||||
|
var CHA = "assets/cha.png"
|
||||||
var TEAM
|
var TEAM
|
||||||
const ITEM = settings.ITEM !== undefined ? (
|
const ITEM = settings.ITEM !== undefined ? (
|
||||||
settings.ITEM === "1养成道具" ? 1 :
|
settings.ITEM === "1养成道具" ? 1 :
|
||||||
@@ -55,7 +56,7 @@
|
|||||||
if (res1 === res2){conuntcottimecot ++;res2=res1;}
|
if (res1 === res2){conuntcottimecot ++;res2=res1;}
|
||||||
log.info("输出模式:全图代码位置:({x},{y},{h},{w},{string})", res.x-10, res.y-10, res.width+10, res.Height+10, res.text);
|
log.info("输出模式:全图代码位置:({x},{y},{h},{w},{string})", res.x-10, res.y-10, res.width+10, res.Height+10, res.text);
|
||||||
if (Outcheak===1){ if (conuntcottimecot>=conuntcottimecomp/2){return result = { text: res.text, x: res.x, y: res.y, found: true };}else{return result = { found: false};}}
|
if (Outcheak===1){ if (conuntcottimecot>=conuntcottimecomp/2){return result = { text: res.text, x: res.x, y: res.y, found: true };}else{return result = { found: false};}}
|
||||||
}}}
|
}}}else{ if (debugmodel===3 && (ii % 2) === 1){await keyPress("W");}}
|
||||||
const NowTime = new Date();
|
const NowTime = new Date();
|
||||||
if ((NowTime - startTime)>timeout*1000){if (debugmodel===2){ if (resList.count === 0){return result = {found: false};} else{Outcheak=1;ii=2;} } else {Outcheak=0;if (debugmodel===1 & x===0 & y===0){log.info(`${timeout}秒超时退出,"${text}"未找到`)};return result = {found: false };}}
|
if ((NowTime - startTime)>timeout*1000){if (debugmodel===2){ if (resList.count === 0){return result = {found: false};} else{Outcheak=1;ii=2;} } else {Outcheak=0;if (debugmodel===1 & x===0 & y===0){log.info(`${timeout}秒超时退出,"${text}"未找到`)};return result = {found: false };}}
|
||||||
else{ii=2;if (debugmodel===1 & x===0 & y===0){log.info(`"${text}"识别中……`); } }
|
else{ii=2;if (debugmodel===1 & x===0 & y===0){log.info(`"${text}"识别中……`); } }
|
||||||
@@ -123,8 +124,10 @@ async function insertMaterial(){
|
|||||||
//检测并进入质变仪界面
|
//检测并进入质变仪界面
|
||||||
await middleButtonClick();
|
await middleButtonClick();
|
||||||
await sleep(500);
|
await sleep(500);
|
||||||
await textOCR("参量质变仪",1,2,0,1205,508,140,53);//单条F检测
|
let Fmeun = await textOCR("参量质变仪",2,2,3,1205,508,140,53);//单条F检测
|
||||||
await keyPress("F");
|
await keyPress("F");
|
||||||
|
let CHAx = await imageRecognition(CHA,3,0,0,1766,3,140,90);
|
||||||
|
if (!Fmeun.found && !CHAx.found){return false;}
|
||||||
|
|
||||||
//检测是否到达材料页面
|
//检测是否到达材料页面
|
||||||
await textOCR("进行质变",3,0,0,1675,994,150,50);if (!result.found){throw new Error("质变仪页面未打开");}//单条F检测
|
await textOCR("进行质变",3,0,0,1675,994,150,50);if (!result.found){throw new Error("质变仪页面未打开");}//单条F检测
|
||||||
@@ -223,7 +226,7 @@ async function executeAttack(){
|
|||||||
//main/======================================================================================
|
//main/======================================================================================
|
||||||
await genshin.returnMainUi();
|
await genshin.returnMainUi();
|
||||||
//检查用户是否配置队伍============================================
|
//检查用户是否配置队伍============================================
|
||||||
if (settings.TEAMname === undefined) {
|
if (settings.TEAMname === undefined || settings.TEAMname === "" || settings.TEAMname === null) {
|
||||||
throw new Error("必填!请在配置页面填写队伍名称,芭芭拉放4号位!"); // 没选就报错后停止
|
throw new Error("必填!请在配置页面填写队伍名称,芭芭拉放4号位!"); // 没选就报错后停止
|
||||||
}else{TEAM = settings.TEAMname}
|
}else{TEAM = settings.TEAMname}
|
||||||
|
|
||||||
@@ -234,7 +237,9 @@ async function executeAttack(){
|
|||||||
if ((await deployTransformer())) {//部署质变仪流程
|
if ((await deployTransformer())) {//部署质变仪流程
|
||||||
log.info("部署成功,准备放入薄荷!!");
|
log.info("部署成功,准备放入薄荷!!");
|
||||||
}
|
}
|
||||||
if ((await insertMaterial())) {//放入薄荷并开始质变流程
|
if ((!await insertMaterial())) {//放入薄荷并开始质变流程
|
||||||
|
log.info("未找到布置的质变仪,可能已经放入材料,尝试进行攻击流程!!");
|
||||||
|
}else{
|
||||||
log.info("放入薄荷完成,开始质变!!");
|
log.info("放入薄荷完成,开始质变!!");
|
||||||
}
|
}
|
||||||
if ((await executeAttack())) {//芭芭拉攻击指令流程
|
if ((await executeAttack())) {//芭芭拉攻击指令流程
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"manifest_version": 1,
|
"manifest_version": 1,
|
||||||
"name": "参量质变仪",
|
"name": "参量质变仪",
|
||||||
"version": "1.3",
|
"version": "1.4",
|
||||||
"bgi_version": "0.44.0",
|
"bgi_version": "0.44.0",
|
||||||
"description": "参量质变仪自动化,请注意说明文件,如有BUG请联系作者QQ:119996800",
|
"description": "参量质变仪自动化,请注意说明文件,如有BUG请联系作者QQ:119996800",
|
||||||
"tags": [
|
"tags": [
|
||||||
|
|||||||
Reference in New Issue
Block a user