Skip to content

Commit

Permalink
Merge branch 'master' into wildy-slayer-cave-table
Browse files Browse the repository at this point in the history
  • Loading branch information
gc authored Feb 21, 2024
2 parents 9ceea55 + 4fc6bd4 commit db68229
Show file tree
Hide file tree
Showing 10 changed files with 6,528 additions and 3,364 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "oldschooljs",
"version": "2.3.64",
"version": "2.3.8",
"description": "Allows you to interact with the OSRS Hiscores, Wiki, Worlds, Items, News & more.",
"main": "dist/index.js",
"types": "dist/index.d.ts",
Expand Down
11 changes: 8 additions & 3 deletions scripts/prepareItems.ts
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,7 @@ export default async function prepareItems(): Promise<void> {

const allPrices = await fetch('https://prices.runescape.wiki/api/v1/osrs/latest', {
headers: {
'User-Agent': 'oldschooljs - @Magnaboy#7556'
'User-Agent': 'oldschooljs - @magnaboy'
}
})
.then((res): Promise<any> => res.json())
Expand Down Expand Up @@ -358,7 +358,6 @@ export default async function prepareItems(): Promise<void> {
if (item.name !== previousItem.name) {
messages.push(`WARNING: name changed from ${previousItem.name} to ${item.name}`);
}
item.price = previousItem.price;
if (item.equipment?.slot !== previousItem.equipment?.slot) {
messages.push(`WARNING: ${previousItem.name} slot changed`);
}
Expand All @@ -372,12 +371,18 @@ export default async function prepareItems(): Promise<void> {
item.equipable = copyItem.equipable;
}
if (previousItem) {
item.price = previousItem.price;
item.cost = previousItem.cost;
item.lowalch = previousItem.lowalch;
item.highalch = previousItem.highalch;
item.wiki_url = previousItem.wiki_url;
item.wiki_name = previousItem.wiki_name;
item.release_date = previousItem.release_date;
if (previousItem.equipment?.requirements) {
item.equipment = {
...item.equipment,
requirements: previousItem.equipment.requirements
};
}
}
if (previousItem) {
if (item.equipment?.requirements === null && previousItem.equipment?.requirements !== null) {
Expand Down
Loading

0 comments on commit db68229

Please sign in to comment.