mirror of
https://github.com/babalae/bettergi-scripts-list.git
synced 2026-03-18 03:53:24 +08:00
fix: AutoFishing cdCal (#2748)
This commit is contained in:
@@ -243,7 +243,7 @@
|
||||
* @description
|
||||
* 当前采用的CD计算为基于当前冷却时间对象中的 status 属性,计算并返回三天后(从当天 0 点开始计算)的时间戳。
|
||||
*/
|
||||
async function cdCal(status) {
|
||||
function cdCal(status, current_cd) {
|
||||
// 计算垂钓点再次可用的时间戳
|
||||
let critical_time_date = new Date(current_cd[status]);
|
||||
critical_time_date.setHours(0, 0, 0, 0);
|
||||
@@ -750,7 +750,7 @@
|
||||
if (fishing_time === "全天") {
|
||||
let daytime = true;
|
||||
if (current_cd["Daytime"] !== null) {
|
||||
let critical_time = cdCal("Daytime");
|
||||
let critical_time = cdCal("Daytime", current_cd);
|
||||
|
||||
if (now < critical_time) {
|
||||
log.info(`该垂钓点(白天)处于冷却状态,剩余时间: ${formatTimeDifference(critical_time - now)}`);
|
||||
@@ -763,7 +763,7 @@
|
||||
}
|
||||
|
||||
if (current_cd["Nighttime"] !== null) {
|
||||
let critical_time = cdCal("Nighttime");
|
||||
let critical_time = cdCal("Nighttime", current_cd);
|
||||
|
||||
if (now < critical_time) {
|
||||
log.info(`该垂钓点(夜晚)处于冷却状态,剩余时间: ${formatTimeDifference(critical_time - now)}`);
|
||||
@@ -779,7 +779,7 @@
|
||||
}
|
||||
} else if (fishing_time === "白天") {
|
||||
if (current_cd["Daytime"] !== null) {
|
||||
let critical_time = cdCal("Daytime");
|
||||
let critical_time = cdCal("Daytime", current_cd);
|
||||
|
||||
if (now < critical_time) {
|
||||
log.info(`该垂钓点(白天)处于冷却状态,剩余时间: ${formatTimeDifference(critical_time - now)}`);
|
||||
@@ -791,7 +791,7 @@
|
||||
}
|
||||
} else if (fishing_time === "夜晚") {
|
||||
if (current_cd["Nighttime"] !== null) {
|
||||
let critical_time = cdCal("Nighttime");
|
||||
let critical_time = cdCal("Nighttime", current_cd);
|
||||
|
||||
if (now < critical_time) {
|
||||
log.info(`该垂钓点(夜晚)处于冷却状态,剩余时间: ${formatTimeDifference(critical_time - now)}`);
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"manifest_version": 1,
|
||||
"name": "提瓦特自动钓鱼(全流程+自选)",
|
||||
"version": "2.4.0",
|
||||
"version": "2.4.1",
|
||||
"bgi_version": "0.55.0",
|
||||
"description": "支持自动追踪并垂钓bgi支持的全提瓦特垂钓点",
|
||||
"authors": [
|
||||
|
||||
Reference in New Issue
Block a user