diff options
Diffstat (limited to 'features')
-rw-r--r-- | features/dataLoader/index.js | 42 | ||||
-rw-r--r-- | features/events/index.js | 16 | ||||
-rw-r--r-- | features/globalSettings/index.js | 2 |
3 files changed, 54 insertions, 6 deletions
diff --git a/features/dataLoader/index.js b/features/dataLoader/index.js index 0553b2a..d31bd86 100644 --- a/features/dataLoader/index.js +++ b/features/dataLoader/index.js @@ -37,6 +37,9 @@ class DataLoader extends Feature { this.loadedApiDatas = {} + this.partyMembers = new Set() + this.partyMembers.add(Player.getName()) + this.lastApiData = { "skyblock": undefined, "player": undefined, @@ -50,7 +53,44 @@ class DataLoader extends Feature { this.step_5min() - this.firstLoaded = false + this.firstLoaded = false; + + ["You are not currently in a party.", "You have been kicked from the party by ${*}", "You left the party.", "The party was disbanded because all invites expired and the party was empty", "${*} &r&ehas disbanded the party!&r"].forEach(m => this.registerChat(m, () => { + this.partyMembers.clear() + this.partyMembers.add(Player.getName()) + })); + + ["${mem} &r&ejoined the party.&r", "${mem} &r&einvited &r${*} &r&eto the party! They have &r&c60 &r&eseconds to accept.&r", "&dDungeon Finder &r&f> &r${mem} &r&ejoined the dungeon group! (&r&b${*}&r&e)&r"].forEach(m => this.registerChat(m, (mem) => { + this.partyMembers.add(ChatLib.removeFormatting(mem.trim().split(" ").pop().trim())) + })); + ["${mem} &r&ehas been removed from the party.&r", "${mem} &r&ehas left the party.&r", "${mem} &r&ewas removed from your party because they disconnected&r", "Kicked ${mem} because they were offline."].forEach(m => this.registerChat(m, (mem) => { + this.partyMembers.delete(ChatLib.removeFormatting(mem.trim().split(" ").pop().trim())) + })) + this.registerChat("&eYou have joined &r${mem}'s &r&eparty!&r", (mem) => { + this.partyMembers.clear() + this.partyMembers.add(Player.getName()) + this.partyMembers.add(ChatLib.removeFormatting(p = mem.trim().split(" ").pop().trim())) + }) + this.registerChat("&eYou have joined &r${mem}' &r&eparty!&r", (mem) => { + this.partyMembers.clear() + this.partyMembers.add(Player.getName()) + this.partyMembers.add(ChatLib.removeFormatting(mem).trim()) + }) + this.registerChat("&eYou'll be partying with: ${mem}", (mem) => { + mem.split(",").forEach(p => { + this.partyMembers.add(ChatLib.removeFormatting(p.trim().split(" ").pop().trim())) + }) + }) + this.registerChat("&eParty ${type}: ${mem}", (type, mem) => { + if (type.toLowerCase().includes("leader")) this.partyMembers.clear() + ChatLib.removeFormatting(mem).split("●").forEach(p => { + if (!p.trim()) return + this.partyMembers.add(p.trim().split(" ").pop().trim()) + }) + }) + this.registerCommand("pmembdebug", () => { + ChatLib.chat([...this.partyMembers].join(" | ")) + }) } step_5min() { diff --git a/features/events/index.js b/features/events/index.js index e917d94..19ff72f 100644 --- a/features/events/index.js +++ b/features/events/index.js @@ -59,9 +59,9 @@ class Events extends Feature { ChatLib.command("togglemusic") }, false).requires(this.showBurrialGuess) - this.otherInquisWaypoints = new ToggleSetting("Show other users inquis locations", "May be usefull for loot share", true, "inquis_location_other", this).requires(this.loadFromParticles) + this.otherInquisWaypoints = new ToggleSetting("Show other users inquis locations", "If disabled others wont be able to see urs", true, "inquis_location_other", this).requires(this.loadFromParticles) this.otherInquisPing = new ToggleSetting("Show cool title when someone's inquis spawned", "May be usefull for loot share", true, "inquis_ping_other", this).requires(this.loadFromParticles) - + this.limitPMemb = new ToggleSetting("Only send inquis ping to party members", "If not in a party it works as default", true, "inquis_ping_party", this).requires(this.otherInquisPing) this.shinyBlocks = [] this.lastDing = 0 @@ -121,10 +121,16 @@ class Events extends Feature { warpData.worldload = [Player.getX(), Player.getY(), Player.getZ()] ChatLib.chat(this.FeatureManager.messagePrefix + "Set /hub location!") }) + this.registerCommand("setpmemb", (...memb) => { + this.FeatureManager.features["dataLoader"].class.partyMembers.clear() + memb.forEach(m => { + this.FeatureManager.features["dataLoader"].class.partyMembers.add(memb) + }) + }) } entityJoinWorldEvent(e) { - this.todoE.push(e.entity); + if (this.otherInquisWaypoints.getValue()) this.todoE.push(e.entity); } inquisData(loc, user) { @@ -233,7 +239,9 @@ class Events extends Feature { } }) if (self) { - socketConnection.sendInquisData({ loc: [Math.round(Player.getX()), Math.round(Player.getY()), Math.round(Player.getZ())] }); + let pmemb = [] + this.FeatureManager.features["dataLoader"].class.partyMembers.forEach(a => pmemb.push(a)) + socketConnection.sendInquisData({ loc: [Math.round(Player.getX()), Math.round(Player.getY()), Math.round(Player.getZ())], pmemb, limitPMemb: pmemb.length !== 0 && this.limitPMemb.getValue() }); this.inquisWaypointSpawned = true } } diff --git a/features/globalSettings/index.js b/features/globalSettings/index.js index e4460b0..85a1dc1 100644 --- a/features/globalSettings/index.js +++ b/features/globalSettings/index.js @@ -117,7 +117,7 @@ class GlobalSettings extends Feature { this.registerCommand("lobbyusers", () => { fetch("http://soopymc.my.to/api/soopyv2/lobbyusers/" + this.FeatureManager.features["dataLoader"].class.stats.Server).json(data => { ChatLib.chat("&c" + ChatLib.getChatBreak("-")) - ChatLib.chat(this.FeatureManager.messagePrefix + "&7(" + data.data + ")&r Lobby soopyv2 users:") + ChatLib.chat(this.FeatureManager.messagePrefix + "&7(" + data.data.length + ")&r Lobby soopyv2 users:") data.data.forEach(name => { ChatLib.chat("&7 - &r" + name) }) |