diff options
author | Soopyboo32 <49228220+Soopyboo32@users.noreply.github.com> | 2022-05-08 09:43:57 +0800 |
---|---|---|
committer | Soopyboo32 <49228220+Soopyboo32@users.noreply.github.com> | 2022-05-08 09:43:57 +0800 |
commit | c92f4e93147874e6d3f28799bbe3196e55de4b3a (patch) | |
tree | 4eaca5ea00481d80db57879d8ba53616aa69eca8 | |
parent | 5cd8bd6a4c0a61d3258816ae4a9666daade4d2da (diff) | |
download | SoopyV2-c92f4e93147874e6d3f28799bbe3196e55de4b3a.tar.gz SoopyV2-c92f4e93147874e6d3f28799bbe3196e55de4b3a.tar.bz2 SoopyV2-c92f4e93147874e6d3f28799bbe3196e55de4b3a.zip |
+ fix inquis waypoints
+ add waypoints on /patcher sendcoords
-rw-r--r-- | features/events/index.js | 6 | ||||
-rw-r--r-- | features/waypoints/index.js | 28 | ||||
-rw-r--r-- | index.js | 1 | ||||
-rw-r--r-- | metadata.json | 4 |
4 files changed, 37 insertions, 2 deletions
diff --git a/features/events/index.js b/features/events/index.js index eb29128..c315955 100644 --- a/features/events/index.js +++ b/features/events/index.js @@ -1,6 +1,7 @@ /// <reference types="../../../CTAutocomplete" /> /// <reference lib="es2015" /> import Feature from "../../featureClass/class"; +import socketConnection from "../../socketConnection"; import { drawBoxAtBlock, drawBoxAtBlockNotVisThruWalls, drawCoolWaypoint, drawLine } from "../../utils/renderUtils"; import { calculateDistanceQuick } from "../../utils/utils"; import SettingBase from "../settings/settingThings/settingBase"; @@ -62,11 +63,16 @@ class Events extends Feature { this.registerChat("&r&eYou finished the Griffin burrow chain! &r&7(4/4)&r", this.burrialClicked) this.inquisWaypointSpawned = false this.registerChat("${a}You dug out a ${thing}!", (a, thing) => { + console.log(a, thing) if (a.includes(":") || a.length === 0 || a.length > 50) return if (!thing.toLowerCase().includes("inquis")) return this.inquisWaypointSpawned = true socketConnection.sendInquisData({ loc: [Math.round(Player.getX()), Math.round(Player.getY()), Math.round(Player.getZ())] }); }) + this.registerCommand("fakeinquis", () => { + this.inquisWaypointSpawned = true + socketConnection.sendInquisData({ loc: [Math.round(Player.getX()), Math.round(Player.getY()), Math.round(Player.getZ())] }); + }) } inquisData(loc, user) { diff --git a/features/waypoints/index.js b/features/waypoints/index.js index 1f256ce..bcd3fc5 100644 --- a/features/waypoints/index.js +++ b/features/waypoints/index.js @@ -4,6 +4,7 @@ import { m } from "../../../mappings/mappings"; import Feature from "../../featureClass/class"; import { drawCoolWaypoint } from "../../utils/renderUtils"; import SettingBase from "../settings/settingThings/settingBase"; +import ToggleSetting from "../settings/settingThings/toggle"; class Waypoints extends Feature { @@ -20,6 +21,8 @@ class Waypoints extends Feature { new SettingBase("/savewaypoints", "Copys the waypoints to your clipboard", undefined, "save_waypoints", this) new SettingBase("/loadwaypoints", "Loads waypoints from your clipboard", undefined, "load_waypoints", this) + this.loadWaypointsFromSendCoords = new ToggleSetting("Load waypoints from /patcher sendcoords messages", "Will dissapear after 1min", true, "load_waypoints_from_sendcoords", this) + this.userWaypoints = JSON.parse(FileLib.read("soopyAddonsData", "soopyv2userwaypoints.json") || "{}") this.userWaypointsHash = {} this.userWaypointsAll = [] @@ -27,6 +30,8 @@ class Waypoints extends Feature { this.updateWaypointsHashes() this.waypointsChanged = false + this.patcherWaypoints = [] + this.registerEvent("renderWorld", this.renderWorld) this.registerCommand("addwaypoint", (name, x = Math.floor(Player.getX()).toString(), y = Math.floor(Player.getY()).toString(), z = Math.floor(Player.getZ()).toString(), r = "0", g = "255", b = "0", area = "") => { @@ -92,6 +97,26 @@ class Waypoints extends Feature { ChatLib.chat(this.FeatureManager.messagePrefix + "Error loading from clipboard!") } }) + //&r&9Party &8> &6[MVP&4++&6] Soopyboo32&f: &rx: -150, y: 73, z: -97 &r + //&r&6[MVP&r&4++&r&6] Soopyboo32&r&f: x: 23, y: 100, z: -2&r + //&r&6[MVP&r&4++&r&6] Soopyboo32&r&f: x: -22, y: 100, z: 7&r + this.registerChat("&r${*} &8> ${player}&f: &rx: ${x}, y: ${y}, z: ${z}", (player, x, y, z, e) => { + if (this.loadWaypointsFromSendCoords.getValue()) { + this.patcherWaypoints.push([Date.now(), parseInt(x), parseInt(y), parseInt(ChatLib.removeFormatting(z)), ChatLib.addColor(player)]) + } + }) + this.registerChat("${player}&r&f: x: ${x}, y: ${y}, z: ${z}", (player, x, y, z, e) => { + if (player.includes(">")) return + if (this.loadWaypointsFromSendCoords.getValue()) { + this.patcherWaypoints.push([Date.now(), parseInt(x), parseInt(y), parseInt(ChatLib.removeFormatting(z)), ChatLib.addColor(player)]) + } + }) + + this.registerStep(false, 5, () => { + while (this.patcherWaypoints[0]?.[0] < Date.now() - 60000) { + this.patcherWaypoints.shift() + } + }) } updateWaypointsHashes() { @@ -116,6 +141,9 @@ class Waypoints extends Feature { drawCoolWaypoint(waypoint.x, waypoint.y, waypoint.z, waypoint.r, waypoint.g, waypoint.b, waypoint.options) } } + for (let waypoint of this.patcherWaypoints) { + drawCoolWaypoint(waypoint[1], waypoint[2], waypoint[3], 0, 255, 0, { name: waypoint[4] }) + } } initVariables() { @@ -37,6 +37,7 @@ if (FileLib.read("soopyAddonsData", "deletesoopyv1please.txt") === "true") { } if (new File("./config/ChatTriggers/modules/SoopyV2UpdateButtonPatcher").exists()) { new Thread(() => { + Thread.sleep(2000) ChatLib.chat("&7Deleting SoopyV2UpdateButtonPatcher as its no longer needed") FileLib.deleteDirectory(new File("./config/ChatTriggers/modules/SoopyV2UpdateButtonPatcher")) }).start() diff --git a/metadata.json b/metadata.json index 7b105ea..797bfe8 100644 --- a/metadata.json +++ b/metadata.json @@ -5,8 +5,8 @@ "entry": "index.js", "description": "SoopyV2", "name": "SoopyV2", - "version": "2.1.67", - "versionId": 194, + "version": "2.1.68", + "versionId": 195, "requires": [ "soopyApis", "soopyAddonsData", |