diff --git a/changelog.json b/changelog.json index 377260d8..a2e0a596 100644 --- a/changelog.json +++ b/changelog.json @@ -1,8 +1,9 @@ [ - "- Added ignorelist (swapped ignorelist and blacklist functionality)", + "- Added ignorelist (renamed blacklist)", "- Added spamlist", "- TODO: Added pest warp", "- TODO: Added /va nw", + "- Changed blacklist to auto kick", "- Changed warplist to dianalist", "- TODO: Recoded skill and powder? tracker", "- Changed valuelist to only register held item" diff --git a/features/garden/FarmingWebhook.js b/features/garden/FarmingWebhook.js index fcfe0036..37041068 100644 --- a/features/garden/FarmingWebhook.js +++ b/features/garden/FarmingWebhook.js @@ -4,7 +4,7 @@ import { formatNumber, getTime, unformatNumber } from "../../utils/functions"; import { registerWhen } from "../../utils/variables"; import { getWorld } from "../../utils/worlds"; import { getBazaar } from "../economy/Economy"; -import { getWaifu } from "../general/PartyCommands"; +import { getWaifu } from "../general/party/PartyCommands"; /** diff --git a/features/general/ChatWebhook.js b/features/general/ChatWebhook.js index d431bb78..0817fccb 100644 --- a/features/general/ChatWebhook.js +++ b/features/general/ChatWebhook.js @@ -3,7 +3,7 @@ import toggles from "../../utils/toggles"; import { request } from "../../../axios"; import { getGuildName, getPlayerName } from "../../utils/functions"; import { registerWhen } from "../../utils/variables"; -import { getWaifu } from "./PartyCommands"; +import { getWaifu } from "./party/PartyCommands"; /** diff --git a/features/general/AntiGhostParty.js b/features/general/party/AntiGhostParty.js similarity index 70% rename from features/general/AntiGhostParty.js rename to features/general/party/AntiGhostParty.js index 0c308130..bf106f03 100644 --- a/features/general/AntiGhostParty.js +++ b/features/general/party/AntiGhostParty.js @@ -1,8 +1,8 @@ -import settings from "../../utils/settings"; -import { getInParty } from "../../utils/party"; -import { delay } from "../../utils/thread"; -import { registerWhen } from "../../utils/variables"; -import { GREEN, LOGO } from "../../utils/constants"; +import settings from "../../../utils/settings"; +import { getInParty } from "../../../utils/party"; +import { delay } from "../../../utils/thread"; +import { registerWhen } from "../../../utils/variables"; +import { GREEN, LOGO } from "../../../utils/constants"; /** @@ -11,7 +11,7 @@ import { GREEN, LOGO } from "../../utils/constants"; * @param {string} message - The chat message to be intercepted and redirected. * @param {object} event - The event object representing the chat message event. */ -const partyCommands = new Set(["accept", "join"]); +const partyCommands = new Set(["accept", "join", "kick", "promote", "demote"]); let cd = false; registerWhen(register("messageSent", (message, event) => { const args = message.split(' '); diff --git a/features/general/party/AutoKick.js b/features/general/party/AutoKick.js new file mode 100644 index 00000000..fcfaf953 --- /dev/null +++ b/features/general/party/AutoKick.js @@ -0,0 +1,13 @@ +import { getPlayerName } from "../../../utils/functions"; +import { delay } from "../../../utils/thread"; +import { data, registerWhen } from "../../../utils/variables"; + + +registerWhen(register("chat", (player) => { + player = getPlayerName(player).toLowerCase(); + if (data.blacklist.find(name => { + name === player; + }) === undefined) return; + + delay(() => ChatLib.command(`p kick ${player}`)); +}).setCriteria("${player} joined the party."), () => data.blacklist.length !== 0); \ No newline at end of file diff --git a/features/general/AutoTransfer.js b/features/general/party/AutoTransfer.js similarity index 85% rename from features/general/AutoTransfer.js rename to features/general/party/AutoTransfer.js index f65b5200..66b7c6d0 100644 --- a/features/general/AutoTransfer.js +++ b/features/general/party/AutoTransfer.js @@ -1,9 +1,9 @@ -import settings from "../../utils/settings"; -import { getPlayerName } from "../../utils/functions"; -import { delay } from "../../utils/thread"; -import { registerWhen } from "../../utils/variables"; -import { getWorld } from "../../utils/worlds"; -import { getInParty, getIsLeader, getParty } from "../../utils/party"; +import settings from "../../../utils/settings"; +import { getPlayerName } from "../../../utils/functions"; +import { delay } from "../../../utils/thread"; +import { registerWhen } from "../../../utils/variables"; +import { getWorld } from "../../../utils/worlds"; +import { getInParty, getIsLeader, getParty } from "../../../utils/party"; /** diff --git a/features/general/JoinMessage.js b/features/general/party/JoinMessage.js similarity index 71% rename from features/general/JoinMessage.js rename to features/general/party/JoinMessage.js index 283b8969..821a2402 100644 --- a/features/general/JoinMessage.js +++ b/features/general/party/JoinMessage.js @@ -1,6 +1,6 @@ -import settings from "../../utils/settings"; -import { delay } from "../../utils/thread"; -import { registerWhen } from "../../utils/variables"; +import settings from "../../../utils/settings"; +import { delay } from "../../../utils/thread"; +import { registerWhen } from "../../../utils/variables"; registerWhen(register("chat", () => { delay(() => ChatLib.command(`pc ${settings.partyMessage}`), 100); diff --git a/features/general/JoinParty.js b/features/general/party/JoinParty.js similarity index 89% rename from features/general/JoinParty.js rename to features/general/party/JoinParty.js index 34b38c3a..18aa6271 100644 --- a/features/general/JoinParty.js +++ b/features/general/party/JoinParty.js @@ -1,7 +1,7 @@ -import settings from "../../utils/settings"; -import { getPlayerName } from "../../utils/functions"; -import { delay } from "../../utils/thread"; -import { data, registerWhen } from "../../utils/variables"; +import settings from "../../../utils/settings"; +import { getPlayerName } from "../../../utils/functions"; +import { delay } from "../../../utils/thread"; +import { data, registerWhen } from "../../../utils/variables"; /** diff --git a/features/general/PartyCommands.js b/features/general/party/PartyCommands.js similarity index 95% rename from features/general/PartyCommands.js rename to features/general/party/PartyCommands.js index ff57e280..92d935f0 100644 --- a/features/general/PartyCommands.js +++ b/features/general/party/PartyCommands.js @@ -1,13 +1,13 @@ -import axios from "../../../axios"; -import settings from "../../utils/settings"; -import toggles from "../../utils/toggles"; -import { request } from "../../../requestV2"; -import { AQUA, DARK_AQUA, DARK_GREEN, GRAY, GREEN, LOGO, RED, WHITE } from "../../utils/constants"; -import { getGuildName, getPlayerName } from "../../utils/functions"; -import { getIsLeader } from "../../utils/party"; -import { delay } from "../../utils/thread"; -import { data, registerWhen } from "../../utils/variables"; -import { getPing, getTPS } from "./Performance"; +import axios from "../../../../axios"; +import settings from "../../../utils/settings"; +import toggles from "../../../utils/toggles"; +import { request } from "../../../../requestV2"; +import { AQUA, DARK_AQUA, DARK_GREEN, GRAY, GREEN, LOGO, RED, WHITE } from "../../../utils/constants"; +import { getGuildName, getPlayerName } from "../../../utils/functions"; +import { getIsLeader } from "../../../utils/party"; +import { delay } from "../../../utils/thread"; +import { data, registerWhen } from "../../../utils/variables"; +import { getPing, getTPS } from "../Performance"; /** @@ -83,7 +83,7 @@ setWaifu(false); * @param {string} sendTo - Chat to send response to (/pc, /gc, /r) */ export function executeCommand(name, args, sendTo) { - if (data.blacklist.includes(name.toLowerCase())) return; + if (data.ignorelist.includes(name.toLowerCase())) return; const command = args[0].toLowerCase(); // PARTY COMMANDS diff --git a/features/mining/PowderTracker.js b/features/mining/PowderTracker.js index dc196089..f2b21976 100644 --- a/features/mining/PowderTracker.js +++ b/features/mining/PowderTracker.js @@ -5,7 +5,7 @@ import { commafy, getTime } from "../../utils/functions"; import { Overlay } from "../../utils/overlay"; import { Stat, data, getPaused, registerWhen } from "../../utils/variables"; import { getWorld } from "../../utils/worlds"; -import { getWaifu } from "../general/PartyCommands"; +import { getWaifu } from "../general/party/PartyCommands"; /** diff --git a/index.js b/index.js index a205e28e..b70dd871 100644 --- a/index.js +++ b/index.js @@ -17,18 +17,19 @@ for (const key in settings) if (CHANGED_SETTINGS.has(key) && typeof settings[key if (typeof settings.partyCommands !== "boolean") settings.partyCommands = false; // General Features -import "./features/general/AntiGhostParty"; +import "./features/general/party/AntiGhostParty"; +import "./features/general/party/AutoKick"; +import "./features/general/party/JoinMessage"; +import "./features/general/party/JoinParty"; +import { executeCommand } from "./features/general/party/PartyCommands"; import "./features/general/ArmorDisplay"; import "./features/general/Autocorrect"; -import "./features/general/AutoTransfer"; +import "./features/general/party/AutoTransfer"; import "./features/general/ChangeMessage"; import "./features/general/ChatWebhook"; import "./features/general/Cooldowns"; import "./features/general/FairySouls"; import "./features/general/ImageViewer"; -import "./features/general/JoinMessage"; -import "./features/general/JoinParty"; -import { executeCommand } from "./features/general/PartyCommands"; import { getStatus } from "./features/general/Performance"; import "./features/general/ReminderTimer"; import "./features/general/RemoveSelfie";