diff options
author | Soopyboo32 <49228220+Soopyboo32@users.noreply.github.com> | 2022-08-25 19:58:07 +0800 |
---|---|---|
committer | Soopyboo32 <49228220+Soopyboo32@users.noreply.github.com> | 2022-08-25 19:58:07 +0800 |
commit | 68984c4463ff51d60e745d43bf51eb15540725d2 (patch) | |
tree | 48120c5cf481b341e8a192b6eef4ccddba022b6b /features | |
parent | ee8f99633a66e12b1d0c6fb9daaedb2ba802b755 (diff) | |
download | SoopyV2-68984c4463ff51d60e745d43bf51eb15540725d2.tar.gz SoopyV2-68984c4463ff51d60e745d43bf51eb15540725d2.tar.bz2 SoopyV2-68984c4463ff51d60e745d43bf51eb15540725d2.zip |
+ fix dungeon map
+ powder hud fixes
+ guild bridge formatting
+ meta
Diffstat (limited to 'features')
-rw-r--r-- | features/dungeonMap/index.js | 6 | ||||
-rw-r--r-- | features/globalSettings/index.js | 12 | ||||
-rw-r--r-- | features/guild/index.js | 68 | ||||
-rw-r--r-- | features/guild/metadata.json | 8 | ||||
-rw-r--r-- | features/specialMining/index.js | 3 |
5 files changed, 84 insertions, 13 deletions
diff --git a/features/dungeonMap/index.js b/features/dungeonMap/index.js index 9af147b..6fb0511 100644 --- a/features/dungeonMap/index.js +++ b/features/dungeonMap/index.js @@ -675,7 +675,9 @@ class DungeonMap extends Feature { if (bytes[x + y * 128] === 30 && bytes[x + 1 + y * 128] === 30 && bytes[x + 2 + y * 128] === 30 - && bytes[x + 3 + y * 128] === 30) { + && bytes[x + 3 + y * 128] === 30 + && bytes[x + 5 + y * 128] === 30 + && bytes[x + 10 + y * 128] === 30) { rx = x ry = y while (bytes[(rx - 1) + ry * 128] === 30) { @@ -689,7 +691,6 @@ class DungeonMap extends Feature { } if (rx) break; } - let x = rx while (bytes[x + ry * 128] === 30) { x++ @@ -700,6 +701,7 @@ class DungeonMap extends Feature { y++ roomWidth1++ } + let roomWidth = Math.floor(Math.max(roomWidth1, roomWidth2) * 5 / 4) this.mapScale = 32 / roomWidth diff --git a/features/globalSettings/index.js b/features/globalSettings/index.js index 1173c16..dbb21fb 100644 --- a/features/globalSettings/index.js +++ b/features/globalSettings/index.js @@ -16,7 +16,7 @@ import { fetch } from "../../utils/networkUtils"; import socketConnection from "../../socketConnection"; import renderLibs from "../../../guimanager/renderLibs"; import { f } from "../../../mappings/mappings"; -import { addLore, getSBUUID } from "../../utils/utils"; +import { addLore, getSBUUID, toMessageWithLinks } from "../../utils/utils"; import { delay } from "../../utils/delayUtils"; const Files = Java.type("java.nio.file.Files") const Paths = Java.type("java.nio.file.Paths") @@ -263,15 +263,7 @@ class GlobalSettings extends Feature { ChatLib.addToSentMessageHistory(message) fetch("http://soopy.dev/api/soopyv2/botcommand?m=" + encodeURIComponent(message.replace("-", "")) + "&u=" + Player.getName()).text(text => { ChatLib.chat(this.FeatureManager.messagePrefix + "&7" + message) - let sendMessage = text - sendMessage = sendMessage.split(" ").map(a => { - if (a.match(/(?:(?:https?|ftp|file):\/\/|www\.|ftp\.)(?:\([-A-Z0-9+&@#\/%=~_|$?!:,.]*\)|[-A-Z0-9+&@#\/%=~_|$?!:,.])*(?:\([-A-Z0-9+&@#\/%=~_|$?!:,.]*\)|[A-Z0-9+&@#\/%=~_|$])/igm)) { - return new TextComponent("&f&n" + a + ' ').setHover("show_text", "Click to open " + a).setClick("open_url", a) - } else { - return new TextComponent("&f" + a + ' ') - } - }) - sendMessage.reduce((c, curr) => c.addTextComponent(curr), new Message().addTextComponent(new TextComponent(this.FeatureManager.messagePrefix))).chat() + toMessageWithLinks(this.FeatureManager.messagePrefix + text, "7").chat() }) } }) diff --git a/features/guild/index.js b/features/guild/index.js new file mode 100644 index 0000000..8be193b --- /dev/null +++ b/features/guild/index.js @@ -0,0 +1,68 @@ +/// <reference types="../../../CTAutocomplete" /> +/// <reference lib="es2015" /> +import Feature from "../../featureClass/class"; +import { toMessageWithLinks } from "../../utils/utils"; +import { fetch } from "../../utils/networkUtils"; +import ToggleSetting from "../settings/settingThings/toggle"; +import TextSetting from "../settings/settingThings/textSetting"; + +class Guild extends Feature { + constructor() { + super() + } + + onEnable() { + + this.bridgeBots = new Set() + fetch("http://soopy.dev/api/soopyv2/gbots.json").json(bots => { + bots.forEach(b => this.bridgeBots.add(b)) + }) + + this.shortenPrefix = new ToggleSetting("Shorten guild message prefix", "from Guild > to G > ", false, "shorten_prefix", this) + this.guildBot = new TextSetting("Bridge bot ign", "", "", "guild_bot_ign", this, "", false) + + //&r&2Guild > &6[MVP&0++&6] zZzSNOW &e[STAFF]&f: &r@niftynathan7, niftynathan7's weight: 20 087 (#1 198) (Skill: 8 771, Slayer: 1 263, Dungeons: 10 053) ,.,,,..,.,,.,,,....,,,,,,,,,..,,,,,..,,,..,,,.,,.,,.,..,,....,,....,,..,.&r + //&r&2Guild > &6[MVP&4++&6] Soopyboo32 &e[STAFF]&f: &rasd&r + //&r&2Guild > &6[MVP&1++&6] niftynathan7 &e[E]&f: &r@Soopyboo32, Soopyboo32's networth: $8 424 131 866 (#2 592) ,..,...,....,.,,,....,,,...,,,,,,,..,,.,,..,,.,.,,,.........,.....,,,,.....,..,,...,.,.,...,.,&r + this.registerChat('&r&2Guild > ${player}&f: &r${msg}&r', (player, msg, event) => { + if (player.includes(":")) return; //stop people sending weard messages to troll using this + + //player = &6[MVP&0++&6] zZzSNOW &e[STAFF] + let [_, rank, ign, grank] = player.match(/(&7|&[0-9a-fmnl]\[\w+(?:&[0-9a-fmnl]\+*&[0-9a-fmnl])?\] )(\w+)( &[0-9a-fmnl]\[\w+\])?/) + + cancel(event) + + let message = "" + if (this.bridgeBots.has(ign) || ign.toLowerCase() === this.guildBot.getValue().toLowerCase()) { + let [name, other] = msg.split(/ ?[\>\:\»] /g) + + if (other) { + message = `&2B${this.shortenPrefix.getValue() ? "" : "ridge"} > &b${name.split(" replying to ").reverse().join(" &7⤷&b ").trim()}&f: ${msg.replace(name, "").replace(/^ ?[\>\:\»] /, "").trim()}` + } else { + if (msg.includes("---------------------------------------------") || msg.includes("You have 60 seconds to accept. Click here to join!")) { + return //bridge bot bug + } + message = `&2B${this.shortenPrefix.getValue() ? "" : "ridge"} > &7⤷&f ${msg.trim()}` + } + } else { + if (msg.match(/^@\w+, [\w\W]+[,.]+/)) { + let [_, name2, reply] = msg.match(/^@(\w+?), ([\w\W]+?)[,.]+/) + message = `&2B${this.shortenPrefix.getValue() ? "" : "ridge"} > &b${name2} &7⤷&f ${reply.trim()}` + } else { + message = `&2G${this.shortenPrefix.getValue() ? "" : "uild"} > ${rank}${ign}${grank || ""}&f: ${msg}` + } + } + + + toMessageWithLinks(message).chat() + }) + } + + onDisable() { + + } +} + +module.exports = { + class: new Guild() +}
\ No newline at end of file diff --git a/features/guild/metadata.json b/features/guild/metadata.json new file mode 100644 index 0000000..a75b3e4 --- /dev/null +++ b/features/guild/metadata.json @@ -0,0 +1,8 @@ +{ + "name": "Guild features", + "description": "Features nice for guilds, eg bridge formatting", + "isHidden": false, + "isTogglable": true, + "defaultEnabled": true, + "sortA": 1 +}
\ No newline at end of file diff --git a/features/specialMining/index.js b/features/specialMining/index.js index 7f7a787..2694427 100644 --- a/features/specialMining/index.js +++ b/features/specialMining/index.js @@ -63,7 +63,7 @@ class PowderAndScatha extends Feature { this.overlayRight = [] this.leftCH = false; - this.registerChat("&7Sending to server ${s}&r", (s, e) => { + this.registerEvent("worldLoad", () => { if (this.inCrystalHollows) { this.leftCH = true; this.inCrystalHollows = false; @@ -169,6 +169,7 @@ class PowderAndScatha extends Feature { resetMiningData(type) { if (type === "powder") { Object.keys(this.miningData.powder).forEach(thing => this.miningData.powder[thing] = 0) + this.expRateInfo = [] } else if (type === "scatha") { //TODO } |