diff options
author | Soopyboo32 <49228220+Soopyboo32@users.noreply.github.com> | 2022-01-19 00:27:34 +0800 |
---|---|---|
committer | Soopyboo32 <49228220+Soopyboo32@users.noreply.github.com> | 2022-01-19 00:27:34 +0800 |
commit | 7ebd164d716410183e7f8ee3a70c80a6262afae3 (patch) | |
tree | 81b09604b72b3849985d4181090c0241432f7410 /features | |
parent | a9e72c1297b6f4b046dbe9c76516a0e0d30c2d39 (diff) | |
download | SoopyV2-7ebd164d716410183e7f8ee3a70c80a6262afae3.tar.gz SoopyV2-7ebd164d716410183e7f8ee3a70c80a6262afae3.tar.bz2 SoopyV2-7ebd164d716410183e7f8ee3a70c80a6262afae3.zip |
fix bugs
Diffstat (limited to 'features')
-rw-r--r-- | features/betterGuis/museumGui.js | 4 | ||||
-rw-r--r-- | features/cosmetics/index.js | 2 | ||||
-rw-r--r-- | features/globalSettings/index.js | 47 |
3 files changed, 26 insertions, 27 deletions
diff --git a/features/betterGuis/museumGui.js b/features/betterGuis/museumGui.js index 47e29d2..f652cf3 100644 --- a/features/betterGuis/museumGui.js +++ b/features/betterGuis/museumGui.js @@ -354,7 +354,7 @@ class MuseumGui { this.lastGuiTitle = Player.getOpenedInventory().getName() if(Player.getOpenedInventory().getName() === "Your Museum"){//main page - if(Player.getOpenedInventory().getStackInSlot(19).getID() === -1) return + if(!Player.getOpenedInventory().getStackInSlot(19)) return let lore = Player.getOpenedInventory().getStackInSlot(19).getLore() lore.forEach((line, i)=>{ @@ -530,7 +530,7 @@ class MuseumGui { } if(Player.getOpenedInventory().getName() === "Confirm Donation"){ - let this_confirm_temp_str = Player.getOpenedInventory().getStackInSlot(4).getName() +Player.getOpenedInventory().getStackInSlot(2).getName() + Player.getOpenedInventory().getStackInSlot(20).getName() + Player.getOpenedInventory().getStackInSlot(24).getName()//4, 24, 20 + let this_confirm_temp_str = (Player.getOpenedInventory().getStackInSlot(4)?.getName() || "") +(Player.getOpenedInventory().getStackInSlot(2)?.getName() || "") + (Player.getOpenedInventory().getStackInSlot(20)?.getName() || "") + (Player.getOpenedInventory().getStackInSlot(24)?.getName() || "")//4, 24, 20 if(this.confirm_temp !== this_confirm_temp_str || first){ this.confirm_temp = this_confirm_temp_str diff --git a/features/cosmetics/index.js b/features/cosmetics/index.js index 4abab93..eeee12e 100644 --- a/features/cosmetics/index.js +++ b/features/cosmetics/index.js @@ -70,7 +70,7 @@ class Cosmetics extends Feature { } renderWorld(ticks){ - for(cosmetic of this.loadedCosmetics){ + for(let cosmetic of this.loadedCosmetics){ cosmetic.onRenderEntity(ticks, false) } } diff --git a/features/globalSettings/index.js b/features/globalSettings/index.js index 4580809..badaf72 100644 --- a/features/globalSettings/index.js +++ b/features/globalSettings/index.js @@ -30,7 +30,7 @@ class Hud extends Feature { onEnable(){ this.apiKeySetting = new TextSetting("Api Key", "Your hypixel api key", "", "api_key", this, "Run /api new to load", true) - this.verifyApiKey = new ButtonSetting("Verify api key", "Click this to make sure the api key is working", "verify_key", this, "Click!", this.verifyKey, undefined) + this.verifyApiKey = new ButtonSetting("Verify api key", "Click this to make sure the api key is working", "verify_key", this, "Click!", this.verifyKey2, undefined) this.newApiKey = new ButtonSetting("Run /api new", "This is here so u dont need to exit and re-enter", "api_new_command", this, "Click!", this.apiNewCommand, undefined) this.findApiKey = new ButtonSetting("Attempt to load api key from other mods", "This will scan other mods configs to attempt to find your key", "find_key", this, "Click!", this.findKey, undefined) @@ -156,29 +156,28 @@ class Hud extends Feature { FileLib.write("soopyAddonsData", "soopyv2firstloaddata.json", JSON.stringify(this.firstLoadPageData)) } } + verifyKey(key){ + // console.log(key) + if(key){ + try{ + var url = "https://api.hypixel.net/key?key=" + key + let data = JSON.parse(FileLib.getUrlContent(url)) - findKey(){ - function verifyKey(key){ - // console.log(key) - if(key){ - try{ - var url = "https://api.hypixel.net/key?key=" + key - let data = JSON.parse(FileLib.getUrlContent(url)) - - // console.log(data) - - if(data.success){ - return true - }else{ - return false - } - }catch(e){ + // console.log(data) + + if(data.success){ + return true + }else{ return false } - }else{ + }catch(e){ return false } + }else{ + return false } + } + findKey(){ new Notification("Finding key...", []) new Thread(()=>{ @@ -186,7 +185,7 @@ class Hud extends Feature { try{ let testKey = JSON.parse(new JavaString(Files.readAllBytes(Paths.get("./config/notenoughupdates/configNew.json")))).apiKey.apiKey if(testKey){ - if(verifyKey(testKey)){ + if(this.verifyKey(testKey)){ this.module.apiKeySetting.setValue(testKey) new Notification("§aSuccess!", ["Found api key in NotEnoughUpdates!"]) return; @@ -200,7 +199,7 @@ class Hud extends Feature { // try{ let testKey = JSON.parse(new JavaString(Files.readAllBytes(Paths.get("./config/SkyblockExtras.cfg")))).values.apiKey if(testKey){ - if(verifyKey(testKey)){ + if(this.verifyKey(testKey)){ this.module.apiKeySetting.setValue(testKey) new Notification("§aSuccess!", ["Found api key in SkyblockExtras!"]) return; @@ -219,7 +218,7 @@ class Hud extends Feature { } }) if(testKey){ - if(verifyKey(testKey)){ + if(this.verifyKey(testKey)){ this.module.apiKeySetting.setValue(testKey) new Notification("§aSuccess!", ["Found api key in Skytils!"]) return; @@ -233,7 +232,7 @@ class Hud extends Feature { try{ let testKey = FileLib.read("soopyAddonsData", "apikey.txt") if(testKey){ - if(verifyKey(testKey)){ + if(this.verifyKey(testKey)){ this.module.apiKeySetting.setValue(testKey) new Notification("§aSuccess!", ["Found api key in old soopyaddons version!"]) return; @@ -247,7 +246,7 @@ class Hud extends Feature { try{ let testKey = JSON.parse(FileLib.read("HypixelApiKeyManager", "localdata.json")).key if(testKey){ - if(verifyKey(testKey)){ + if(this.verifyKey(testKey)){ this.module.apiKeySetting.setValue(testKey) new Notification("§aSuccess!", ["Found api key in HypixelApiKeyManager!"]) return; @@ -266,7 +265,7 @@ class Hud extends Feature { ChatLib.command("api new") } - verifyKey(key){ + verifyKey2(key){ if(key){ try{ var url = "https://api.hypixel.net/key?key=" + key |