From bdb7e164fe3ad56f3f61b04befe999eb134456b9 Mon Sep 17 00:00:00 2001 From: EmeraldMerchant <96396730+EmeraldMerchant@users.noreply.github.com> Date: Wed, 14 Sep 2022 08:11:25 +0800 Subject: fix rounding error --- utils/numberUtils.js | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/utils/numberUtils.js b/utils/numberUtils.js index 327f875..442015d 100644 --- a/utils/numberUtils.js +++ b/utils/numberUtils.js @@ -86,10 +86,11 @@ let utils = { }, timeNumber: (time, secondDecimals = 0) => { let mins = Math.floor(time / 1000 / 60) - let secs = Math.floor(time / 1000) % 60 - - if (mins === 0) return secs + "s" - return `${mins}m ${secs.toFixed(secondDecimals)}s` + let secs = (time / 1000) % 60 + let text = "" + if (mins === 0) text = `${secs.toFixed(secondDecimals)}s` + else text = `${mins}m ${secs.toFixed(secondDecimals)}s` + return text }, timeNumber2: (time) => { let hours = Math.floor(time / 1000 / 60 / 60) -- cgit From 299c7d6c26402ee43bf4719dba57db08d375b4aa Mon Sep 17 00:00:00 2001 From: EmeraldMerchant <96396730+EmeraldMerchant@users.noreply.github.com> Date: Wed, 14 Sep 2022 08:12:33 +0800 Subject: Update numberUtils.js --- utils/numberUtils.js | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/utils/numberUtils.js b/utils/numberUtils.js index 442015d..3b1dc70 100644 --- a/utils/numberUtils.js +++ b/utils/numberUtils.js @@ -87,10 +87,9 @@ let utils = { timeNumber: (time, secondDecimals = 0) => { let mins = Math.floor(time / 1000 / 60) let secs = (time / 1000) % 60 - let text = "" - if (mins === 0) text = `${secs.toFixed(secondDecimals)}s` - else text = `${mins}m ${secs.toFixed(secondDecimals)}s` - return text + + if (mins === 0) return `${secs.toFixed(secondDecimals)}s` + else return `${mins}m ${secs.toFixed(secondDecimals)}s` }, timeNumber2: (time) => { let hours = Math.floor(time / 1000 / 60 / 60) -- cgit From 3f0e9dcb5f0123b31e6ac26dbdae3d293d97ffe5 Mon Sep 17 00:00:00 2001 From: EmeraldMerchant <96396730+EmeraldMerchant@users.noreply.github.com> Date: Wed, 14 Sep 2022 08:13:02 +0800 Subject: Update numberUtils.js --- utils/numberUtils.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/utils/numberUtils.js b/utils/numberUtils.js index 3b1dc70..b701c21 100644 --- a/utils/numberUtils.js +++ b/utils/numberUtils.js @@ -87,7 +87,7 @@ let utils = { timeNumber: (time, secondDecimals = 0) => { let mins = Math.floor(time / 1000 / 60) let secs = (time / 1000) % 60 - + if (mins === 0) return `${secs.toFixed(secondDecimals)}s` else return `${mins}m ${secs.toFixed(secondDecimals)}s` }, -- cgit From 62a8f8d492f92ccb241abfb66406caeddd4efa54 Mon Sep 17 00:00:00 2001 From: EmeraldMerchant <96396730+EmeraldMerchant@users.noreply.github.com> Date: Wed, 14 Sep 2022 08:13:39 +0800 Subject: Update numberUtils.js --- utils/numberUtils.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/utils/numberUtils.js b/utils/numberUtils.js index b701c21..8d5e7c3 100644 --- a/utils/numberUtils.js +++ b/utils/numberUtils.js @@ -89,7 +89,7 @@ let utils = { let secs = (time / 1000) % 60 if (mins === 0) return `${secs.toFixed(secondDecimals)}s` - else return `${mins}m ${secs.toFixed(secondDecimals)}s` + return `${mins}m ${secs.toFixed(secondDecimals)}s` }, timeNumber2: (time) => { let hours = Math.floor(time / 1000 / 60 / 60) -- cgit From e444bc60f64fb4e192220732bb650f99e8efef03 Mon Sep 17 00:00:00 2001 From: EmeraldMerchant <96396730+EmeraldMerchant@users.noreply.github.com> Date: Wed, 14 Sep 2022 09:59:02 +0800 Subject: fixed nether mini hp hud = nether miniboss hp hud not disappearing after leaving nether (if left mid boss fight/ dead) --- features/nether/index.js | 1 + 1 file changed, 1 insertion(+) diff --git a/features/nether/index.js b/features/nether/index.js index 49388bd..77d8f27 100644 --- a/features/nether/index.js +++ b/features/nether/index.js @@ -143,6 +143,7 @@ class Nether extends Feature { this.controlLocLast = undefined this.controlLoc = undefined this.controlSkeleton = undefined + this.miniboss = undefined }) this.registerChat("You completed your rescue quest! Visit the Town Board to claim the rewards,", () => { -- cgit From b330adc9fe67c010737acab95b66d72f0ce9140e Mon Sep 17 00:00:00 2001 From: EmeraldMerchant <96396730+EmeraldMerchant@users.noreply.github.com> Date: Wed, 14 Sep 2022 10:10:37 +0800 Subject: added chest/h + chest/h --- features/specialMining/index.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/features/specialMining/index.js b/features/specialMining/index.js index c7929fb..147193a 100644 --- a/features/specialMining/index.js +++ b/features/specialMining/index.js @@ -87,6 +87,7 @@ class PowderAndScatha extends Feature { this.expRateInfo = [] this.mythrilRate = 0 this.gemstoneRate = 0 + this.chestRate = 0 this.saveMiningData(); this.registerCommand("resetpowderdata", () => { @@ -119,6 +120,7 @@ class PowderAndScatha extends Feature { this.mythrilRate = (this.miningData.powder.mithril - mythril) / (Date.now() - time) this.gemstoneRate = (this.miningData.powder.gemstone - gemstone) / (Date.now() - time) + this.chestRate = (this.miningData.powder.chestRate - chestRate) / (Date.now() - time) }) }) @@ -326,6 +328,10 @@ class PowderAndScatha extends Feature { this.overlayLeft.push(`&bGems/h:`) this.overlayRight.push(`&d${numberWithCommas(Math.round(this.gemstoneRate * 1000 * 60 * 60))}`) } + if (this.chestRate) { + this.overlayLeft.push(`&bChests/h:`) + this.overlayRight.push(`&d${numberWithCommas(Math.round(this.chestRate * 1000 * 60 * 60))}`) + } } if (this.scathaCounter.getValue() && this.inCrystalHollows) { let tempText = `&6Scatha Counter\n&bKills: ${this.miningData.scatha.total_worms}\n&bWorms: ${this.miningData.scatha.worms}\n&bScathas: ${this.miningData.scatha.scathas}\n&bSince Scatha: ${this.miningData.scatha.since_scatha}\n` -- cgit