From 030cbe72bdadea6226f2665cd5c2b2f04e272d9c Mon Sep 17 00:00:00 2001
From: Soopyboo32 <49228220+Soopyboo32@users.noreply.github.com>
Date: Sun, 22 May 2022 16:19:11 +0800
Subject: asd
---
features/eventsGUI/index.js | 221 ++++++++++++++++++++++++++++++++++++++++++-
features/soopyGui/GuiPage.js | 8 +-
features/soopyGui/index.js | 92 +++++++++---------
3 files changed, 270 insertions(+), 51 deletions(-)
(limited to 'features')
diff --git a/features/eventsGUI/index.js b/features/eventsGUI/index.js
index c828f85..d13d792 100644
--- a/features/eventsGUI/index.js
+++ b/features/eventsGUI/index.js
@@ -1,7 +1,17 @@
///
///
+import Enum from "../../../guimanager/Enum";
+import SoopyMouseClickEvent from "../../../guimanager/EventListener/SoopyMouseClickEvent";
import BoxWithLoading from "../../../guimanager/GuiElement/BoxWithLoading";
+import ButtonWithArrow from "../../../guimanager/GuiElement/ButtonWithArrow";
+import SoopyGuiElement from "../../../guimanager/GuiElement/SoopyGuiElement";
+import SoopyMarkdownElement from "../../../guimanager/GuiElement/SoopyMarkdownElement";
+import SoopyTextElement from "../../../guimanager/GuiElement/SoopyTextElement";
+import TextBox from "../../../guimanager/GuiElement/TextBox";
import Feature from "../../featureClass/class";
+import socketConnection from "../../socketConnection";
+import { timeSince } from "../../utils/numberUtils";
+import { firstLetterCapital } from "../../utils/stringUtils";
import GuiPage from "../soopyGui/GuiPage";
class EventsGui extends Feature {
@@ -12,10 +22,23 @@ class EventsGui extends Feature {
onEnable() {
this.initVariables()
- // this.GuiPage = new EventsPage() //TODO: SOON(tm)
+ this.GuiPage = new EventsPage()
// this.registerChat("&9&m-----------------------------------------------------&r&9${*}&r&9 ${*} &6Friends (Page ${pagenum} of ${maxpages})${friendslist}&r&9&m-----------------------------------------------------&r", (...args) => { this.GuiPage.friendListMessageEvent.call(this.GuiPage, ...args) })
- // this.registerStep(true, 5, () => { this.GuiPage.regenGuiElements.call(this.GuiPage) })
+ this.registerStep(true, 5, () => { this.GuiPage.regenGuiElements.call(this.GuiPage) })
+ this.registerStep(false, 60, () => { this.GuiPage.pollData.call(this.GuiPage) })
+ }
+
+ eventsDataUpdated(data) {
+ this.GuiPage.eventsDataUpdated(data)
+ }
+
+ joinEventResult(data) {
+ this.GuiPage.joinEventResult(data)
+ }
+
+ pollEventData(admin) {
+ this.GuiPage.pollEventData(admin)
}
initVariables() {
@@ -32,17 +55,207 @@ class EventsPage extends GuiPage {
constructor() {
super(8)
- this.name = "Guild Events"
+ this.name = "Events"
this.pages = [this.newPage()]
- this.pages[0].addChild(new BoxWithLoading().setLocation(0.3, 0.3, 0.4, 0.4))
+ this.leaderboardElm = undefined
+ this.memberData = undefined
+
+ this.lastScroll = 1
+
+ this.leaderboardChildren = []
+
+ this.code = undefined
this.finaliseLoading()
}
+ updateNotInEvent() {
+ this.pages[0].clearChildren()
+
+ this.pages[0].addChild(new SoopyTextElement().setText("§0You are not currently in any events").setMaxTextScale(3).setLocation(0.2, 0.1, 0.6, 0.2))
+ this.pages[0].addChild(new SoopyTextElement().setText("§0If you have a join code enter it here").setMaxTextScale(1).setLocation(0.3, 0.4, 0.4, 0.1))
+ let joinBox = new TextBox().setPlaceholder("Code here").setLocation(0.3, 0.5, 0.4, 0.1)
+ this.pages[0].addChild(joinBox)
+
+ this.pages[0].addChild(new ButtonWithArrow().setLocation(0.35, 0.6, 0.3, 0.1).setText("§0Join Event").addEvent(new SoopyMouseClickEvent().setHandler(() => {
+
+ let code = joinBox.getText()
+
+ this.pages[0].clearChildren()
+ this.pages[0].addChild(new BoxWithLoading().setLocation(0.3, 0.3, 0.4, 0.4))
+
+ socketConnection.pollEventCode(code)
+
+ this.code = code
+ })))
+ }
+
+ updateInEvent(data) {
+ //MAIN PAGE
+
+ this.pages[0].clearChildren()
+
+ this.pages[0].addChild(new SoopyTextElement().setText("§0You are curently in an event managed by §6" + data.admin).setMaxTextScale(3).setLocation(0.1, 0.05, 0.8, 0.2))
+
+ if (!data.members[Player.getUUID().toString().replace(/-/g, "")]) {
+ this.pages[0].addChild(new ButtonWithArrow().setText("Join").setLocation(0.05, 0.2, 0.1, 0.05).addEvent(new SoopyMouseClickEvent().setHandler(() => {
+ this.pages[0].clearChildren()
+ this.pages[0].addChild(new BoxWithLoading().setLocation(0.3, 0.3, 0.4, 0.4))
+
+ socketConnection.pollEventCode(data.code)
+
+ this.code = data.code
+ })))
+ }
+
+ let leaderboard = new SoopyGuiElement().setLocation(0.1, 0.3, 0.8, 0.7).setScrollable(true)
+
+ this.pages[0].addChild(leaderboard)
+
+ let playerPosition = -1
+
+ if (this.leaderboardElm) {
+ let scroll = this.leaderboardElm._scrollAmount
+
+ leaderboard._scrollAmount = scroll
+ leaderboard.location.scroll.y.set(scroll, 0)
+ }
+
+ this.leaderboardElm = leaderboard
+
+ Object.values(data.members).sort((a, b) => b.progress - a.progress).forEach((m, i) => {
+ let isPlayer = m.uuid === Player.getUUID().toString().replace(/-/g, "")
+
+ if (isPlayer) playerPosition = i + 1
+
+ let nameLine = new SoopyTextElement().setText(`${isPlayer ? "§d" : "§0"}#${i + 1} ${m.username}`).setLocation(0, i * 0.05, 0.5, 0.05).setLore(["Last updated " + timeSince(m.timestamp) + " ago"])
+ nameLine.timestamp = m.timestamp
+ leaderboard.addChild(nameLine)
+ leaderboard.addChild(new SoopyTextElement().setText(`§0+${Math.floor(m.progress)}`).setLocation(0.5, i * 0.05, 0.5, 0.05))
+ })
+
+ this.leaderboardChildren = [...leaderboard.children]
+
+ this.lastScroll = 1
+
+ if (playerPosition >= 0) {
+ this.pages[0].addChild(new SoopyTextElement().setText("§0You are #" + playerPosition + " with +" + Math.floor(data.members[Player.getUUID().toString().replace(/-/g, "")].progress)).setMaxTextScale(2).setLocation(0.2, 0.2, 0.6, 0.1))
+ }
+
+ // SIDEBAR
+
+ let sideBarElm = new SoopyGuiElement().setLocation(0, 0, 1, 1).setScrollable(true)
+
+ sideBarElm.addChild(new SoopyTextElement().setText("§0Event Settings").setMaxTextScale(3).setLocation(0.1, 0, 0.8, 0.2))
+
+ sideBarElm.addChild(new SoopyMarkdownElement().setLocation(0.05, 0.2, 0.9, 1).setText("# Tracking: \n" + data.settings.tracking.map(a => firstLetterCapital(a.replace(/\w+?_/, "").replace(/_/g, " "))).join("\n")))
+
+ this.openSidebarPage(sideBarElm)
+ }
+
+ regenGuiElements() {
+ if (!this.isOpen()) return
+
+ if (this.leaderboardElm) {
+ let scroll = this.leaderboardElm.location.scroll.y.get()
+ if (this.lastScroll !== scroll) {
+ this.lastScroll = scroll
+
+ this.leaderboardElm.children = []
+
+ let min = this.leaderboardElm.location.getYExact() - 100
+ let max = min + 200 + this.leaderboardElm.location.getHeightExact()
+ let lastChildNotAdded = undefined
+ this.leaderboardChildren.forEach(c => {
+ c.setParent(this.leaderboardElm)
+ c.triggerEvent(Enum.EVENT.RESET_FRAME_CACHES)
+
+ let y = c.location.getYExact()
+
+ if (y > min && y < max) {
+ this.leaderboardElm.children.push(c)
+ } else {
+ lastChildNotAdded = c
+ }
+ })
+
+ if (lastChildNotAdded) {
+ this.leaderboardElm.children.push(lastChildNotAdded)
+ }
+ }
+
+
+ this.leaderboardChildren.forEach(c => {
+ if (c.timestamp) {
+ c.setLore(["Last updated " + timeSince(c.timestamp) + " ago"])
+ }
+ })
+ }
+ }
+
+ eventsDataUpdated(data) {
+ if (!data.inEvent) {
+ this.updateNotInEvent()
+ return
+ }
+
+ this.updateInEvent(data)
+ }
+
+ pollEventData(admin) {
+ if (!admin) {
+ this.updateNotInEvent()
+ this.pages[0].addChild(new SoopyTextElement().setText("§cInvalid code").setMaxTextScale(3).setLocation(0.2, 0.7, 0.6, 0.2))
+ return
+ }
+ this.pages[0].clearChildren()
+ this.pages[0].addChild(new SoopyTextElement().setText("§0Join §6" + admin + "§0's event?").setMaxTextScale(3).setLocation(0.2, 0.2, 0.6, 0.2))
+ this.pages[0].addChild(new ButtonWithArrow().setText("§0Join").setLocation(0.4, 0.4, 0.4, 0.3).addEvent(new SoopyMouseClickEvent().setHandler(() => {
+ socketConnection.joinEvent(this.code)
+ this.pages[0].clearChildren()
+ this.pages[0].addChild(new BoxWithLoading().setLocation(0.3, 0.3, 0.4, 0.4))
+ })))
+ this.pages[0].addChild(new ButtonWithArrow().setText("§0Cancel").setLocation(0.2, 0.4, 0.2, 0.3).setDirectionRight(false).addEvent(new SoopyMouseClickEvent().setHandler(() => {
+ this.updateNotInEvent()
+ })))
+ }
+
+ joinEventResult(data) {
+ this.pages[0].clearChildren()
+ if (data.success) {
+ this.pages[0].addChild(new SoopyTextElement().setText("§0Joined event!").setMaxTextScale(3).setLocation(0.2, 0.2, 0.6, 0.2))
+ this.pages[0].addChild(new ButtonWithArrow().setText("§0Ok").setLocation(0.3, 0.4, 0.4, 0.4).addEvent(new SoopyMouseClickEvent().setHandler(() => {
+ this.pages[0].clearChildren()
+ this.pages[0].addChild(new BoxWithLoading().setLocation(0.3, 0.3, 0.4, 0.4))
+
+ socketConnection.pollEventData()
+ })))
+ } else {
+ this.pages[0].addChild(new SoopyTextElement().setText("§0Unable to join event!").setMaxTextScale(3).setLocation(0.2, 0.2, 0.6, 0.1))
+ this.pages[0].addChild(new SoopyTextElement().setText("§0" + data.reason).setMaxTextScale(3).setLocation(0.2, 0.3, 0.6, 0.1))
+ this.pages[0].addChild(new ButtonWithArrow().setText("§0Ok").setLocation(0.3, 0.4, 0.4, 0.4).addEvent(new SoopyMouseClickEvent().setHandler(() => {
+ this.pages[0].clearChildren()
+ this.pages[0].addChild(new BoxWithLoading().setLocation(0.3, 0.3, 0.4, 0.4))
+
+ socketConnection.pollEventData()
+ })))
+ }
+ }
+
+ pollData() {
+ if (!this.isOpen()) return
+
+ socketConnection.pollEventData()
+ }
+
onOpen() {
+ this.pages[0].clearChildren()
+ this.pages[0].addChild(new BoxWithLoading().setLocation(0.3, 0.3, 0.4, 0.4))
+ this.leaderboardElm = undefined
+ socketConnection.pollEventData()
}
}
diff --git a/features/soopyGui/GuiPage.js b/features/soopyGui/GuiPage.js
index f5ac9a5..7a21d26 100644
--- a/features/soopyGui/GuiPage.js
+++ b/features/soopyGui/GuiPage.js
@@ -19,7 +19,13 @@ class GuiPage {
}
getSoopyGui() {
- return global.soopyv2featuremanagerthing.features["soopyGui"].class
+ if (global.soopyv2featuremanagerthing.features["soopyGui"]) return global.soopyv2featuremanagerthing.features["soopyGui"].class;
+ }
+
+ isOpen() {
+ if (!this.getSoopyGui()?.gui?.ctGui?.isOpen()) return false
+
+ return this.getSoopyGui()?.currCategory === this
}
newPage() {
diff --git a/features/soopyGui/index.js b/features/soopyGui/index.js
index 4c8f571..32ac1a7 100644
--- a/features/soopyGui/index.js
+++ b/features/soopyGui/index.js
@@ -29,7 +29,7 @@ class SoopyGui extends Feature {
this.activeCategory = undefined
}
- onEnable(){
+ onEnable() {
this.gui = new SoopyGui2()
// this.gui.isDebugEnabled = true
@@ -39,23 +39,23 @@ class SoopyGui extends Feature {
this.mainWindowElement = new SoopyBoxElement().setLocation(0.25, 0.2, 0.5, 0.6)
- this.mainWindowElement.addEvent(new SoopyOpenGuiEvent().setHandler(()=>{this.goToPageNum(0, false)}))
+ this.mainWindowElement.addEvent(new SoopyOpenGuiEvent().setHandler(() => { this.goToPageNum(0, false) }))
//###############################################################################################
// Category Page
//###############################################################################################
this.categoryPage = new SoopyGuiElement().setLocation(0, 0, 1, 1)
-
+
let title = new SoopyTextElement().setText("§0SoopyV2!").setMaxTextScale(3).setLocation(0.1, 0.05, 0.5, 0.1)
this.categoryPage.addChild(title)
let discordButton = new ButtonWithArrow().setText("§0Discord").setLocation(0.7, 0.05, 0.25, 0.1)
- discordButton.addEvent(new SoopyMouseClickEvent().setHandler(()=>{
+ discordButton.addEvent(new SoopyMouseClickEvent().setHandler(() => {
java.awt.Desktop.getDesktop().browse(
new java.net.URI("https://discord.gg/dfSMq96RSN")
- );
- }))
+ );
+ }))
this.categoryPage.addChild(discordButton)
this.buttonListElm = new SoopyGuiElement().setLocation(0.1, 0.2, 0.8, 0.8).setScrollable(true)
@@ -64,11 +64,11 @@ class SoopyGui extends Feature {
//###############################################################################################
// Back button for all second pages
//###############################################################################################
-
+
this.backButton = new TextWithArrow().setText("§0Back").setLocation(0.01, -0.2, 0.1, 0.1).setDirectionRight(false)
- let backButtonEvent = new SoopyMouseClickEvent().setHandler(()=>{this.clickedBackButton()})
+ let backButtonEvent = new SoopyMouseClickEvent().setHandler(() => { this.clickedBackButton() })
this.backButton.addEvent(backButtonEvent)
-
+
this.mainWindowElement.addChild(this.categoryPage)
this.sidebarPage = new SoopyBoxElement().setLocation(0.3, 0.2, 0.3, 0.6)
@@ -76,43 +76,43 @@ class SoopyGui extends Feature {
this.gui.element.addChild(this.sidebarPage)
this.gui.element.addChild(this.mainWindowElement)
-
+
this.mainWindowElement.addChild(this.backButton)
this.updateButtons()
}
- openCommand(page){
+ openCommand(page) {
this.gui.open()
- if(page){
- this.getPages().forEach(p=>{
- if(p.name.replace(/ /g, "_").toLowerCase() === page.toLowerCase()){
+ if (page) {
+ this.getPages().forEach(p => {
+ if (p.name.replace(/ /g, "_").toLowerCase() === page.toLowerCase()) {
this.clickedOpen(p, false)
}
})
}
}
- getPages(){
+ getPages() {
return categoryManager.arr
}
- updateButtons(){
- if(!this.buttonListElm) return;
+ updateButtons() {
+ if (!this.buttonListElm) return;
this.buttonListElm.children = []
- this.getPages().forEach((p, i)=>{
- let settingsButton = new ButtonWithArrow().setText("§0" + p.name).setLocation(0, 0.225*i, 1, 0.2)
- settingsButton.addEvent(new SoopyMouseClickEvent().setHandler(()=>{this.clickedOpen(p)}))
+ this.getPages().forEach((p, i) => {
+ let settingsButton = new ButtonWithArrow().setText("§0" + p.name).setLocation(0, 0.225 * i, 1, 0.2)
+ settingsButton.addEvent(new SoopyMouseClickEvent().setHandler(() => { this.clickedOpen(p) }))
this.buttonListElm.addChild(settingsButton)
})
}
- clickedOpen(category, anim=true){
- if(!this.lastClickedOpen)this.lastClickedOpen = 0
- if(Date.now()-this.lastClickedOpen < 100) return //Stopping infinite loop where button getting reset causes click event to get fired again
+ clickedOpen(category, anim = true) {
+ if (!this.lastClickedOpen) this.lastClickedOpen = 0
+ if (Date.now() - this.lastClickedOpen < 100) return //Stopping infinite loop where button getting reset causes click event to get fired again
this.lastClickedOpen = Date.now()
let theParent = this.mainWindowElement.innerObjectPaddingThing || this.mainWindowElement
@@ -124,7 +124,7 @@ class SoopyGui extends Feature {
this.activePages = category.pages
this.currCategory = category
- Object.values(this.activePages).forEach(p=>{
+ Object.values(this.activePages).forEach(p => {
this.mainWindowElement.addChild(p)
})
@@ -133,7 +133,7 @@ class SoopyGui extends Feature {
this.goToPageNum(1, anim)
}
- onDisable(){
+ onDisable() {
this.gui.delete()
this.gui = undefined
@@ -145,50 +145,50 @@ class SoopyGui extends Feature {
this.lastClickedOpen = undefined
}
- clickedBackButton(){
- this.goToPageNum(this.currentPage-1)
+ clickedBackButton() {
+ this.goToPageNum(this.currentPage - 1)
}
- goToPage(page, animate=true){
+ goToPage(page, animate = true) {
let pageNum = page._soopyAddonsPageId
-
- if(pageNum == this.currentPage){
+
+ if (pageNum == this.currentPage) {
return
}
this.currentPage = pageNum
- this.getPages().forEach((p)=>{
- Object.values(p.pages).forEach((e, i)=>{
- e.location.location.x.set(i-pageNum+1, animate?500:0)
+ this.getPages().forEach((p) => {
+ Object.values(p.pages).forEach((e, i) => {
+ e.location.location.x.set(i - pageNum + 1, animate ? 500 : 0)
})
})
- this.categoryPage.location.location.x.set(-pageNum, animate?500:0)
+ this.categoryPage.location.location.x.set(-pageNum, animate ? 500 : 0)
- this.backButton.location.location.y.set((pageNum === 0 || !this.currCategory.showBackButton)?-0.2:0, animate?500:0)
+ this.backButton.location.location.y.set((pageNum === 0 || !this.currCategory.showBackButton) ? -0.2 : 0, animate ? 500 : 0)
}
- goToPageNum(pageNum, animate=true){
- if(pageNum<0) return;
+ goToPageNum(pageNum, animate = true) {
+ if (pageNum < 0) return;
this.currentPage = pageNum
- if(pageNum===0){
+ if (pageNum === 0) {
this.currCategory = undefined
this.closeSidebarPage()
this.updateButtons()
}
- this.getPages().forEach((p)=>{
- Object.values(p.pages).forEach((e, i)=>{
- e.location.location.x.set(i-pageNum+1, animate?500:0)
+ this.getPages().forEach((p) => {
+ Object.values(p.pages).forEach((e, i) => {
+ e.location.location.x.set(i - pageNum + 1, animate ? 500 : 0)
})
})
- this.categoryPage.location.location.x.set(-pageNum, animate?500:0)
+ this.categoryPage.location.location.x.set(-pageNum, animate ? 500 : 0)
- this.backButton.location.location.y.set((pageNum === 0 || !this.currCategory.showBackButton)?-0.2:0, animate?500:0)
+ this.backButton.location.location.y.set((pageNum === 0 || !this.currCategory.showBackButton) ? -0.2 : 0, animate ? 500 : 0)
- if(this.currCategory) this.currCategory.onOpenPage(pageNum)
+ if (this.currCategory) this.currCategory.onOpenPage(pageNum)
}
- openSidebarPage(child){
+ openSidebarPage(child) {
this.sidebarPage.location.location.x.set(0.625, 500)
this.mainWindowElement.location.location.x.set(0.075, 500)
@@ -197,7 +197,7 @@ class SoopyGui extends Feature {
this.sidebarPage.addChild(child)
}
- closeSidebarPage(){
+ closeSidebarPage() {
this.sidebarPage.location.location.x.set(0.3, 500)
this.mainWindowElement.location.location.x.set(0.25, 500)
--
cgit
From 4d8f233a98cecbce7090396474bb762370d982da Mon Sep 17 00:00:00 2001
From: Soopyboo32 <49228220+Soopyboo32@users.noreply.github.com>
Date: Sun, 22 May 2022 16:20:51 +0800
Subject: asd
---
features/bestiary/metadata.json | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
(limited to 'features')
diff --git a/features/bestiary/metadata.json b/features/bestiary/metadata.json
index 3ff9383..44dad33 100644
--- a/features/bestiary/metadata.json
+++ b/features/bestiary/metadata.json
@@ -1,7 +1,7 @@
{
"name": "Bestiary",
"description": "Bestiary trackers",
- "isHidden": false,
+ "isHidden": true,
"isTogglable": true,
"defaultEnabled": true,
"sortA": 0
--
cgit
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')
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')
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')
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')
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/dungeonMap/index.js | 1 +
features/hud/index.js | 2 +-
features/mining/index.js | 7 ++++---
3 files changed, 6 insertions(+), 4 deletions(-)
(limited to 'features')
diff --git a/features/dungeonMap/index.js b/features/dungeonMap/index.js
index bdaaf23..9c28fd9 100644
--- a/features/dungeonMap/index.js
+++ b/features/dungeonMap/index.js
@@ -95,6 +95,7 @@ class DungeonMap extends Feature {
this.bloodOpened = false
this.registerChat("&r&cThe &r&c&lBLOOD DOOR&r&c has been opened!&r", () => {
this.bloodOpened = true
+ this.keys--
})
this.registerChat("&r${*}&r&f &r&ehas obtained &r&a&r&${*} Key&r&e!&r", () => {
diff --git a/features/hud/index.js b/features/hud/index.js
index c6254d4..f375d41 100644
--- a/features/hud/index.js
+++ b/features/hud/index.js
@@ -458,7 +458,7 @@ class Hud extends Feature {
if (Date.now() - this.lastSwappedPet > 1000) {
inv[i].getLore().forEach(line => {
- if (line.includes("Click to despawn.")) {
+ if (line.includes("Click to despawn!")) {
this.petElement.setText("&6Pet&7> &7" + inv[i].getName().split("(")[0])
this.petText = "&6Pet&7> &7" + inv[i].getName().split("(")[0]
}
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/dataLoader/index.js | 6 +++---
features/mining/index.js | 6 +++---
2 files changed, 6 insertions(+), 6 deletions(-)
(limited to 'features')
diff --git a/features/dataLoader/index.js b/features/dataLoader/index.js
index f0ede23..b933e31 100644
--- a/features/dataLoader/index.js
+++ b/features/dataLoader/index.js
@@ -151,11 +151,11 @@ class DataLoader extends Feature {
this.area = this.stats["Area"]
- if (this.lastServer !== this.FeatureManager.features["dataLoader"].class.stats.Server || Date.now() - this.lastSentServer > 60000 * 5) {
- this.lastServer = this.FeatureManager.features["dataLoader"].class.stats.Server;
+ if (this.lastServer !== this.stats.Server || Date.now() - this.lastSentServer > 60000 * 5) {
+ this.lastServer = this.stats.Server;
this.lastSentServer = Date.now()
- socketConnection.setServer(this.FeatureManager.features["dataLoader"].class.stats.Server);
+ socketConnection.setServer(this.stats.Server, this.area, this.areaFine);
}
}
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 6dee22fcfe3e1c57045f7b8b07b197dbca121a83 Mon Sep 17 00:00:00 2001
From: Soopyboo32 <49228220+Soopyboo32@users.noreply.github.com>
Date: Thu, 26 May 2022 22:21:17 +0800
Subject: + enable links from soopymc.my.to to be shown in patcher image
preview
---
features/agentlaiThings/hiddenRequirement.js | 8 --
features/agentlaiThings/index.js | 195 ---------------------------
features/agentlaiThings/metadata.json | 8 --
features/bestiary/index.js | 8 --
features/globalSettings/index.js | 25 +++-
5 files changed, 23 insertions(+), 221 deletions(-)
delete mode 100644 features/agentlaiThings/hiddenRequirement.js
delete mode 100644 features/agentlaiThings/index.js
delete mode 100644 features/agentlaiThings/metadata.json
(limited to 'features')
diff --git a/features/agentlaiThings/hiddenRequirement.js b/features/agentlaiThings/hiddenRequirement.js
deleted file mode 100644
index effd23b..0000000
--- a/features/agentlaiThings/hiddenRequirement.js
+++ /dev/null
@@ -1,8 +0,0 @@
-let allowedUUIDS = [
- "f2bcfe6aa54c4eb9b37156b4f1d20beb",
- "dc8c39647b294e03ae9ed13ebd65dd29"
-]
-
-module.exports = {hidden: function(featureManager){
- return !allowedUUIDS.includes(Player.getUUID().toString().replace(/-/g, ""))
-}}
\ No newline at end of file
diff --git a/features/agentlaiThings/index.js b/features/agentlaiThings/index.js
deleted file mode 100644
index 1654be4..0000000
--- a/features/agentlaiThings/index.js
+++ /dev/null
@@ -1,195 +0,0 @@
-///
-///
-import { SoopyGui, SoopyRenderEvent } from "../../../guimanager";
-import SoopyBoxElement from "../../../guimanager/GuiElement/SoopyBoxElement";
-import SoopyGuiElement from "../../../guimanager/GuiElement/SoopyGuiElement";
-import renderLibs from "../../../guimanager/renderLibs";
-import Feature from "../../featureClass/class";
-import ToggleSetting from "../settings/settingThings/toggle";
-
-class AgentThings extends Feature {
- constructor() {
- super()
- }
-
- onEnable(){
- return;
- this.initVariables()
-
- this.nearPlayerData = []
- while(this.nearPlayerData.length < 100){this.nearPlayerData.push({})}
-
- this.recordNearestPlayers = new ToggleSetting("Record nearby players", "You can then view this data with /nearplayers", false, "record_near_players", this)
-
- this.registerStep(false, 1, this.step)
-
- this.nearPlayersGui = new SoopyGui().setOpenCommand("nearplayers")
-
- this.nearPlayersGuiBox = new SoopyBoxElement().setLocation(0.25, 0.25, 0.5, 0.5)
- this.nearPlayersGui.element.addChild(this.nearPlayersGuiBox)
-
- this.nearPlayersRenderElement = new SoopyGuiElement()
- this.nearPlayersGuiBox.addChild(this.nearPlayersRenderElement)
-
-
- let selected = undefined
- let selectedDist = undefined
- let lastXY = 0
- this.nearPlayersRenderElement.addEvent(new SoopyRenderEvent().setHandler((mouseX, mouseY)=>{
- let moved = lastXY !== mouseX+mouseY
- lastXY = mouseX+mouseY
-
- let x = this.nearPlayersRenderElement.location.getXExact()
- let y = this.nearPlayersRenderElement.location.getYExact()
- let width = this.nearPlayersRenderElement.location.getWidthExact()
- let height = this.nearPlayersRenderElement.location.getHeightExact()
-
- x+=width*0.125
- y+=height*0.125
- width*=0.75
- height*=0.75
-
- Renderer.drawLine(Renderer.color(0, 0, 0), x, y+height, x+width, y+height, 2)//bottom axis line
- Renderer.drawLine(Renderer.color(0, 0, 0), x, y, x, y+height, 2)//left axis line
-
- renderLibs.drawStringCentered("&0100s ago", x, y+height+6, Renderer.screen.getWidth()/1000)
- renderLibs.drawStringCentered("&050s ago", x+width/2, y+height+6, Renderer.screen.getWidth()/1000)
- renderLibs.drawStringCentered("&0Now", x+width, y+height+6, Renderer.screen.getWidth()/1000) //bottom axis markers
-
-
- renderLibs.drawStringCenteredVertically("&025m away", x+3-Renderer.getStringWidth("&025m away")*Renderer.screen.getWidth()/1000, y, Renderer.screen.getWidth()/1000)
- renderLibs.drawStringCenteredVertically("&020m away", x+3-Renderer.getStringWidth("&020m away")*Renderer.screen.getWidth()/1000, y+height/5*1, Renderer.screen.getWidth()/1000)
- renderLibs.drawStringCenteredVertically("&010m away", x+3-Renderer.getStringWidth("&010m away")*Renderer.screen.getWidth()/1000, y+height/5*3, Renderer.screen.getWidth()/1000)
- renderLibs.drawStringCenteredVertically("&00m away", x+3-Renderer.getStringWidth("&00m away")*Renderer.screen.getWidth()/1000, y+height-6, Renderer.screen.getWidth()/1000)
-
- if(moved){
- selected = undefined
- selectedDist = undefined
- }
- let lastUuids = []
- this.nearPlayerData.forEach((data, i)=>{
- let newLastUuids = []
- Object.keys(data).forEach(uuid=>{
- newLastUuids.push(uuid)
- lastUuids = lastUuids.filter(a=>a!==uuid)
-
- let dist = data[uuid].distance
- let oldDist = this.nearPlayerData[i-1]?.[uuid]?.distance || 25
-
- let thisX = x+(i)/100*width
- let thisY = y+height-(dist/25)*height
-
- if(moved && (thisX-mouseX)**2 + (thisY-mouseY)**2 < 3){
- selected = uuid
- selectedDist = dist
- }
-
- if(i !== 0){
- Renderer.drawLine(Renderer.color(0, 0, 0), x+(i-1)/100*width, y+height-(oldDist/25)*height, thisX, thisY, 1)
- }
-
- Renderer.drawRect(Renderer.color(0, 0, 0), thisX-1, thisY-1, 3, 3)
- })
-
- lastUuids.forEach(uuid=>{
- let dist = 25
- let oldDist = this.nearPlayerData[i-1]?.[uuid]?.distance || 25
-
- let thisX = x+(i)/100*width
- let thisY = y+height-(dist/25)*height
-
- if(i !== 0){
- Renderer.drawLine(Renderer.color(0, 0, 0), x+(i-1)/100*width, y+height-(oldDist/25)*height, thisX, thisY, 1)
- }
- })
-
- lastUuids = newLastUuids
- })
-
- if(selected){
- width = this.nearPlayersRenderElement.location.getWidthExact()
- height = this.nearPlayersRenderElement.location.getHeightExact()
-
- width*=0.75
- height*=0.75
-
- renderLibs.scizzorFast(0,0,Renderer.screen.getWidth(), Renderer.screen.getHeight())
- let selectedIgn = undefined
- let lastRenderedSelected = false
- this.nearPlayerData.forEach((data, i)=>{
- if(data[selected]){
- lastRenderedSelected = true
-
- selectedIgn = data[selected].name
-
- let dist = data[selected].distance
- let oldDist = this.nearPlayerData[i-1]?.[selected]?.distance || 25
-
- let thisX = x+(i)/100*width
- let thisY = y+height-(dist/25)*height
-
- if(i !== 0){
- Renderer.drawLine(Renderer.color(255, 0, 0), x+(i-1)/100*width, y+height-(oldDist/25)*height, thisX, thisY, 3)
- }
- }else{
- if(lastRenderedSelected){
- lastRenderedSelected = false
-
- let dist = 25
- let oldDist = this.nearPlayerData[i-1]?.[selected]?.distance || 25
-
- let thisX = x+(i)/100*width
- let thisY = y+height-(dist/25)*height
-
- if(i !== 0){
- Renderer.drawLine(Renderer.color(255, 0, 0), x+(i-1)/100*width, y+height-(oldDist/25)*height, thisX, thisY, 3)
- }
- }
- }
- })
-
- let width = Math.max(Renderer.getStringWidth(selectedIgn)*2, Renderer.getStringWidth("Distance: " + selectedDist.toFixed(1)))+8
- let height = 32
- renderLibs.drawBox([255, 255, 255], mouseX+10, mouseY-height/2, width,height, 3)
- renderLibs.drawString("&0" + selectedIgn, mouseX+14, mouseY-height/2+3, 2)
- renderLibs.drawString("&0Distance: &7" + selectedDist.toFixed(1) , mouseX+14, mouseY-height/2+21, 1)
- }
-
- }))
- }
-
- step(){
- if(!this.recordNearestPlayers.getValue()) return
-
- let thisSecondPlayerData = {}
- World.getAllPlayers().forEach(p=>{
- let distSq = (p.getX()-Player.getX())**2+(p.getY()-Player.getY())**2+(p.getZ()-Player.getZ())**2
-
- if(distSq < 25*25 && distSq !== 0){
- thisSecondPlayerData[p.getUUID().toString()] = {name: p.getName(), distance: Math.sqrt(distSq)}
- }
- })
-
- this.nearPlayerData.push(thisSecondPlayerData)
-
- if(this.nearPlayerData.length > 100) this.nearPlayerData.shift()
- }
-
- initVariables(){
- this.recordNearestPlayers = undefined
- this.nearPlayerData = undefined
- this.nearPlayersGui = undefined
- this.nearPlayersGuiBox = undefined
- this.nearPlayersRenderElement = undefined
- }
-
- onDisable(){
- this.nearPlayersGui.delete()
-
- this.initVariables()
- }
-}
-
-module.exports = {
- class: new AgentThings()
-}
\ No newline at end of file
diff --git a/features/agentlaiThings/metadata.json b/features/agentlaiThings/metadata.json
deleted file mode 100644
index e44e8fa..0000000
--- a/features/agentlaiThings/metadata.json
+++ /dev/null
@@ -1,8 +0,0 @@
-{
- "name": "Agentlai Settings",
- "description": "Settings only avalible to agentlai",
- "isHidden": "hiddenRequirement.js",
- "isTogglable": true,
- "defaultEnabled": false,
- "sortA": 0
-}
\ No newline at end of file
diff --git a/features/bestiary/index.js b/features/bestiary/index.js
index 3888ffb..de7d679 100644
--- a/features/bestiary/index.js
+++ b/features/bestiary/index.js
@@ -13,22 +13,14 @@ class Waypoints extends Feature {
}
onEnable() {
- this.initVariables()
-
this.bestiaryData = JSON.parse(FileLib.read("soopyAddonsData", "bestiaryData.json") || "{}")
this.bestiaryChanged = false
}
- initVariables() {
-
- }
-
onDisable() {
if (this.bestiaryChanged) {
FileLib.write("soopyAddonsData", "bestiaryData.json", JSON.stringify(this.bestiaryData))
}
-
- this.initVariables()
}
}
diff --git a/features/globalSettings/index.js b/features/globalSettings/index.js
index 39a2714..92132d8 100644
--- a/features/globalSettings/index.js
+++ b/features/globalSettings/index.js
@@ -73,9 +73,30 @@ class GlobalSettings extends Feature {
this.registerEvent("tick", this.fixNEU)
}
- if (net.minecraftforge.fml.common.Loader.isModLoaded("SoopyV2")) {
+ // if (net.minecraftforge.fml.common.Loader.isModLoaded("SoopyV2")) {
+ //TODO: stuff here
+ // }
- }
+ try { //This enables links from soopymc.my.to to be shown in patcher image preview
+ let hasHost = false
+
+ for (let host of Java.type("gg.essential.util.TrustedHostsUtil").INSTANCE.getTrustedHosts()) {
+ if (host.getName() === "soopymc") {
+ hasHost = true
+ }
+ }
+
+ if (!hasHost) {
+ let TrustedHost = Java.type("gg.essential.api.utils.TrustedHostsUtil").TrustedHost
+ let TreeSet = Java.type("java.util.TreeSet")
+ let hosts = new TreeSet()
+ hosts.add("soopymc.my.to")
+
+ let host = new TrustedHost(124123, "soopymc", hosts)
+
+ Java.type("gg.essential.util.TrustedHostsUtil").INSTANCE.addTrustedHost(host)
+ }
+ } catch (e) { }
this.registerCommand("soopyweight", (user = Player.getName()) => {
this.soopyWeight(user)
--
cgit
From 0bdf178b8f4b282c2c9eb4147eba1ae2ffb34b5f Mon Sep 17 00:00:00 2001
From: Soopyboo32 <49228220+Soopyboo32@users.noreply.github.com>
Date: Thu, 26 May 2022 22:41:08 +0800
Subject: + fix vanquisher waypoints
---
features/nether/index.js | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
(limited to 'features')
diff --git a/features/nether/index.js b/features/nether/index.js
index 67accbc..52d1041 100644
--- a/features/nether/index.js
+++ b/features/nether/index.js
@@ -89,8 +89,8 @@ class Nether extends Feature {
})
}
- vanqData(loc) {
- this.spawnedVanqs.push([...loc, Date.now()])
+ vanqData(loc, name) {
+ this.spawnedVanqs.push([loc, name, Date.now()])
}
tick() {
@@ -212,8 +212,8 @@ class Nether extends Feature {
}
if (this.vaniquisherWaypoints.getValue()) {
- Object.keys(this.spawnedVanqs).forEach(key => {
- drawCoolWaypoint(this.spawnedVanqs[key][0], this.spawnedVanqs[key][1], this.spawnedVanqs[key][2], 255, 0, 0, { name: key + "'s vanquisher (" + Math.floor((Date.now() - this.spawnedVanqs[key][2]) / 1000) + "s)" })
+ this.spawnedVanqs.forEach(vanq => {
+ drawCoolWaypoint(vanq[0][0], vanq[0][1], vanq[0][2], 255, 0, 0, { name: vanq[1] + "'s vanquisher (" + Math.floor((Date.now() - vanq[2]) / 1000) + "s)" })
})
}
@@ -232,7 +232,7 @@ class Nether extends Feature {
step1S() {
if (this.blocks) this.blocks = this.blocks.filter(state => Date.now() < state.time)
if (this.dojoFireBalls) this.dojoFireBalls = this.dojoFireBalls.filter(e => !e[f.isDead])
- if (this.spawnedVanqs) this.spawnedVanqs = this.spawnedVanqs.filter(a => Date.now() - a[3] < 60000)
+ if (this.spawnedVanqs) this.spawnedVanqs = this.spawnedVanqs.filter(a => Date.now() - a[2] < 60000)
}
getBlockIdFromState(state) {
--
cgit
From 83036d85a38729adf8fad5bc9bf38a06c183adf0 Mon Sep 17 00:00:00 2001
From: Soopyboo32 <49228220+Soopyboo32@users.noreply.github.com>
Date: Fri, 27 May 2022 14:10:18 +0800
Subject: + bestiary hud elements (hopefully not scuffed)
---
features/bestiary/index.js | 240 +++++++++++++++++++++++++++++++++++++++-
features/bestiary/metadata.json | 2 +-
features/dataLoader/index.js | 14 +++
features/dungeonMap/index.js | 2 +-
features/hud/index.js | 14 ---
5 files changed, 250 insertions(+), 22 deletions(-)
(limited to 'features')
diff --git a/features/bestiary/index.js b/features/bestiary/index.js
index de7d679..00d5752 100644
--- a/features/bestiary/index.js
+++ b/features/bestiary/index.js
@@ -1,13 +1,25 @@
///
///
-import { m } from "../../../mappings/mappings";
import Feature from "../../featureClass/class";
-import { drawCoolWaypoint } from "../../utils/renderUtils";
+import { numberWithCommas } from "../../utils/numberUtils";
+import HudTextElement from "../hud/HudTextElement";
+import DropdownSetting from "../settings/settingThings/dropdownSetting";
+import LocationSetting from "../settings/settingThings/location";
import SettingBase from "../settings/settingThings/settingBase";
import ToggleSetting from "../settings/settingThings/toggle";
+let dontUseApi = new Set()
+dontUseApi.add("arachne")
+dontUseApi.add("barbarian_duke_x")
+dontUseApi.add("bladesoul")
+dontUseApi.add("mage_outlaw")
+dontUseApi.add("ashfang")
+dontUseApi.add("magma_cube_boss")
+dontUseApi.add("headless_horseman")
+dontUseApi.add("dragon")
-class Waypoints extends Feature {
+
+class Bestiary extends Feature {
constructor() {
super()
}
@@ -15,15 +27,231 @@ class Waypoints extends Feature {
onEnable() {
this.bestiaryData = JSON.parse(FileLib.read("soopyAddonsData", "bestiaryData.json") || "{}")
this.bestiaryChanged = false
+
+ this.bestiaryApiTracking = {}
+
+ this.registerStep(true, 5, this.scanInv)
+ this.registerStep(false, 5, this.saveData)
+
+
+ this.bestiaryStatTypes = {
+ "barbarian_duke_x": "Barbarian Duke X"
+ }
+ Object.keys(this.bestiaryData).forEach(k => {
+ if (this.bestiaryData[k].guiName) this.bestiaryStatTypes[k] = this.bestiaryData[k].guiName
+ })
+
+ new SettingBase("NOTE: u need to open ur bestiary menu", "before this will work", true, "info_bestiary", this)
+ this.hudStat = []
+ for (let i = 0; i < 10; i++) {
+ this.hudStat[i] = {}
+ this.hudStat[i].enabled = new ToggleSetting("Bestiary Slot #" + (i + 1), "Allows you to render a custom besiary kills on your hud", false, "bestiary_stat_" + i, this)
+ this.hudStat[i].type = new DropdownSetting("Bestiary Slot #" + (i + 1) + " Type", "The bestiary type", "barbarian_duke_x", "bestiary_stat_" + i + "_type", this, this.bestiaryStatTypes)
+ this.hudStat[i].location = new LocationSetting("Bestiary Slot #" + (i + 1) + " Location", "Allows you to edit the location of the bestiary stat", "bestiary_stat_" + i + "_location", this, [10, 50 + i * 10, 1, 1]).editTempText("&6Bestiary Stat Stat&7> &f12,345")
+ this.hudStat[i].textElement = new HudTextElement().setToggleSetting(this.hudStat[i].enabled).setLocationSetting(this.hudStat[i].location).setText("&6Bestiary Stat&7> &fLoading...")
+ this.hudStat[i].onlySb = new ToggleSetting("Bestiary Slot #" + (i + 1) + " Only SB", "Only render this stat when you are in skyblock", true, "bestiary_stat_" + i + "_only_sb", this).requires(this.hudStat[i].enabled)
+
+ this.hudStat[i].location.requires(this.hudStat[i].enabled)
+ this.hudStat[i].type.requires(this.hudStat[i].enabled)
+ if (this.hudStat[i - 1]) {
+ this.hudStat[i].enabled.requires(this.hudStat[i - 1].enabled)
+ }
+ }
+
+ this.registerStep(false, 5, this.updateHudElements)
+ this.registerEvent("renderOverlay", this.renderHUD)
+ // TODO
+ // dragon
+ // headless_horseman
+ let lastThing = undefined
+ let lastThingTime = 0
+ this.registerChat("${chat}", (chat) => {
+ let thing
+ switch (chat.trim()) {
+ case "MAGE OUTLAW DOWN!":
+ thing = "mage_outlaw"
+ break;
+ case "BARBARIAN DUKE X DOWN!":
+ thing = "barbarian_duke_x"
+ break;
+ case "BLADESOUL DOWN!":
+ thing = "bladesoul"
+ break;
+ case "ASHFANG DOWN!":
+ thing = "ashfang"
+ break;
+ // case "MAGMA BOSS DOWN!":
+ // thing = "magma_cube_boss"
+ // break;
+ case "ARACHNE DOWN!":
+ lastThing = "arachne"
+ lastThingTime = Date.now()
+ break;
+ case "HORSEMAN DOWN!":
+ lastThing = "arachne"
+ lastThingTime = Date.now()
+ break;
+ default:
+ break;
+ }
+ if (chat.includes("DRAGON")) {
+ lastThing = "dragon"
+ lastThingTime = Date.now()
+ }
+
+ if (chat.trim().startsWith("Your Damage: ")) {
+ let dmg = parseInt(chat.trim().split("Your Damage: ")[1].split(" ")[0])
+ if (dmg > 0 && Date.now() - lastThingTime < 1000) {
+ thing = lastThing
+ lastThing = ""
+ lastThingTime = 0
+ }
+ }
+
+ if (thing) {
+ this.bestiaryData[thing].guessCount++
+ this.bestiaryChanged = true
+ }
+ })
+ this.registerSoopy("apiLoad", this.apiLoad);
+
+ if (this.FeatureManager.features["dataLoader"] && this.FeatureManager.features["dataLoader"].class.lastApiData.skyblock_raw) {
+ this.apiLoad(this.FeatureManager.features["dataLoader"].class.lastApiData.skyblock_raw, "skyblock", false, true);
+ }
}
- onDisable() {
+ renderHUD() {
+ for (let stat of this.hudStat) {
+ stat.textElement.render()
+ }
+ }
+
+ getBestiaryCount(id) {
+ if (!this.bestiaryData[id]) return "???"
+ let count = this.bestiaryData[id].count
+
+ if (!dontUseApi.has(id)) {
+ let currApiData = this.bestiaryApiTracking[id]
+
+ count += currApiData - this.bestiaryData[id].apiCount
+ }
+
+ count += this.bestiaryData[id].guessCount
+
+ return count
+ }
+
+ updateHudElements() {
+ if (!this.FeatureManager.features["dataLoader"]) return
+
+ let insb = this.FeatureManager.features["dataLoader"].class.isInSkyblock
+
+ this.hudStat.forEach(stat => {
+ if (stat.enabled.getValue()) {
+ if (!insb && stat.onlySb.getValue()) {
+ stat.textElement.setText("")
+ return
+ }
+
+ let type = stat.type.getValue()
+
+ stat.textElement.setText(`&6${this.bestiaryData[type]?.guiName}&7> &f${numberWithCommas(this.getBestiaryCount(type))}`)
+ }
+ })
+ }
+
+ apiLoad(data, dataType, isSoopyServer, isLatest) {
+ if (isSoopyServer || !isLatest) return;
+ if (dataType !== "skyblock") return;
+
+ let currentProfile = {}
+ let currentProfileTime = 0
+
+ data.profiles.forEach(p => {
+ if (p.members[Player.getUUID().toString().replace(/-/g, "")].last_save > currentProfileTime) {
+ currentProfileTime = p.members[Player.getUUID().toString().replace(/-/g, "")].last_save
+ currentProfile = p.members[Player.getUUID().toString().replace(/-/g, "")]
+ }
+ })
+
+ Object.keys(currentProfile.stats).forEach(key => {
+ if (key.startsWith("kills_")) {
+ this.bestiaryApiTracking[key.replace("kills_", "")] = currentProfile.stats[key]
+ }
+ })
+ }
+
+ scanInv() {
+ if (!Player.getContainer()) return
+ if (!Player.getContainer().getName().startsWith("Bestiary ➜ ")) return
+ let tempChanged = false
+ let seen = new Set()
+
+ for (let item of Player.getContainer().getItems()) {
+ if (!item) continue
+ let name = ChatLib.removeFormatting(item.getName()).split(" ")
+ name.pop()
+ let apiName = name.join("_").toLowerCase()
+ if (seen.has(apiName)) continue
+ seen.add(apiName)
+
+ if (apiName === "skeletor_prime") continue
+
+ if (this.bestiaryApiTracking[apiName] || dontUseApi.has(apiName)) {
+
+ let count = 0
+
+ for (let l of item.getLore()) {
+ l = ChatLib.removeFormatting(l)
+
+ if (l.startsWith("Kills: ")) {
+ count = parseInt(l.split("Kills: ")[1].replace(/,/g, ""))
+ break;
+ }
+ }
+
+ let needsChange = !this.bestiaryData[apiName] || this.bestiaryData[apiName].guiName !== name.join(" ") || this.bestiaryData[apiName].count !== count || this.bestiaryData[apiName].apiCount !== (this.bestiaryApiTracking[apiName] || 0) || this.bestiaryData[apiName].guessCount !== 0
+ if (needsChange) {
+ this.bestiaryData[apiName] = {
+ guiName: name.join(" "),
+ count,
+ apiCount: this.bestiaryApiTracking[apiName] || 0,
+ guessCount: 0
+ }
+ this.bestiaryChanged = true
+
+ tempChanged = true
+
+ }
+ }
+ }
+
+ if (tempChanged) {
+ this.bestiaryStatTypes = {}
+ Object.keys(this.bestiaryData).forEach(k => {
+ if (this.bestiaryData[k]?.guiName) this.bestiaryStatTypes[k] = this.bestiaryData[k].guiName
+ })
+
+ this.hudStat.forEach(s => {
+ s.type.dropdownObject.setOptions(this.bestiaryStatTypes)
+ })
+
+ this.updateHudElements()
+ }
+ start = Date.now()
+ }
+
+ saveData() {
if (this.bestiaryChanged) {
FileLib.write("soopyAddonsData", "bestiaryData.json", JSON.stringify(this.bestiaryData))
}
}
-}
+ onDisable() {
+ this.saveData()
+ }
+
+}
module.exports = {
- class: new Waypoints()
+ class: new Bestiary()
}
diff --git a/features/bestiary/metadata.json b/features/bestiary/metadata.json
index 44dad33..3ff9383 100644
--- a/features/bestiary/metadata.json
+++ b/features/bestiary/metadata.json
@@ -1,7 +1,7 @@
{
"name": "Bestiary",
"description": "Bestiary trackers",
- "isHidden": true,
+ "isHidden": false,
"isTogglable": true,
"defaultEnabled": true,
"sortA": 0
diff --git a/features/dataLoader/index.js b/features/dataLoader/index.js
index b933e31..849e0fd 100644
--- a/features/dataLoader/index.js
+++ b/features/dataLoader/index.js
@@ -23,6 +23,8 @@ class DataLoader extends Feature {
this.registerStep(true, 2, this.step)
+ this.registerStep(false, 170, this.loadApiS