JS脚本:提瓦特全自动钓鱼【修复】 (#1519)
* 修复了月卡等待异常的问题 * Delete repo/js/AutoFishingTeyvat/assets/archive.json * Delete repo/js/AutoFishingTeyvat/READEME.md
This commit is contained in:
@@ -461,44 +461,57 @@
|
|||||||
fishing_time = path_time;
|
fishing_time = path_time;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (auto_skip) {
|
||||||
|
// log.info(`[DEBUG] 开始自动领取月卡`);
|
||||||
// 4点自动领取月卡
|
// 4点自动领取月卡
|
||||||
let time_now = new Date();
|
let time_now = new Date();
|
||||||
let time_4 = new Date(time_now.getFullYear(), time_now.getMonth(), time_now.getDate(), 4, 0, 0); // 4点
|
let time_4 = new Date(time_now.getFullYear(), time_now.getMonth(), time_now.getDate(), 4, 0, 0); // 4点
|
||||||
|
// log.info(`[DEBUG] time_now: ${time_now}`);
|
||||||
|
// log.info(`[DEBUG] time_4: ${time_4}`);
|
||||||
let time_predict_end; // 根据超时时间预测本次钓鱼结束时间(加1分钟容错)
|
let time_predict_end; // 根据超时时间预测本次钓鱼结束时间(加1分钟容错)
|
||||||
if (fishing_time === "全天") {
|
if (fishing_time === "全天") {
|
||||||
time_predict_end = time_now.setSeconds(time_now.getSeconds() + time_out_whole * 2 + 60);
|
time_predict_end = new Date(time_now.getTime() + (time_out_whole * 2 + 60) * 1000);
|
||||||
} else {
|
} else {
|
||||||
time_predict_end = time_now.setSeconds(time_now.getSeconds() + time_out_whole + 60);
|
time_predict_end = new Date(time_now.getTime() + (time_out_whole + 60) * 1000);
|
||||||
}
|
}
|
||||||
|
// log.info(`[DEBUG] time_predict_end: ${time_predict_end}`);
|
||||||
|
// log.info(`[DEBUG] ${time_now < time_4} | ${time_predict_end >= time_4}`);
|
||||||
// 30s点击一次,等待领取月卡
|
// 30s点击一次,等待领取月卡
|
||||||
let step_flag = 0; // 领取月卡步骤标志
|
let step_flag = 0; // 领取月卡步骤标志
|
||||||
while (auto_skip && time_now < time_4 && time_predict_end >= time_4) {
|
while (time_now < time_4 && time_predict_end >= time_4) {
|
||||||
log.info(`等待领取月卡(剩余${Math.floor((time_4 - new Date()) / 1000)}s)...`);
|
log.info(`等待领取月卡(剩余${Math.floor((time_4 - new Date()) / 1000)}s)...`);
|
||||||
if (step_flag === 0) {
|
if (step_flag === 0) {
|
||||||
// 传送到七天神像
|
// 传送到七天神像
|
||||||
await pathingScript.runFile(base_path_pathing + statue_name + ".json");
|
await pathingScript.runFile(base_path_statues + statue_name + ".json");
|
||||||
step_flag += 1;
|
step_flag += 1;
|
||||||
}
|
}
|
||||||
await sleep(30000);
|
await sleep(30000);
|
||||||
keyDown("VK_LBUTTON");
|
keyPress("ESCAPE");
|
||||||
await sleep(100);
|
await sleep(2000);
|
||||||
keyUp("VK_LBUTTON");
|
keyPress("ESCAPE");
|
||||||
|
|
||||||
|
time_now = new Date();
|
||||||
|
|
||||||
|
}
|
||||||
// 本次已经到达4点(5s容错)
|
// 本次已经到达4点(5s容错)
|
||||||
if (new Date() > time_4.setSeconds(time_4.getSeconds() - 5)) {
|
if (new Date() > time_4.setSeconds(time_4.getSeconds())) {
|
||||||
|
await sleep(5000);
|
||||||
step_flag += 1;
|
step_flag += 1;
|
||||||
auto_skip = false;
|
auto_skip = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
|
||||||
// 领取月卡(点击两次)
|
// 领取月卡(点击两次)
|
||||||
if (step_flag === 2) {
|
if (step_flag === 2) {
|
||||||
// step_flag = 0;
|
// step_flag = 0;
|
||||||
await sleep(5); // 补回容错时间
|
await sleep(5000); // 补回容错时间
|
||||||
await click(1450, 1020); // 点击时间调节的确认按钮的位置
|
await click(1450, 1020); // 点击时间调节的确认按钮的位置
|
||||||
await sleep(5); // 等待月卡动画时间
|
await sleep(5000); // 等待月卡动画时间
|
||||||
await click(1450, 1020);
|
await click(1450, 1020);
|
||||||
await sleep(1);
|
await sleep(1000);
|
||||||
|
await click(1450, 1020);
|
||||||
|
await sleep(1000);
|
||||||
|
await click(1450, 1020);
|
||||||
|
await sleep(1000);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
log.info(`该钓鱼点的时间: ${fishing_time}`);
|
log.info(`该钓鱼点的时间: ${fishing_time}`);
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"manifest_version": 1,
|
"manifest_version": 1,
|
||||||
"name": "提瓦特自动钓鱼(全流程+自选)",
|
"name": "提瓦特自动钓鱼(全流程+自选)",
|
||||||
"version": "2.2.4",
|
"version": "2.2.5",
|
||||||
"bgi_version": "0.47.0",
|
"bgi_version": "0.47.0",
|
||||||
"description": "支持自动追踪并垂钓bgi支持的全提瓦特垂钓点",
|
"description": "支持自动追踪并垂钓bgi支持的全提瓦特垂钓点",
|
||||||
"authors": [
|
"authors": [
|
||||||
|
|||||||
Reference in New Issue
Block a user