Skip to content

Commit

Permalink
Added ignorelist
Browse files Browse the repository at this point in the history
  • Loading branch information
zhenga8533 committed Jan 1, 2024
1 parent 53adde5 commit b72b350
Show file tree
Hide file tree
Showing 11 changed files with 54 additions and 39 deletions.
3 changes: 2 additions & 1 deletion changelog.json
Original file line number Diff line number Diff line change
@@ -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"
Expand Down
2 changes: 1 addition & 1 deletion features/garden/FarmingWebhook.js
Original file line number Diff line number Diff line change
Expand Up @@ -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";


/**
Expand Down
2 changes: 1 addition & 1 deletion features/general/ChatWebhook.js
Original file line number Diff line number Diff line change
Expand Up @@ -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";


/**
Expand Down
Original file line number Diff line number Diff line change
@@ -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";


/**
Expand All @@ -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(' ');
Expand Down
13 changes: 13 additions & 0 deletions features/general/party/AutoKick.js
Original file line number Diff line number Diff line change
@@ -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);
Original file line number Diff line number Diff line change
@@ -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";


/**
Expand Down
Original file line number Diff line number Diff line change
@@ -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);
Expand Down
Original file line number Diff line number Diff line change
@@ -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";


/**
Expand Down
Original file line number Diff line number Diff line change
@@ -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";


/**
Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion features/mining/PowderTracker.js
Original file line number Diff line number Diff line change
Expand Up @@ -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";


/**
Expand Down
11 changes: 6 additions & 5 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand Down

0 comments on commit b72b350

Please sign in to comment.