aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSoopyboo32 <49228220+Soopyboo32@users.noreply.github.com>2022-06-05 10:47:22 +0800
committerSoopyboo32 <49228220+Soopyboo32@users.noreply.github.com>2022-06-05 10:47:22 +0800
commitf29594f1c6407cdf782ea5d4510e23567b013a00 (patch)
tree209d82d1dc94789418b0a133e6903bd9dc33c394
parentbc3e2d89ee5ecaf598aa7f7bc862cf29b852671e (diff)
downloadSoopyV2-f29594f1c6407cdf782ea5d4510e23567b013a00.tar.gz
SoopyV2-f29594f1c6407cdf782ea5d4510e23567b013a00.tar.bz2
SoopyV2-f29594f1c6407cdf782ea5d4510e23567b013a00.zip
+ metal detector waypoints
-rw-r--r--features/dungeonRoutes/index.js27
-rw-r--r--features/dungeonRoutes/metadata.json8
-rw-r--r--features/hud/index.js10
-rw-r--r--features/mining/coords.json202
-rw-r--r--features/mining/index.js97
-rw-r--r--utils/renderUtils.js2
6 files changed, 343 insertions, 3 deletions
diff --git a/features/dungeonRoutes/index.js b/features/dungeonRoutes/index.js
new file mode 100644
index 0000000..9cfbd88
--- /dev/null
+++ b/features/dungeonRoutes/index.js
@@ -0,0 +1,27 @@
+/// <reference types="../../../CTAutocomplete" />
+/// <reference lib="es2015" />
+import Feature from "../../featureClass/class";
+import SettingBase from "../settings/settingThings/settingBase";
+
+
+class DungeonRoutes extends Feature {
+ constructor() {
+ super()
+ }
+
+ onEnable() {
+ if (Player.getUUID().toString() !== "dc8c3964-7b29-4e03-ae9e-d13ebd65dd29") {
+ new SettingBase("Coming soontm", "maby", undefined, "coming_soontm", this)
+ return
+ }
+ }
+
+ onDisable() {
+
+ }
+
+}
+
+module.exports = {
+ class: new DungeonRoutes()
+}
diff --git a/features/dungeonRoutes/metadata.json b/features/dungeonRoutes/metadata.json
new file mode 100644
index 0000000..783bdd8
--- /dev/null
+++ b/features/dungeonRoutes/metadata.json
@@ -0,0 +1,8 @@
+{
+ "name": "Dungeon Routes",
+ "description": "Routes for dungeons (Coming soontm maby)",
+ "isHidden": true,
+ "isTogglable": true,
+ "defaultEnabled": true,
+ "sortA": 0
+} \ No newline at end of file
diff --git a/features/hud/index.js b/features/hud/index.js
index 5425f1f..11c2554 100644
--- a/features/hud/index.js
+++ b/features/hud/index.js
@@ -146,7 +146,9 @@ class Hud extends Feature {
.setText("&6Day&7> &fLoading...")
.setToggleSetting(this.showLobbyDay)
.setLocationSetting(new LocationSetting("Lobby Day Location", "Allows you to edit the location of the lobby day", "lobby_day_location", this, [10, 90, 1, 1])
- .requires(this.showLobbyDay))
+ .requires(this.showLobbyDay)
+ .editTempText("&6Day&7> &f5.15"))
+ this.showLobbyDayOnlyUnder30 = new ToggleSetting("Show Current Lobby Day ONLY WHEN under day 30", "", true, "lobby_day_30", this)
this.hudElements.push(this.lobbyDayElement)
let hudStatTypes = {
@@ -304,7 +306,11 @@ class Hud extends Feature {
}
step_1second() {
- if (World.getTime() !== 0) this.lobbyDayElement.setText("&6Day&7> &f" + (World.getTime() / 20 / 60 / 20).toFixed(2))
+ if (World.getTime() / 20 / 60 / 20 > 30 && this.showLobbyDayOnlyUnder30.getValue()) {
+ this.lobbyDayElement.setText("")
+ } else {
+ if (World.getTime() !== 0) this.lobbyDayElement.setText("&6Day&7> &f" + (World.getTime() / 20 / 60 / 20).toFixed(2))
+ }
if (!this.lagEnabled.getValue()) {
if (this.packetReceived) this.packetReceived.unregister()
diff --git a/features/mining/coords.json b/features/mining/coords.json
new file mode 100644
index 0000000..246731b
--- /dev/null
+++ b/features/mining/coords.json
@@ -0,0 +1,202 @@
+[
+ [
+ -7,
+ 26,
+ -2
+ ],
+ [
+ -15,
+ 26,
+ 31
+ ],
+ [
+ -17,
+ 26,
+ 19
+ ],
+ [
+ 47,
+ 25,
+ 33
+ ],
+ [
+ 36,
+ 26,
+ 45
+ ],
+ [
+ 48,
+ 27,
+ 45
+ ],
+ [
+ 45,
+ 27,
+ -13
+ ],
+ [
+ -38,
+ 26,
+ 21
+ ],
+ [
+ 42,
+ 26,
+ 27
+ ],
+ [
+ 29,
+ 27,
+ -7
+ ],
+ [
+ 22,
+ 26,
+ -15
+ ],
+ [
+ -7,
+ 27,
+ -26
+ ],
+ [
+ -2,
+ 26,
+ -6
+ ],
+ [
+ 43,
+ 27,
+ -21
+ ],
+ [
+ 10,
+ 26,
+ -11
+ ],
+ [
+ 17,
+ 26,
+ 49
+ ],
+ [
+ 19,
+ 26,
+ -17
+ ],
+ [
+ -35,
+ 27,
+ 35
+ ],
+ [
+ 25,
+ 27,
+ 5
+ ],
+ [
+ -37,
+ 24,
+ 46
+ ],
+ [
+ -24,
+ 26,
+ 49
+ ],
+ [
+ -7,
+ 26,
+ 48
+ ],
+ [
+ -14,
+ 27,
+ -24
+ ],
+ [
+ -18,
+ 27,
+ 44
+ ],
+ [
+ -1,
+ 26,
+ -23
+ ],
+ [
+ 41,
+ 25,
+ -37
+ ],
+ [
+ 19,
+ 26,
+ -38
+ ],
+ [
+ -7,
+ 27,
+ 27
+ ],
+ [
+ 42,
+ 26,
+ 19
+ ],
+ [
+ 42,
+ 26,
+ 19
+ ],
+ [
+ -33,
+ 27,
+ 31
+ ],
+ [
+ 6,
+ 27,
+ 25
+ ],
+ [
+ -2,
+ 26,
+ -17
+ ],
+ [
+ -15,
+ 27,
+ 5
+ ],
+ [
+ -20,
+ 27,
+ -12
+ ],
+ [
+ -25,
+ 26,
+ 30
+ ],
+ [
+ 28,
+ 27,
+ -35
+ ],
+ [
+ -19,
+ 27,
+ -22
+ ],
+ [
+ 4,
+ 26,
+ -15
+ ],
+ [
+ 36,
+ 26,
+ 17
+ ]
+] \ No newline at end of file
diff --git a/features/mining/index.js b/features/mining/index.js
index 7b0c520..644a100 100644
--- a/features/mining/index.js
+++ b/features/mining/index.js
@@ -10,6 +10,7 @@ import ToggleSetting from "../settings/settingThings/toggle";
import { numberWithCommas, timeSince2 } from "../../utils/numberUtils";
import { fetch } from "../../utils/networkUtils";
import socketConnection from "../../socketConnection";
+import { drawCoolWaypoint } from "../../utils/renderUtils";
class Mining extends Feature {
constructor() {
@@ -66,6 +67,9 @@ class Mining extends Feature {
.editTempText("&6Event&7> &fGONE WITH THE WIND &7->&f 2X POWDER"))
this.hudElements.push(this.nextChEventElement)
+
+ this.metalDetectorSolver = new ToggleSetting("Metal detector solver", "", true, "metal_detector_solver", this)
+
this.seenBalDamages = []
this.balHP = 250
this.lastBalAlive = 0
@@ -169,6 +173,95 @@ class Mining extends Feature {
socketConnection.sendCHEventData(event.trim(), true)
})
+
+ this.chestCoords = JSON.parse(FileLib.read("SoopyV2", "features/mining/coords.json"))
+
+ let lastLoc = [0, 0, 0]
+
+ this.baseCoordinates = undefined
+
+ this.lastSearchedForBase = 0
+
+ this.predictedChestLocations = []
+
+ let ignoreLocation = undefined
+
+ let registerActionBar = this.registerCustom("actionbar", (dist) => {
+ if (!this.metalDetectorSolver.getValue()) return
+ let distance = parseFloat(dist)
+ if (!this.baseCoordinates) this.findBaseCoordinates();
+
+ if (lastLoc[0] !== Player.getX() || lastLoc[1] !== Player.getY() || lastLoc[2] !== Player.getZ()) {
+ lastLoc = [Player.getX(), Player.getY(), Player.getZ()]
+ return
+ }
+
+ let lastLocation = this.predictedChestLocations[0]
+
+ this.predictedChestLocations = []
+
+ this.chestCoords.forEach((coordinates) => {
+ let currentDistance = Math.hypot(Player.getX() - (this.baseCoordinates[0] - coordinates[0]), Player.getY() - (this.baseCoordinates[1] - coordinates[1] + 1), Player.getZ() - (this.baseCoordinates[2] - coordinates[2]))
+
+ if (Math.round(currentDistance * 10) / 10 === distance) {
+
+ if ([this.baseCoordinates[0] - coordinates[0], this.baseCoordinates[1] - coordinates[1], this.baseCoordinates[2] - coordinates[2]].join(",") === ignoreLocation) {
+ ignoreLocation = undefined
+ return
+ }
+
+ this.predictedChestLocations.push([this.baseCoordinates[0] - coordinates[0], this.baseCoordinates[1] - coordinates[1], this.baseCoordinates[2] - coordinates[2]])
+ }
+ });
+ })
+ registerActionBar.trigger.setCriteria('TREASURE: ${rest}').setParameter('contains');
+
+ this.registerChat("&r&aYou found${*}with your &r&cMetal Detector&r&a!&r", () => {
+ if (this.predictedChestLocations[0]) ignoreLocation = this.predictedChestLocations[0].join(",")
+ this.predictedChestLocations = []
+ })
+ }
+
+ findBaseCoordinates() {
+ if (Date.now() - this.lastSearchedForBase < 15000) return;
+ let x = ~~Player.getX();
+ let y = ~~Player.getY();
+ let z = ~~Player.getZ();
+ for (let i = x - 50; i < x + 50; i++) {
+ for (let j = y + 30; j >= y - 30; j--) {
+ for (let k = z - 50; k < z + 50; k++) {
+ if (World.getBlockAt(i, j, k).getType().getID() === 156 && World.getBlockAt(i, j + 13, k).getType().getID() === 166) {
+ this.baseCoordinates = this.getBaseCoordinates(i, j + 13, k);
+ return;
+ }
+ }
+ }
+ }
+ this.lastSearchedForBase = Date.now();
+ }
+
+ getBaseCoordinates(x, y, z) {
+ let loop = true;
+ let posX = x;
+ let posY = y;
+ let posZ = z;
+ if (World.getBlockAt(x, y, z).getType().getID() !== 166) return [x, y, z];
+ while (loop) {
+ loop = false;
+ if (World.getBlockAt(posX + 1, posY, posZ).getType().getID() == 166) {
+ posX++;
+ loop = true;
+ }
+ if (World.getBlockAt(posX, posY - 1, posZ).getType().getID() == 166) {
+ posY--;
+ loop = true;
+ }
+ if (World.getBlockAt(posX, posY, posZ + 1).getType().getID() == 166) {
+ posZ++;
+ loop = true;
+ }
+ }
+ return [posX, posY, posZ];
}
itemTooltipEvent(lore, item, event) {
@@ -235,6 +328,10 @@ class Mining extends Feature {
if (this.guessBalHp.getValue()) {
if (this.balEntity) Tessellator.drawString(this.balHP + "/250", this.balEntity.getX(), this.balEntity.getY() + 12, this.balEntity.getZ())
}
+ if (!this.metalDetectorSolver.getValue()) return
+ this.predictedChestLocations.forEach(loc => {
+ drawCoolWaypoint(loc[0], loc[1], loc[2], 0, 255, 0, { name: "TREASURE", phase: true })
+ })
}
tick() {
diff --git a/utils/renderUtils.js b/utils/renderUtils.js
index 00b1c41..6ddb143 100644
--- a/utils/renderUtils.js
+++ b/utils/renderUtils.js
@@ -342,7 +342,7 @@ let ret = {
ret[phase ? "drawBoxAtBlock" : "drawBoxAtBlockNotVisThruWalls"](x - 0.005, y - 0.005, z - 0.005, r, g, b, 1.01, 1.01, alpha)
ret.drawFilledBox(x + 0.5, y, z + 0.5, 1.02, 1.01, r, g, b, 0.25 * alpha, phase)
- renderBeaconBeam2(x, y + 1, z, r, g, b, Math.min(1, Math.max(0, (distToPlayerSq - 25) / 100)) * alpha, true)
+ renderBeaconBeam2(x, y + 1, z, r, g, b, Math.min(1, Math.max(0, (distToPlayerSq - 25) / 100)) * alpha, !phase)
if (name || showDist) {
let distToPlayer = Math.sqrt(distToPlayerSq)