From 740d3e1d2cf3bcc664438e864b926210896145ee Mon Sep 17 00:00:00 2001 From: Soopyboo32 <49228220+Soopyboo32@users.noreply.github.com> Date: Tue, 24 May 2022 15:59:26 +0800 Subject: + gemstone $/h tracker --- features/mining/index.js | 57 +++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 56 insertions(+), 1 deletion(-) (limited to 'features/mining') diff --git a/features/mining/index.js b/features/mining/index.js index a05552d..1c1eb5f 100644 --- a/features/mining/index.js +++ b/features/mining/index.js @@ -7,7 +7,8 @@ import * as utils from "../../utils/utils" import HudTextElement from "../hud/HudTextElement"; import LocationSetting from "../settings/settingThings/location"; import ToggleSetting from "../settings/settingThings/toggle"; -import { numberWithCommas } from "../../utils/numberUtils"; +import { numberWithCommas, timeSince } from "../../utils/numberUtils"; +import { fetch } from "../../utils/networkUtils"; class Mining extends Feature { constructor() { @@ -42,6 +43,14 @@ class Mining extends Feature { this.hudElements.push(this.compactHudElement) this.compactProgressHudOnlyWhenMoreThan0 = new ToggleSetting("Only show compact progress when it is above 0", "So that you dont need to disable it when you start doing something else", true, "compact_progress_disable_0", this).requires(this.compactProgressHud) + this.gemstoneMoneyHud = new ToggleSetting("Show $/h made from gemstone mining", "This will add a HUD element with the gemstone $/h", true, "gemstone_money_hud", this) + this.gemstoneMoneyHudElement = new HudTextElement() + .setToggleSetting(this.gemstoneMoneyHud) + .setLocationSetting(new LocationSetting("HUD Location", "Allows you to edit the location of the gemstone $/h", "gemstone_money_location", this, [10, 60, 1, 1]) + .requires(this.gemstoneMoneyHud) + .editTempText("&6$/h&7> &f$12,345,678\n&6$ made&7> &f$123,456,789\n&6Time tracked&7> &f123m")) + this.hudElements.push(this.gemstoneMoneyHudElement) + this.seenBalDamages = [] this.balHP = 250 this.lastBalAlive = 0 @@ -76,6 +85,52 @@ class Mining extends Feature { this.registerChat("&r&c&oThe boss looks weak and tired and retreats into the lava...&r", () => { this.balHP = 0 }) + + let startingTime = -1 + let money = 0 + let gemstoneCosts = {} + let lastMined = 0 + this.registerChat("&r&d&lPRISTINE! &r&fYou found &r${*} &r&aFlawed ${type} Gemstone &r&8x${num}&r&f!&r", (type, num) => { + let id = "FLAWED_" + type.toUpperCase() + "_GEM" + let number = parseInt(num) + + lastMined = Date.now() + + if (!this.gemstoneMoneyHud.getValue()) return + + if (startingTime === 0) return + if (startingTime === -1) { + startingTime = 0 + fetch("https://api.hypixel.net/skyblock/bazaar").json(data => { + startingTime = Date.now() + + Object.keys(data.products).forEach(id => { + if (id.startsWith("FLAWED_")) { + gemstoneCosts[id] = Math.max(240, data.products[id].quick_status.sellPrice) + console.log(id + ": " + gemstoneCosts[id]) + } + }) + }) + return + } + + money += gemstoneCosts[id] * number + + console.log(money) + let moneyPerHour = Math.floor(money / ((Date.now() - startingTime) / (1000 * 60 * 60))) + let moneyMade = Math.floor(money) + let timeTracked = timeSince(startingTime) + + this.gemstoneMoneyHudElement.setText("&6$/h&7> &f$" + numberWithCommas(moneyPerHour) + "\n&6$ made&7> &f$" + numberWithCommas(moneyMade) + "\n&6Time tracked&7> &f" + timeTracked) + }) + this.registerStep(false, 30, () => { + if (lastMined && Date.now() - lastMined > 60000) { + money = 0 + startingTime = -1 + lastMined = 0 + this.gemstoneMoneyHudElement.setText("") + } + }) } itemTooltipEvent(lore, item, event) { -- cgit From e822810c47267b4a8e8d6dc89084a8c3fb0d006a Mon Sep 17 00:00:00 2001 From: Soopyboo32 <49228220+Soopyboo32@users.noreply.github.com> Date: Tue, 24 May 2022 19:33:34 +0800 Subject: + CH current event indicator thingo --- features/mining/index.js | 28 ++++++++++++++++++++++++++-- 1 file changed, 26 insertions(+), 2 deletions(-) (limited to 'features/mining') diff --git a/features/mining/index.js b/features/mining/index.js index 1c1eb5f..d557aed 100644 --- a/features/mining/index.js +++ b/features/mining/index.js @@ -9,6 +9,7 @@ import LocationSetting from "../settings/settingThings/location"; import ToggleSetting from "../settings/settingThings/toggle"; import { numberWithCommas, timeSince } from "../../utils/numberUtils"; import { fetch } from "../../utils/networkUtils"; +import socketConnection from "../../socketConnection"; class Mining extends Feature { constructor() { @@ -51,6 +52,14 @@ class Mining extends Feature { .editTempText("&6$/h&7> &f$12,345,678\n&6$ made&7> &f$123,456,789\n&6Time tracked&7> &f123m")) this.hudElements.push(this.gemstoneMoneyHudElement) + this.nextChEvent = new ToggleSetting("Show the current and next crystal hollows event", "(syncs the data between all users in ch)", true, "chevent_hud", this) + this.nextChEventElement = new HudTextElement() + .setToggleSetting(this.nextChEvent) + .setLocationSetting(new LocationSetting("HUD Location", "Allows you to edit the location of the hud element", "chevent_hud_location", this, [10, 70, 1, 1]) + .requires(this.nextChEvent) + .editTempText("&6Event&7> &fGONE WITH THE WIND &7->&f 2X POWDER")) + this.hudElements.push(this.nextChEventElement) + this.seenBalDamages = [] this.balHP = 250 this.lastBalAlive = 0 @@ -116,7 +125,6 @@ class Mining extends Feature { money += gemstoneCosts[id] * number - console.log(money) let moneyPerHour = Math.floor(money / ((Date.now() - startingTime) / (1000 * 60 * 60))) let moneyMade = Math.floor(money) let timeTracked = timeSince(startingTime) @@ -128,8 +136,24 @@ class Mining extends Feature { money = 0 startingTime = -1 lastMined = 0 - this.gemstoneMoneyHudElement.setText("") + this.gemstoneMoneyHudElement.setText("&6Event&7> &f" + socketConnection.chEvent.join(" &7->&f ")) } + + this.nextChEventElement.setText() + }) + + // 2X POWDER ENDED! + // Passive Active Event + // 2X POWDER STARTED! + //&r&r&r &r&9&lGONE WITH THE WIND ENDED!&r + //§r§r§r §r§b§l2X POWDER ENDED!§r + //§r§r§r §r§b§l2X POWDER STARTED!§r + + this.registerChat("&r&r&r ${spaces}&r&${color}&l${event} ENDED!&r", (spaces, color, event) => { + socketConnection.sendCHEventData(event.trim(), false) + }) + this.registerChat("&r&r&r ${spaces}&r&${color}&l${event} STARTED!&r", (spaces, color, event) => { + socketConnection.sendCHEventData(event.trim(), true) }) } -- cgit From 062f87c1acca16a40c8944de27efaac9741b44e6 Mon Sep 17 00:00:00 2001 From: Soopyboo32 <49228220+Soopyboo32@users.noreply.github.com> Date: Tue, 24 May 2022 19:37:17 +0800 Subject: oops i edited the wrong thing --- features/mining/index.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'features/mining') diff --git a/features/mining/index.js b/features/mining/index.js index d557aed..eb1c434 100644 --- a/features/mining/index.js +++ b/features/mining/index.js @@ -136,10 +136,10 @@ class Mining extends Feature { money = 0 startingTime = -1 lastMined = 0 - this.gemstoneMoneyHudElement.setText("&6Event&7> &f" + socketConnection.chEvent.join(" &7->&f ")) + this.gemstoneMoneyHudElement.setText("") } - this.nextChEventElement.setText() + this.nextChEventElement.setText("&6Event&7> &f" + socketConnection.chEvent.join(" &7->&f ")) }) // 2X POWDER ENDED! -- cgit From 7d40a943f3148979f0572e17d2a4f6a7c49beeb7 Mon Sep 17 00:00:00 2001 From: Soopyboo32 <49228220+Soopyboo32@users.noreply.github.com> Date: Tue, 24 May 2022 20:13:39 +0800 Subject: + fix showing dwarven mines events on crystal hollows events thingo (oops) --- features/mining/index.js | 22 ++++++++++++++++------ 1 file changed, 16 insertions(+), 6 deletions(-) (limited to 'features/mining') diff --git a/features/mining/index.js b/features/mining/index.js index eb1c434..b8eb9c9 100644 --- a/features/mining/index.js +++ b/features/mining/index.js @@ -16,6 +16,11 @@ class Mining extends Feature { super() } + isInCH() { + if (!this.FeatureManager || !this.FeatureManager.features["dataLoader"]) return false + return this.FeatureManager.features["dataLoader"].class.area === "Crystal Hollows" + } + onEnable() { this.initVariables() @@ -142,17 +147,22 @@ class Mining extends Feature { this.nextChEventElement.setText("&6Event&7> &f" + socketConnection.chEvent.join(" &7->&f ")) }) - // 2X POWDER ENDED! - // Passive Active Event - // 2X POWDER STARTED! - //&r&r&r &r&9&lGONE WITH THE WIND ENDED!&r - //§r§r§r §r§b§l2X POWDER ENDED!§r - //§r§r§r §r§b§l2X POWDER STARTED!§r + let lastWorldChange = 0 + + this.registerEvent("worldLoad", () => { + lastWorldChange = Date.now() + }) this.registerChat("&r&r&r ${spaces}&r&${color}&l${event} ENDED!&r", (spaces, color, event) => { + if (Date.now() - lastWorldChange < 5000) return + if (!this.isInCH()) return + socketConnection.sendCHEventData(event.trim(), false) }) this.registerChat("&r&r&r ${spaces}&r&${color}&l${event} STARTED!&r", (spaces, color, event) => { + if (Date.now() - lastWorldChange < 5000) return + if (!this.isInCH()) return + socketConnection.sendCHEventData(event.trim(), true) }) } -- cgit From d24e54df28d92afebcd6d890e579340df84a010b Mon Sep 17 00:00:00 2001 From: Soopyboo32 <49228220+Soopyboo32@users.noreply.github.com> Date: Thu, 26 May 2022 12:35:28 +0800 Subject: + fix gemstoneMoneyHud for some people + fix scan current pet from pets menu --- features/mining/index.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'features/mining') diff --git a/features/mining/index.js b/features/mining/index.js index b8eb9c9..dec8728 100644 --- a/features/mining/index.js +++ b/features/mining/index.js @@ -76,7 +76,7 @@ class Mining extends Feature { this.armourstandClass = Java.type("net.minecraft.entity.item.EntityArmorStand").class - this.registerEvent("renderOverlay", this.renderOverlay).registeredWhen(() => this.balRespawnHud.getValue() || this.compactProgressHud.getValue()) + this.registerEvent("renderOverlay", this.renderOverlay).registeredWhen(() => this.balRespawnHud.getValue() || this.compactProgressHud.getValue() || this.gemstoneMoneyHud.getValue()) this.registerEvent("tick", this.tick) this.registerEvent("itemTooltip", this.itemTooltipEvent).registeredWhen(() => this.showContainedGemstoneSlots.getValue() || this.showUnlockedGemstoneSlots.getValue()) this.registerEvent("renderWorld", this.renderWorld).registeredWhen(() => this.guessBalHp.getValue()) @@ -104,7 +104,8 @@ class Mining extends Feature { let money = 0 let gemstoneCosts = {} let lastMined = 0 - this.registerChat("&r&d&lPRISTINE! &r&fYou found &r${*} &r&aFlawed ${type} Gemstone &r&8x${num}&r&f!&r", (type, num) => { + this.registerChat("&r&d&lPRISTINE! &r&fYou found &r${*} &r&aFlawed ${type} Gemstone &r&8x${num}&r&f!&r", (type, num, event) => { + let id = "FLAWED_" + type.toUpperCase() + "_GEM" let number = parseInt(num) @@ -136,7 +137,7 @@ class Mining extends Feature { this.gemstoneMoneyHudElement.setText("&6$/h&7> &f$" + numberWithCommas(moneyPerHour) + "\n&6$ made&7> &f$" + numberWithCommas(moneyMade) + "\n&6Time tracked&7> &f" + timeTracked) }) - this.registerStep(false, 30, () => { + this.registerStep(false, 10, () => { if (lastMined && Date.now() - lastMined > 60000) { money = 0 startingTime = -1 -- cgit From a0ae59e33748047377b5ae65df675759a10bff18 Mon Sep 17 00:00:00 2001 From: Soopyboo32 <49228220+Soopyboo32@users.noreply.github.com> Date: Thu, 26 May 2022 19:56:02 +0800 Subject: + fix sending boss into to wrong players sometimes + fix next ch event display for some people + change gemstone $/h to show both hours + minuites instead of just minuites / just hours --- features/mining/index.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'features/mining') diff --git a/features/mining/index.js b/features/mining/index.js index dec8728..9a9a881 100644 --- a/features/mining/index.js +++ b/features/mining/index.js @@ -76,7 +76,7 @@ class Mining extends Feature { this.armourstandClass = Java.type("net.minecraft.entity.item.EntityArmorStand").class - this.registerEvent("renderOverlay", this.renderOverlay).registeredWhen(() => this.balRespawnHud.getValue() || this.compactProgressHud.getValue() || this.gemstoneMoneyHud.getValue()) + this.registerEvent("renderOverlay", this.renderOverlay).registeredWhen(() => this.balRespawnHud.getValue() || this.compactProgressHud.getValue() || this.gemstoneMoneyHud.getValue() || this.nextChEvent.getValue()) this.registerEvent("tick", this.tick) this.registerEvent("itemTooltip", this.itemTooltipEvent).registeredWhen(() => this.showContainedGemstoneSlots.getValue() || this.showUnlockedGemstoneSlots.getValue()) this.registerEvent("renderWorld", this.renderWorld).registeredWhen(() => this.guessBalHp.getValue()) @@ -133,12 +133,12 @@ class Mining extends Feature { let moneyPerHour = Math.floor(money / ((Date.now() - startingTime) / (1000 * 60 * 60))) let moneyMade = Math.floor(money) - let timeTracked = timeSince(startingTime) + let timeTracked = timeSince2(startingTime) this.gemstoneMoneyHudElement.setText("&6$/h&7> &f$" + numberWithCommas(moneyPerHour) + "\n&6$ made&7> &f$" + numberWithCommas(moneyMade) + "\n&6Time tracked&7> &f" + timeTracked) }) this.registerStep(false, 10, () => { - if (lastMined && Date.now() - lastMined > 60000) { + if (lastMined && Date.now() - lastMined > 2 * 60000) { money = 0 startingTime = -1 lastMined = 0 -- cgit From d017ab83bb7ffbc10e7cde0014116464c725f37f Mon Sep 17 00:00:00 2001 From: Soopyboo32 <49228220+Soopyboo32@users.noreply.github.com> Date: Sat, 28 May 2022 10:00:15 +0800 Subject: + fix gemstone $/h from when i made it show both hours and minuites (i love not testing updates BatChamp) --- features/mining/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'features/mining') diff --git a/features/mining/index.js b/features/mining/index.js index 9a9a881..767bc82 100644 --- a/features/mining/index.js +++ b/features/mining/index.js @@ -7,7 +7,7 @@ import * as utils from "../../utils/utils" import HudTextElement from "../hud/HudTextElement"; import LocationSetting from "../settings/settingThings/location"; import ToggleSetting from "../settings/settingThings/toggle"; -import { numberWithCommas, timeSince } from "../../utils/numberUtils"; +import { numberWithCommas, timeSince2 } from "../../utils/numberUtils"; import { fetch } from "../../utils/networkUtils"; import socketConnection from "../../socketConnection"; -- cgit From 0985bdd291c3b2889c1e2fbc20f51cd4d7bc1e96 Mon Sep 17 00:00:00 2001 From: Soopyboo32 <49228220+Soopyboo32@users.noreply.github.com> Date: Sat, 28 May 2022 10:13:46 +0800 Subject: + Ok actually fix it this time (i tested) --- features/mining/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'features/mining') diff --git a/features/mining/index.js b/features/mining/index.js index 767bc82..ce71e6d 100644 --- a/features/mining/index.js +++ b/features/mining/index.js @@ -122,7 +122,7 @@ class Mining extends Feature { Object.keys(data.products).forEach(id => { if (id.startsWith("FLAWED_")) { gemstoneCosts[id] = Math.max(240, data.products[id].quick_status.sellPrice) - console.log(id + ": " + gemstoneCosts[id]) + // console.log(id + ": " + gemstoneCosts[id]) } }) }) -- cgit