diff options
Diffstat (limited to 'features')
-rw-r--r-- | features/cosmetics/dragonWings.js | 9 | ||||
-rw-r--r-- | features/cosmetics/index.js | 55 | ||||
-rw-r--r-- | features/settings/settingThings/settingBase.js | 5 | ||||
-rw-r--r-- | features/slayers/index.js | 20 | ||||
-rw-r--r-- | features/spamHider/index.js | 126 |
5 files changed, 176 insertions, 39 deletions
diff --git a/features/cosmetics/dragonWings.js b/features/cosmetics/dragonWings.js index 8f960cf..d62178b 100644 --- a/features/cosmetics/dragonWings.js +++ b/features/cosmetics/dragonWings.js @@ -107,7 +107,7 @@ class DragonWings extends Cosmetic { } GlStateManager.func_179094_E(); // pushMatrix - Tessellator.colorize(1, 1, 1) + Tessellator.colorize(this.settings.color.r, this.settings.color.g, this.settings.color.b); if(this.player !== Player){ Tessellator.translate( @@ -261,11 +261,14 @@ class DragonWings extends Cosmetic { } GL11.glDisable(GL11.GL_CULL_FACE) - Tessellator.translate(0.1, 0, 0) + + let wing_center_dist = ((0-Math.log(1000*this.settings.scale+0.01)-2)-100000*this.settings.scale*this.settings.scale)/1000 + + Tessellator.translate(-wing_center_dist, 0, 0) Tessellator.scale(this.settings.scale, this.settings.scale, this.settings.scale) wing.func_78791_b(1) //render left wing - Tessellator.translate(-0.2/this.settings.scale, 0, 0) + Tessellator.translate(2*wing_center_dist/this.settings.scale, 0, 0) Tessellator.scale(-1, 1, 1) wing.func_78791_b(1) //render right wing diff --git a/features/cosmetics/index.js b/features/cosmetics/index.js index e4de980..20477ce 100644 --- a/features/cosmetics/index.js +++ b/features/cosmetics/index.js @@ -38,13 +38,31 @@ class Cosmetics extends Feature { }) } - loadCosmeticsData(){ let data = JSON.parse(FileLib.getUrlContent("http://soopymc.my.to/api/soopyv2/cosmetics.json")) this.cosmeticsData = data - this.playerHasACosmeticA = !!data[Player.getUUID().toString()] + this.playerHasACosmeticA = !!data[Player.getUUID().toString().replace(/-/g,"")] + + this.scanForNewCosmetics() + } + setUserCosmeticsInformation(uuid, cosmetics){ + if(!this.enabled) return + + this.loadedCosmetics = this.loadedCosmetics.filter(cosmetic=>{ + if(cosmetic.player.getUUID().toString().replace(/-/g,"") === uuid){ + this.uuidToCosmetic[cosmetic.player.getUUID().toString().replace(/-/g,"")] = undefined + return false + } + return true + }) + + if(!cosmetics){ + delete this.cosmeticsData[uuid] + return + } + this.cosmeticsData[uuid] = cosmetics this.scanForNewCosmetics() } @@ -53,18 +71,18 @@ class Cosmetics extends Feature { } scanForNewCosmetics(){ - if(!this.uuidToCosmetic[Player.getUUID().toString()] && this.shouldPlayerHaveCosmetic(Player, "dragon_wings")){ + if(!this.uuidToCosmetic[Player.getUUID().toString().replace(/-/g,"")] && this.shouldPlayerHaveCosmetic(Player, "dragon_wings")){ let cosmetic = new DragonWings(Player, this) this.loadedCosmetics.push(cosmetic) - this.uuidToCosmetic[Player.getUUID().toString()] = cosmetic + this.uuidToCosmetic[Player.getUUID().toString().replace(/-/g,"")] = cosmetic } World.getAllPlayers().forEach(p=>{ - if(p.getUUID().toString() === Player.getUUID().toString() || this.uuidToCosmetic[p.getUUID().toString()]) return + if(p.getUUID().toString().replace(/-/g,"") === Player.getUUID().toString().replace(/-/g,"") || this.uuidToCosmetic[p.getUUID().toString().replace(/-/g,"")]) return if(this.shouldPlayerHaveCosmetic(p, "dragon_wings")){ let cosmetic = new DragonWings(p, this) this.loadedCosmetics.push(cosmetic) - this.uuidToCosmetic[p.getUUID().toString()] = cosmetic + this.uuidToCosmetic[p.getUUID().toString().replace(/-/g,"")] = cosmetic } }) } @@ -73,37 +91,37 @@ class Cosmetics extends Feature { this.loadedCosmetics = [] this.uuidToCosmetic = {} - if(this.shouldPlayerHaveCosmetic(Player, "dragon_wings") && !this.uuidToCosmetic[Player.getUUID().toString()]){ + if(this.shouldPlayerHaveCosmetic(Player, "dragon_wings") && !this.uuidToCosmetic[Player.getUUID().toString().replace(/-/g,"")]){ let cosmetic = new DragonWings(Player, this) this.loadedCosmetics.push(cosmetic) - this.uuidToCosmetic[Player.getUUID().toString()] = cosmetic + this.uuidToCosmetic[Player.getUUID().toString().replace(/-/g,"")] = cosmetic } World.getAllPlayers().forEach(p=>{ - if(p.getUUID().toString() === Player.getUUID().toString()) return - if(this.shouldPlayerHaveCosmetic(p, "dragon_wings") && !this.uuidToCosmetic[p.getUUID().toString()]){ + if(p.getUUID().toString().replace(/-/g,"") === Player.getUUID().toString().replace(/-/g,"")) return + if(this.shouldPlayerHaveCosmetic(p, "dragon_wings") && !this.uuidToCosmetic[p.getUUID().toString().replace(/-/g,"")]){ let cosmetic = new DragonWings(p, this) this.loadedCosmetics.push(cosmetic) - this.uuidToCosmetic[p.getUUID().toString()] = cosmetic + this.uuidToCosmetic[p.getUUID().toString().replace(/-/g,"")] = cosmetic } }) } playerJoined(player){ - if(player.getUUID().toString() === Player.getUUID().toString()) return + if(player.getUUID().toString().replace(/-/g,"") === Player.getUUID().toString().replace(/-/g,"")) return - if(this.shouldPlayerHaveCosmetic(player, "dragon_wings") && !this.uuidToCosmetic[player.getUUID().toString()]){ + if(this.shouldPlayerHaveCosmetic(player, "dragon_wings") && !this.uuidToCosmetic[player.getUUID().toString().replace(/-/g,"")]){ let cosmetic = new DragonWings(player, this) this.playerHasACosmeticA = true this.loadedCosmetics.push(cosmetic) - this.uuidToCosmetic[player.getUUID().toString()] = cosmetic + this.uuidToCosmetic[player.getUUID().toString().replace(/-/g,"")] = cosmetic } } playerLeft(playerName){ this.loadedCosmetics.filter(cosmetic=>{ if(cosmetic.player.getName() === playerName){ - this.uuidToCosmetic[cosmetic.player.getUUID().toString()] = undefined + this.uuidToCosmetic[cosmetic.player.getUUID().toString().replace(/-/g,"")] = undefined return false } return true @@ -111,17 +129,17 @@ class Cosmetics extends Feature { } shouldPlayerHaveCosmetic(player, cosmetic){ - return !!this.cosmeticsData[player.getUUID().toString()]?.[cosmetic] + return !!this.cosmeticsData[player.getUUID().toString().replace(/-/g,"")]?.[cosmetic] } getPlayerCosmeticSettings(player, cosmetic){ - return this.cosmeticsData[player.getUUID().toString()]?.[cosmetic] + return this.cosmeticsData[player.getUUID().toString().replace(/-/g,"")]?.[cosmetic] } filterUnloadedCosmetics(tick){ this.loadedCosmetics = this.loadedCosmetics.filter(cosmetic => { if(tick) cosmetic.onTick() if(cosmetic.player.getPlayer().field_70128_L){ //filter out players that are no longer loaded - this.uuidToCosmetic[cosmetic.player.getUUID().toString()] = undefined + this.uuidToCosmetic[cosmetic.player.getUUID().toString().replace(/-/g,"")] = undefined return false } return true @@ -164,6 +182,7 @@ class Cosmetics extends Feature { this.loadedCosmetics = undefined this.uuidToCosmetic = undefined this.playerHasACosmeticA = undefined + this.cosmeticsData = undefined } onDisable(){ diff --git a/features/settings/settingThings/settingBase.js b/features/settings/settingThings/settingBase.js index fbee5bf..a0d3bc7 100644 --- a/features/settings/settingThings/settingBase.js +++ b/features/settings/settingThings/settingBase.js @@ -1,6 +1,7 @@ import SoopyContentChangeEvent from "../../../../guimanager/EventListener/SoopyContentChangeEvent"; import BoxWithTextAndDescription from "../../../../guimanager/GuiElement/BoxWithTextAndDescription" import SoopyGuiElement from "../../../../guimanager/GuiElement/SoopyGuiElement"; +import renderLibs from "../../../../guimanager/renderLibs"; import settingsCommunicator from "../settingsCommunicator"; class SettingBase { @@ -14,8 +15,8 @@ class SettingBase { this.val = defaultVal; - this.guiObject = new BoxWithTextAndDescription().setDesc("§0"+this.description).setText("§0"+this.name).setLocation(0, 0, 1, 0.175) - + this.guiObject = new BoxWithTextAndDescription().setDesc("§0"+this.description.replace(/\n/g, "\n§0")).setText("§0"+this.name).setLocation(0, 0, 1, 0.175) + this.settingObject = new SoopyGuiElement().setLocation(0.8, 0, 0.2, 1) this.guiObject.addChild(this.settingObject) diff --git a/features/slayers/index.js b/features/slayers/index.js index 3599996..8d35304 100644 --- a/features/slayers/index.js +++ b/features/slayers/index.js @@ -69,9 +69,12 @@ class Slayers extends Feature { this.todoE2 = [] this.emanBoss = undefined this.nextIsBoss = 0 + this.counter = 0 + + this.entityAttackEventLoaded = false + this.entityAttackEventE = undefined this.registerForge(net.minecraftforge.event.entity.EntityJoinWorldEvent, this.entityJoinWorldEvent) - this.registerForge(net.minecraftforge.event.entity.living.LivingAttackEvent, this.entityAttackEvent) //TODO: Use CT event when ct 2.0 because they fixed this.registerEvent("tick", this.tick) this.registerEvent("renderWorld", this.renderWorld) this.registerEvent("worldLoad", this.worldLoad) @@ -111,6 +114,19 @@ class Slayers extends Feature { } renderWorld(ticks){ + + if(this.FeatureManager.features["dataLoader"].class.isInSkyblock){ + if(!this.entityAttackEventLoaded){ + this.entityAttackEventLoaded = true + this.entityAttackEventE = this.registerForge(net.minecraftforge.event.entity.living.LivingAttackEvent, this.entityAttackEvent) //TODO: Use CT event when ct 2.0 because they fixed + } + }else{ + if(this.entityAttackEventLoaded){ + this.entityAttackEventLoaded = false + this.unregisterForge(this.entityAttackEventE) + } + } + Object.values(this.beaconPoints).forEach(line=>{ let lastPoint = undefined line.forEach(p=>{ @@ -346,7 +362,9 @@ class Slayers extends Feature { this.eyeE = undefined this.nextIsBoss = undefined this.hudElements = [] + this.entityAttackEventLoaded = undefined this.todoE2 = undefined + this.entityAttackEventE = undefined } onDisable(){ diff --git a/features/spamHider/index.js b/features/spamHider/index.js index 37c964f..c534dd3 100644 --- a/features/spamHider/index.js +++ b/features/spamHider/index.js @@ -1,7 +1,8 @@ /// <reference types="../../../CTAutocomplete" /> /// <reference lib="es2015" /> import Feature from "../../featureClass/class"; -import { newSideMessage, setLocation } from "../../../soopyApis"; +import soopyV2Server from "../../socketConnection"; +import ToggleSetting from "../settings/settingThings/toggle"; class SpamHider extends Feature { constructor() { @@ -16,6 +17,10 @@ class SpamHider extends Feature { this.moveMessages = [] this.moveMessagesRexex = [] + this.hideMessagesSetting = new ToggleSetting("Hide some messages", "This will completely remove some spammy messages from chat", true, "completely_hide_spam", this) + this.moveMessagesSetting = new ToggleSetting("Move some messages to spam hider", "This will move some (potentially) usefull messages into a 'second chat'", true, "move_spam", this) + this.moveChatMessages = new ToggleSetting("Move spammed chat messages to spam hider", "This will move messages spammed in hubs to spam hider\n(eg the website advertisment bots)", true, "move_spam_chat", this) + this.SpamHiderMessagesRenderer = new SpamHiderMessagesRenderer() this.loadSpamMessages() @@ -23,25 +28,50 @@ class SpamHider extends Feature { this.registerChat("${*}", this.onChat) this.registerEvent("renderOverlay", this.renderOverlay) + + this.registerChat("&r${userandrank}&r&f: ${message}&r", this.chatPlayerMessage) } - onChat(e){ - let msg = ChatLib.getChatMessage(e, true).replace(/§/g, "&").replace(/(?:^&r)|(?:&r$)/g, "") + chatPlayerMessage(userandrank, message, e){ + if(userandrank.includes(">")) return + if(message.length < 10) return //Short messages like 'LOL' are bound to get repeated - this.hideMessagesRexex.forEach(regex => { - if(regex.test(msg)){ - cancel(e) - return - } - }) + let msg = sha256(message + "This is a salt PogU") - this.moveMessagesRexex.forEach(regex => { - if(regex.test(msg)){ - this.SpamHiderMessagesRenderer.addMessage(msg) + if(soopyV2Server.spammedMessages.includes(msg)){ + if(this.moveChatMessages.getValue()){ + this.SpamHiderMessagesRenderer.addMessage(ChatLib.getChatMessage(e, true)) cancel(e) - return } - }) + return + } + + if(this.FeatureManager.features["generalSettings"].class.sendChatSetting && this.FeatureManager.features["generalSettings"].class.sendChatSetting.getValue()){ + soopyV2Server.sendMessageToServer(msg, sha256(this.FeatureManager.features["dataLoader"].class.stats["Server"] + "This is a salt PogU")) + } + } + + onChat(e){ + let msg = ChatLib.getChatMessage(e, true).replace(/§/g, "&").replace(/(?:^&r)|(?:&r$)/g, "") + + if(this.hideMessagesSetting.getValue()){ + this.hideMessagesRexex.forEach(regex => { + if(regex.test(msg)){ + cancel(e) + return + } + }) + } + + if(this.moveMessagesSetting.getValue()){ + this.moveMessagesRexex.forEach(regex => { + if(regex.test(msg)){ + this.SpamHiderMessagesRenderer.addMessage(msg) + cancel(e) + return + } + }) + } } renderOverlay(){ this.SpamHiderMessagesRenderer.render(100,100,1, 1) @@ -172,4 +202,70 @@ class SpamHiderMessagesRenderer{ module.exports = { class: new SpamHider() -}
\ No newline at end of file +} + +var sha256 = function a(b) { + function c(a, b) { + return (a >>> b) | (a << (32 - b)); + } + for ( + var d, + e, + f = Math.pow, + g = f(2, 32), + h = "length", + i = "", + j = [], + k = 8 * b[h], + l = (a.h = a.h || []), + m = (a.k = a.k || []), + n = m[h], + o = {}, + p = 2; + 64 > n; + p++ + ) + if (!o[p]) { + for (d = 0; 313 > d; d += p) o[d] = p; + (l[n] = (f(p, 0.5) * g) | 0), (m[n++] = (f(p, 1 / 3) * g) | 0); + } + for (b += "\x80"; (b[h] % 64) - 56;) b += "\x00"; + for (d = 0; d < b[h]; d++) { + if (((e = b.charCodeAt(d)), e >> 8)) return; + j[d >> 2] |= e << (((3 - d) % 4) * 8); + } + for (j[j[h]] = (k / g) | 0, j[j[h]] = k, e = 0; e < j[h];) { + var q = j.slice(e, (e += 16)), + r = l; + for (l = l.slice(0, 8), d = 0; 64 > d; d++) { + var s = q[d - 15], + t = q[d - 2], + u = l[0], + v = l[4], + w = + l[7] + + (c(v, 6) ^ c(v, 11) ^ c(v, 25)) + + ((v & l[5]) ^ (~v & l[6])) + + m[d] + + (q[d] = + 16 > d + ? q[d] + : (q[d - 16] + + (c(s, 7) ^ c(s, 18) ^ (s >>> 3)) + + q[d - 7] + + (c(t, 17) ^ c(t, 19) ^ (t >>> 10))) | + 0), + x = + (c(u, 2) ^ c(u, 13) ^ c(u, 22)) + + ((u & l[1]) ^ (u & l[2]) ^ (l[1] & l[2])); + (l = [(w + x) | 0].concat(l)), (l[4] = (l[4] + w) | 0); + } + for (d = 0; 8 > d; d++) l[d] = (l[d] + r[d]) | 0; + } + for (d = 0; 8 > d; d++) + for (e = 3; e + 1; e--) { + var y = (l[d] >> (8 * e)) & 255; + i += (16 > y ? 0 : "") + y.toString(16); + } + return i; + };
\ No newline at end of file |