v0.17.3 - Declare jpxChainRetryCount (fix ReferenceError crash on battle init)
This commit is contained in:
parent
30bade19bd
commit
6a7d5a435b
5 changed files with 12 additions and 9 deletions
|
|
@ -1,7 +1,7 @@
|
||||||
// ==UserScript==
|
// ==UserScript==
|
||||||
// @name HV Unified
|
// @name HV Unified
|
||||||
// @namespace hvunified
|
// @namespace hvunified
|
||||||
// @version 0.17.2
|
// @version 0.17.3
|
||||||
// @description HV Unified — Bridge & Strategy/Gear Advisor for HentaiVerse (complements Monsterbation & HVUtils)
|
// @description HV Unified — Bridge & Strategy/Gear Advisor for HentaiVerse (complements Monsterbation & HVUtils)
|
||||||
// @author GaboGG + Hermes
|
// @author GaboGG + Hermes
|
||||||
// @match *://*.hentaiverse.org/*
|
// @match *://*.hentaiverse.org/*
|
||||||
|
|
@ -18,7 +18,7 @@
|
||||||
// CONFIG — default settings
|
// CONFIG — default settings
|
||||||
// ═══════════════════════════════════════════════════════════════════════
|
// ═══════════════════════════════════════════════════════════════════════
|
||||||
|
|
||||||
const VERSION = '0.17.2';
|
const VERSION = '0.17.3';
|
||||||
|
|
||||||
const CFG = {
|
const CFG = {
|
||||||
// — Battle strategy advisory
|
// — Battle strategy advisory
|
||||||
|
|
@ -1562,6 +1562,7 @@ let jpxChainRounds = 0; // rounds chained this battle
|
||||||
let jpxChainTimer = null;
|
let jpxChainTimer = null;
|
||||||
let jpxLastActive = null; // last known isActiveBattle from jpx
|
let jpxLastActive = null; // last known isActiveBattle from jpx
|
||||||
let jpxChainCooldown = 0; // timestamp guard to avoid double-trigger
|
let jpxChainCooldown = 0; // timestamp guard to avoid double-trigger
|
||||||
|
let jpxChainRetryCount = 0; // lazy-start retry counter
|
||||||
|
|
||||||
function jpxPresent() {
|
function jpxPresent() {
|
||||||
return !!(document.getElementById('ctrl-widget') ||
|
return !!(document.getElementById('ctrl-widget') ||
|
||||||
|
|
@ -1575,7 +1576,6 @@ function jpxChainStart() {
|
||||||
if (jpxChainEnabled) return;
|
if (jpxChainEnabled) return;
|
||||||
if (!jpxPresent()) {
|
if (!jpxPresent()) {
|
||||||
// Retry a few times over ~6s before giving up
|
// Retry a few times over ~6s before giving up
|
||||||
if (!jpxChainRetryCount) jpxChainRetryCount = 0;
|
|
||||||
if (jpxChainRetryCount < 10) {
|
if (jpxChainRetryCount < 10) {
|
||||||
jpxChainRetryCount++;
|
jpxChainRetryCount++;
|
||||||
setTimeout(jpxChainStart, 600);
|
setTimeout(jpxChainStart, 600);
|
||||||
|
|
@ -1666,6 +1666,7 @@ function jpxChainOnState(detail) {
|
||||||
function jpxChainStop(reason) {
|
function jpxChainStop(reason) {
|
||||||
if (!jpxChainEnabled) return;
|
if (!jpxChainEnabled) return;
|
||||||
jpxChainEnabled = false;
|
jpxChainEnabled = false;
|
||||||
|
jpxChainRetryCount = 0;
|
||||||
console.log('%c[HV] ⛓ jpx auto-chain stopped: ' + reason, 'color:#f80');
|
console.log('%c[HV] ⛓ jpx auto-chain stopped: ' + reason, 'color:#f80');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
// ==UserScript==
|
// ==UserScript==
|
||||||
// @name HV Unified
|
// @name HV Unified
|
||||||
// @namespace hvunified
|
// @namespace hvunified
|
||||||
// @version 0.17.2
|
// @version 0.17.3
|
||||||
// @description HV Unified — Bridge & Strategy/Gear Advisor for HentaiVerse (complements Monsterbation & HVUtils)
|
// @description HV Unified — Bridge & Strategy/Gear Advisor for HentaiVerse (complements Monsterbation & HVUtils)
|
||||||
// @author GaboGG + Hermes
|
// @author GaboGG + Hermes
|
||||||
// @match *://*.hentaiverse.org/*
|
// @match *://*.hentaiverse.org/*
|
||||||
|
|
@ -18,7 +18,7 @@
|
||||||
// CONFIG — default settings
|
// CONFIG — default settings
|
||||||
// ═══════════════════════════════════════════════════════════════════════
|
// ═══════════════════════════════════════════════════════════════════════
|
||||||
|
|
||||||
const VERSION = '0.17.2';
|
const VERSION = '0.17.3';
|
||||||
|
|
||||||
const CFG = {
|
const CFG = {
|
||||||
// — Battle strategy advisory
|
// — Battle strategy advisory
|
||||||
|
|
@ -1562,6 +1562,7 @@ let jpxChainRounds = 0; // rounds chained this battle
|
||||||
let jpxChainTimer = null;
|
let jpxChainTimer = null;
|
||||||
let jpxLastActive = null; // last known isActiveBattle from jpx
|
let jpxLastActive = null; // last known isActiveBattle from jpx
|
||||||
let jpxChainCooldown = 0; // timestamp guard to avoid double-trigger
|
let jpxChainCooldown = 0; // timestamp guard to avoid double-trigger
|
||||||
|
let jpxChainRetryCount = 0; // lazy-start retry counter
|
||||||
|
|
||||||
function jpxPresent() {
|
function jpxPresent() {
|
||||||
return !!(document.getElementById('ctrl-widget') ||
|
return !!(document.getElementById('ctrl-widget') ||
|
||||||
|
|
@ -1575,7 +1576,6 @@ function jpxChainStart() {
|
||||||
if (jpxChainEnabled) return;
|
if (jpxChainEnabled) return;
|
||||||
if (!jpxPresent()) {
|
if (!jpxPresent()) {
|
||||||
// Retry a few times over ~6s before giving up
|
// Retry a few times over ~6s before giving up
|
||||||
if (!jpxChainRetryCount) jpxChainRetryCount = 0;
|
|
||||||
if (jpxChainRetryCount < 10) {
|
if (jpxChainRetryCount < 10) {
|
||||||
jpxChainRetryCount++;
|
jpxChainRetryCount++;
|
||||||
setTimeout(jpxChainStart, 600);
|
setTimeout(jpxChainStart, 600);
|
||||||
|
|
@ -1666,6 +1666,7 @@ function jpxChainOnState(detail) {
|
||||||
function jpxChainStop(reason) {
|
function jpxChainStop(reason) {
|
||||||
if (!jpxChainEnabled) return;
|
if (!jpxChainEnabled) return;
|
||||||
jpxChainEnabled = false;
|
jpxChainEnabled = false;
|
||||||
|
jpxChainRetryCount = 0;
|
||||||
console.log('%c[HV] ⛓ jpx auto-chain stopped: ' + reason, 'color:#f80');
|
console.log('%c[HV] ⛓ jpx auto-chain stopped: ' + reason, 'color:#f80');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,7 @@
|
||||||
// CONFIG — default settings
|
// CONFIG — default settings
|
||||||
// ═══════════════════════════════════════════════════════════════════════
|
// ═══════════════════════════════════════════════════════════════════════
|
||||||
|
|
||||||
const VERSION = '0.17.2';
|
const VERSION = '0.17.3';
|
||||||
|
|
||||||
const CFG = {
|
const CFG = {
|
||||||
// — Battle strategy advisory
|
// — Battle strategy advisory
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
// ==UserScript==
|
// ==UserScript==
|
||||||
// @name HV Unified
|
// @name HV Unified
|
||||||
// @namespace hvunified
|
// @namespace hvunified
|
||||||
// @version 0.17.2
|
// @version 0.17.3
|
||||||
// @description HV Unified — Bridge & Strategy/Gear Advisor for HentaiVerse (complements Monsterbation & HVUtils)
|
// @description HV Unified — Bridge & Strategy/Gear Advisor for HentaiVerse (complements Monsterbation & HVUtils)
|
||||||
// @author GaboGG + Hermes
|
// @author GaboGG + Hermes
|
||||||
// @match *://*.hentaiverse.org/*
|
// @match *://*.hentaiverse.org/*
|
||||||
|
|
|
||||||
|
|
@ -15,6 +15,7 @@ let jpxChainRounds = 0; // rounds chained this battle
|
||||||
let jpxChainTimer = null;
|
let jpxChainTimer = null;
|
||||||
let jpxLastActive = null; // last known isActiveBattle from jpx
|
let jpxLastActive = null; // last known isActiveBattle from jpx
|
||||||
let jpxChainCooldown = 0; // timestamp guard to avoid double-trigger
|
let jpxChainCooldown = 0; // timestamp guard to avoid double-trigger
|
||||||
|
let jpxChainRetryCount = 0; // lazy-start retry counter
|
||||||
|
|
||||||
function jpxPresent() {
|
function jpxPresent() {
|
||||||
return !!(document.getElementById('ctrl-widget') ||
|
return !!(document.getElementById('ctrl-widget') ||
|
||||||
|
|
@ -28,7 +29,6 @@ function jpxChainStart() {
|
||||||
if (jpxChainEnabled) return;
|
if (jpxChainEnabled) return;
|
||||||
if (!jpxPresent()) {
|
if (!jpxPresent()) {
|
||||||
// Retry a few times over ~6s before giving up
|
// Retry a few times over ~6s before giving up
|
||||||
if (!jpxChainRetryCount) jpxChainRetryCount = 0;
|
|
||||||
if (jpxChainRetryCount < 10) {
|
if (jpxChainRetryCount < 10) {
|
||||||
jpxChainRetryCount++;
|
jpxChainRetryCount++;
|
||||||
setTimeout(jpxChainStart, 600);
|
setTimeout(jpxChainStart, 600);
|
||||||
|
|
@ -119,6 +119,7 @@ function jpxChainOnState(detail) {
|
||||||
function jpxChainStop(reason) {
|
function jpxChainStop(reason) {
|
||||||
if (!jpxChainEnabled) return;
|
if (!jpxChainEnabled) return;
|
||||||
jpxChainEnabled = false;
|
jpxChainEnabled = false;
|
||||||
|
jpxChainRetryCount = 0;
|
||||||
console.log('%c[HV] ⛓ jpx auto-chain stopped: ' + reason, 'color:#f80');
|
console.log('%c[HV] ⛓ jpx auto-chain stopped: ' + reason, 'color:#f80');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue