Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add toggle to Auto Slay Button #5634

Merged
merged 3 commits into from
Feb 2, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion src/lib/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@

export const Channel = {
General: DISCORD_SETTINGS.Channels?.General ?? '342983479501389826',
Notifications: production ? '469523207691436042' : '1042760447830536212',

Check warning on line 27 in src/lib/constants.ts

View workflow job for this annotation

GitHub Actions / ESLint

Unexpected any value in conditional. An explicit comparison or type cast is required
GrandExchange: DISCORD_SETTINGS.Channels?.GrandExchange ?? '682996313209831435',
Developers: DISCORD_SETTINGS.Channels?.Developers ?? '648196527294251020',
BlacklistLogs: DISCORD_SETTINGS.Channels?.BlacklistLogs ?? '782459317218967602',
Expand All @@ -34,13 +34,13 @@
TestingMain: TestingMainChannelID,
BarbarianAssault: DISCORD_SETTINGS.Channels?.BarbarianAssault ?? '789717054902763520',
ChambersOfXeric: DISCORD_SETTINGS.Channels?.ChambersOfXeric ?? '835876917252587581',
BotLogs: production ? '1051725977320964197' : TestingMainChannelID,

Check warning on line 37 in src/lib/constants.ts

View workflow job for this annotation

GitHub Actions / ESLint

Unexpected any value in conditional. An explicit comparison or type cast is required
GeneralChannel:
BOT_TYPE === 'OSB'
? production

Check warning on line 40 in src/lib/constants.ts

View workflow job for this annotation

GitHub Actions / ESLint

Unexpected any value in conditional. An explicit comparison or type cast is required
? '346304390858145792'
: '1154056119019393035'
: production

Check warning on line 43 in src/lib/constants.ts

View workflow job for this annotation

GitHub Actions / ESLint

Unexpected any value in conditional. An explicit comparison or type cast is required
? '792691343284764693'
: '1154056119019393035'
};
Expand Down Expand Up @@ -68,7 +68,7 @@
TopGlobalCL: '1072426869028294747'
};

export const enum Emoji {

Check warning on line 71 in src/lib/constants.ts

View workflow job for this annotation

GitHub Actions / ESLint

'Emoji' is already declared in the upper scope on line 71 column 19
MoneyBag = '<:MoneyBag:493286312854683654>',
OSBot = '<:OSBot:601768469905801226>',
Joy = '😂',
Expand Down Expand Up @@ -170,14 +170,14 @@
BronzeTrophy = '<:BronzeTrophy:1152881057788592188>'
}

export enum ActivityGroup {

Check warning on line 173 in src/lib/constants.ts

View workflow job for this annotation

GitHub Actions / ESLint

'ActivityGroup' is already declared in the upper scope on line 173 column 13
Skilling = 'Skilling',
Clue = 'Clue',
Monster = 'Monster',
Minigame = 'Minigame'
}

export const enum Events {

Check warning on line 180 in src/lib/constants.ts

View workflow job for this annotation

GitHub Actions / ESLint

'Events' is already declared in the upper scope on line 180 column 19
Error = 'error',
Log = 'log',
Verbose = 'verbose',
Expand All @@ -190,7 +190,7 @@

export const COINS_ID = 995;

export const enum PerkTier {

Check warning on line 193 in src/lib/constants.ts

View workflow job for this annotation

GitHub Actions / ESLint

'PerkTier' is already declared in the upper scope on line 193 column 19
/**
* Boosters
*/
Expand Down Expand Up @@ -221,7 +221,7 @@
Seven = 7
}

export enum BitField {

Check warning on line 224 in src/lib/constants.ts

View workflow job for this annotation

GitHub Actions / ESLint

'BitField' is already declared in the upper scope on line 224 column 13
IsPatronTier1 = 2,
IsPatronTier2 = 3,
IsPatronTier3 = 4,
Expand Down Expand Up @@ -258,7 +258,8 @@
UsedFrozenTablet = 34,
CleanHerbsFarming = 35,
SelfGamblingLocked = 36,
DisabledFarmingReminders = 37
DisabledFarmingReminders = 37,
DisableAutoSlayButton = 38
TastyPumPum marked this conversation as resolved.
Show resolved Hide resolved
}

interface BitFieldData {
Expand Down Expand Up @@ -318,6 +319,11 @@
protected: false,
userConfigurable: true
},
[BitField.DisableAutoSlayButton]: {
name: 'Disable Auto Slay Button',
protected: false,
userConfigurable: true
},
[BitField.DisableAshSanctifier]: { name: 'Disable Ash Sanctifier', protected: false, userConfigurable: true },
[BitField.DisableAutoFarmContractButton]: {
name: 'Disable Auto Farm Contract Button',
Expand All @@ -341,7 +347,7 @@
}
} as const;

export const enum PatronTierID {

Check warning on line 350 in src/lib/constants.ts

View workflow job for this annotation

GitHub Actions / ESLint

'PatronTierID' is already declared in the upper scope on line 350 column 19
One = '4608201',
Two = '4608226',
Three = '4720356',
Expand Down
2 changes: 1 addition & 1 deletion src/lib/util/handleTripFinish.ts
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ export async function handleTripFinish(
['MonsterKilling', 'Inferno', 'FightCaves'].includes(data.type)
) {
components.push(makeNewSlayerTaskButton());
} else {
} else if (!user.bitfield.includes(BitField.DisableAutoSlayButton)) {
components.push(makeAutoSlayButton());
}
if (loot?.has('Seed pack')) {
Expand Down
4 changes: 4 additions & 0 deletions src/mahoji/commands/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,10 @@ const toggles: UserConfigToggle[] = [
name: 'Disable Birdhouse Run Button',
bit: BitField.DisableBirdhouseRunButton
},
{
name: 'Disable Auto Slay Button',
bit: BitField.DisableAutoSlayButton
},
{
name: 'Disable Ash Sanctifier',
bit: BitField.DisableAshSanctifier
Expand Down
2 changes: 1 addition & 1 deletion src/mahoji/lib/abstracted_commands/minionStatusCommand.ts
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ export async function minionStatusCommand(user: MUser): Promise<BaseMessageOptio
);
}

if (!minionIsBusy) {
if (!minionIsBusy && !user.bitfield.includes(BitField.DisableAutoSlayButton)) {
buttons.push(makeAutoSlayButton());
}

Expand Down
Loading