Skip to content

Commit

Permalink
Merge branch 'bso' of https://github.com/oldschoolgg/oldschoolbot int…
Browse files Browse the repository at this point in the history
…o bso-wildy-slayer
  • Loading branch information
TastyPumPum committed May 28, 2024
2 parents 5754c44 + 15fd4b2 commit 378c002
Show file tree
Hide file tree
Showing 10 changed files with 108 additions and 85 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
"murmurhash": "^2.0.1",
"node-cron": "^3.0.3",
"node-fetch": "^2.6.7",
"oldschooljs": "^2.5.1",
"oldschooljs": "^2.5.4",
"p-queue": "^6.6.2",
"piscina": "^4.4.0",
"random-js": "^2.1.0",
Expand Down
32 changes: 31 additions & 1 deletion src/lib/data/Collections.ts
Original file line number Diff line number Diff line change
Expand Up @@ -920,7 +920,37 @@ export const allCollectionLogs: ICollection = {
Default: async (_, __, { openableScores }) => openableScores.amount(73_124)
},
items: resolveItems([
...ElderClueTable.allItems,
'Lord marshal boots',
'Lord marshal gloves',
'Lord marshal trousers',
'Lord marshal top',
'Lord marshal cap',
'Akumu mask',
'Commander boots',
'Commander gloves',
'Commander trousers',
'Commander top',
'Commander cap',
'Apple parasol',
'Watermelon parasol',
'Lemon parasol',
'Strawberry parasol',
'Blueberry parasol',
'Grape parasol',
'Coconut parasol',
'Detective hat',
'Detective trenchcoat',
'Detective pants',
'2nd age range legs',
'2nd age range top',
'2nd age range coif',
'2nd age bow',
'2nd age mage top',
'2nd age mage bottom',
'2nd age mage mask',
'2nd age staff',
'First age robe top',
'First age robe bottom',
'Clue bag',
'Inventors tools',
'Elder knowledge',
Expand Down
4 changes: 2 additions & 2 deletions src/lib/data/buyables/buyables.ts
Original file line number Diff line number Diff line change
Expand Up @@ -816,7 +816,7 @@ const Buyables: Buyable[] = [
name: 'Feather',
aliases: ['feather'],
gpCost: 50,
ironmanPrice: 2
ironmanPrice: 3
},
{
name: 'Shield right half',
Expand Down Expand Up @@ -1227,7 +1227,7 @@ for (const cape of allTeamCapes) {
Buyables.push({
name: cape.name,
outputItems: new Bank().add(cape.id),
gpCost: 15_000
gpCost: 20_000
});
}

Expand Down
11 changes: 9 additions & 2 deletions src/mahoji/commands/ge.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,14 @@ import { PerkTier } from '../../lib/constants';
import { createGECancelButton, GrandExchange } from '../../lib/grandExchange';
import { marketPricemap } from '../../lib/marketPrices';
import { prisma } from '../../lib/settings/prisma';
import { formatDuration, itemNameFromID, makeComponents, returnStringOrFile, toKMB } from '../../lib/util';
import {
formatDuration,
isGEUntradeable,
itemNameFromID,
makeComponents,
returnStringOrFile,
toKMB
} from '../../lib/util';
import { lineChart } from '../../lib/util/chart';
import getOSItem from '../../lib/util/getOSItem';
import { handleMahojiConfirmation } from '../../lib/util/handleMahojiConfirmation';
Expand Down Expand Up @@ -131,7 +138,7 @@ export const geCommand: OSBMahojiCommand = {
description: 'Sell something on the grand exchange.',
options: [
{
...ownedItemOption(item => Boolean(item.tradeable_on_ge)),
...ownedItemOption(item => !isGEUntradeable(item.id)),
name: 'item',
description: 'The item you want to sell.',
required: true
Expand Down
2 changes: 1 addition & 1 deletion src/tasks/minions/bso/turaelsTrialsActivity.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ export const turaelsTrialsTask: MinionTask = {
return handleTripFinish(
user,
channelID,
`${user}, your minion finished slaying ${quantity}x superiors in Turaels Trials. **Your KC is: __${newScore}__**. ${xpResults.join(
`${user}, your minion finished slaying ${quantity}x superiors in Turaels Trials.\n**Your Turaels Trials KC is now ${newScore}**.\n\n${xpResults.join(
', '
)}`,
undefined,
Expand Down
12 changes: 6 additions & 6 deletions tests/integration/commands/sacrifice.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,28 +18,28 @@ describe('Sacrifice Command', async () => {
expect(result).toEqual(
`${Emoji.Incinerator} **Your Sacrifice Stats** ${Emoji.Incinerator}\n\n` +
`**Current Minion Icon:** ${Emoji.Minion}\n` +
'**Sacrificed Value:** 1,909 GP\n' +
'**Sacrificed Value:** 1,590 GP\n' +
'**Unique Items Sacrificed:** 2 items'
);
});

test('No items provided', async () => {
const result = await user.runCommand(sacrificeCommand, { items: 'aaaa' });
expect(result).toEqual('No items were provided.\nYour current sacrificed value is: 1,909 (1.91k)');
expect(result).toEqual('No items were provided.\nYour current sacrificed value is: 1,590 (1.59k)');
});

test('Successful', async () => {
await user.addItemsToBank({ items: new Bank().add('Trout').add('Coal', 10) });
const result = await user.runCommand(sacrificeCommand, { items: '1 trout, 10 coal' });
expect(result).toEqual(
'You sacrificed 10x Coal, 1x Trout, with a value of 1,909gp (1.91k). Your total amount sacrificed is now: 3,818. '
'You sacrificed 10x Coal, 1x Trout, with a value of 1,590gp (1.59k). Your total amount sacrificed is now: 3,180. '
);
const stats = await user.fetchStats({ sacrificed_bank: true });
expect(user.bank.equals(new Bank())).toBe(true);
expect(new Bank(stats.sacrificed_bank as ItemBank).equals(new Bank().add('Coal', 20).add('Trout', 2))).toBe(
true
);
expect(user.user.sacrificedValue).toEqual(BigInt(3818));
expect(user.user.sacrificedValue).toEqual(BigInt(3180));
const clientSettings = await mahojiClientSettingsFetch({ economyStats_sacrificedBank: true });
expect(
new Bank(clientSettings.economyStats_sacrificedBank as ItemBank).equals(
Expand All @@ -49,15 +49,15 @@ describe('Sacrifice Command', async () => {
await user.addItemsToBank({ items: new Bank().add('Trout').add('Cake') });
const res = await user.runCommand(sacrificeCommand, { items: '1 trout, 1 cake' });
expect(res).toEqual(
'You sacrificed 1x Trout, 1x Cake, with a value of 156gp (156). Your total amount sacrificed is now: 3,974. '
'You sacrificed 1x Trout, 1x Cake, with a value of 257gp (257). Your total amount sacrificed is now: 3,437. '
);
await user.sync();
expect(user.bank.equals(new Bank())).toBe(true);
const stats2 = await user.fetchStats({ sacrificed_bank: true });
expect(
new Bank(stats2.sacrificed_bank as ItemBank).equals(new Bank().add('Coal', 20).add('Trout', 3).add('Cake'))
).toBe(true);
expect(user.user.sacrificedValue).toEqual(BigInt(3974));
expect(user.user.sacrificedValue).toEqual(BigInt(3437));

const clientSettings2 = await mahojiClientSettingsFetch({ economyStats_sacrificedBank: true });
expect(
Expand Down
4 changes: 2 additions & 2 deletions tests/unit/images.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ describe('Images', () => {
expect(result.files[0].attachment).toMatchImageSnapshot();
});

test('Collection Log', async () => {
test.skip('Collection Log', async () => {
const result: any = await clImageGenerator.generateLogImage({
user: mockMUser({ cl: new Bank().add('Harmonised orb') }),
collection: 'nightmare',
Expand All @@ -52,7 +52,7 @@ describe('Images', () => {
expect(result.files[0].attachment).toMatchImageSnapshot();
});

test('Bank Image', async () => {
test.skip('Bank Image', async () => {
let bank = new Bank();
for (const item of [...Monsters.Cow.allItems]) {
bank.add(item);
Expand Down
Loading

0 comments on commit 378c002

Please sign in to comment.