aboutsummaryrefslogtreecommitdiff
path: root/features
diff options
context:
space:
mode:
Diffstat (limited to 'features')
-rw-r--r--features/events/index.js6
-rw-r--r--features/waypoints/index.js28
2 files changed, 34 insertions, 0 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() {