From 8ba713bf6be685939621c583568843f3d0e55dce Mon Sep 17 00:00:00 2001 From: Allen Zheng Date: Sun, 31 Dec 2023 23:36:24 -0500 Subject: [PATCH] updated pesttp --- changelog.json | 2 +- docs/commands.md | 1 + features/farming/PestTracking.js | 9 ++++++++- index.js | 2 +- utils/settings.js | 2 +- 5 files changed, 12 insertions(+), 4 deletions(-) diff --git a/changelog.json b/changelog.json index 366d40da..d2ebeed2 100644 --- a/changelog.json +++ b/changelog.json @@ -1,7 +1,7 @@ [ "- Added ignorelist (renamed blacklist)", "- Added spamlist", - "- Added pest warp", + "- Added pest warp (`/pesttp`)", "- TODO: Added /va nw", "- Changed blacklist to auto kick", "- Changed warplist to dianalist", diff --git a/docs/commands.md b/docs/commands.md index 6112ecac..3a42d89c 100644 --- a/docs/commands.md +++ b/docs/commands.md @@ -31,6 +31,7 @@ subtitle: List of every non-gui related commands. - `/va attribute`: Various calculations that deal with attribute values. - `/va calc`: Various calculations that deal with general economical values. - **Misc** + - `/pestwarp`: Warps to plot with most pests. - `/va be`: Displays bestiary stats and closest milestones. - `/va splits`: Prints out Kuudra splits' stats. - `/sk`: Opens the SkyCrypt profile of inputted user. diff --git a/features/farming/PestTracking.js b/features/farming/PestTracking.js index e10f6753..ffadf8a1 100644 --- a/features/farming/PestTracking.js +++ b/features/farming/PestTracking.js @@ -1,4 +1,4 @@ -import { AQUA, BOLD, DARK_GRAY, DARK_GREEN, GOLD, GRAY, GREEN, RED, RESET, YELLOW } from "../../utils/constants"; +import { AQUA, BOLD, DARK_GRAY, DARK_GREEN, GOLD, GRAY, GREEN, LOGO, RED, RESET, YELLOW } from "../../utils/constants"; import { getSlotCoords, getTime } from "../../utils/functions"; import { Overlay } from "../../utils/overlay"; import settings from "../../utils/settings"; @@ -148,10 +148,17 @@ registerWhen(register("guiClosed", () => { * Pest warp command */ register("command", () => { + if (hive.length === 0) { + ChatLib.chat(`${LOGO + RED}No infested plots found...\n${DARK_GRAY}If there are pests, please open plots menu to track!`); + return; + } + + // Warp to plot with most pests const plot = hive[0]; delete swarm[plot]; ChatLib.command(`plottp ${plot}`); + setHive(); }).setName("pesttp"); diff --git a/index.js b/index.js index b40be7c5..293ef6d4 100644 --- a/index.js +++ b/index.js @@ -133,7 +133,7 @@ function getHelp() { ChatLib.chat(`${AQUA + BOLD}Lists: ${WHITE}/va ${GRAY}<${WHITE}cd, wl, bl, el, vl, dl, sl, il${GRAY}>`); ChatLib.chat(`${AQUA + BOLD}Economy: ${WHITE}/va ${GRAY}<${WHITE}calc, attribute${GRAY}>`); ChatLib.chat(`${AQUA + BOLD}Misc: ${WHITE}/va ${GRAY}<${WHITE}splits, be${GRAY}>`); - ChatLib.chat(`${AQUA + BOLD}Etc: ${WHITE}/sk\n`); + ChatLib.chat(`${AQUA + BOLD}Etc: ${WHITE}/\n`); // Feature Commands ChatLib.chat(`${DARK_AQUA + BOLD}GENERAL FEATURES:${RESET}`); diff --git a/utils/settings.js b/utils/settings.js index d8183fa9..eeae7aa4 100644 --- a/utils/settings.js +++ b/utils/settings.js @@ -205,7 +205,7 @@ Reset binds with ${AQUA}/resetBinds${GRAY}, save binds with ${AQUA}/saveBinds [k // --- Server --- @SliderProperty({ name: "Fairy Soul Waypoints", - description: `${DARK_RED}NEW! ${GRAY}Set distance at which Fairy Soul waypoints will render or as 0 to turn ${RED}OFF${GRAY}.`, + description: `Set distance at which Fairy Soul waypoints will render or as 0 to turn ${RED}OFF${GRAY}.`, category: "General", subcategory: "Server", min: 0,