diff --git a/docs/src/content/docs/getting-started/changelog.md b/docs/src/content/docs/getting-started/changelog.md index 6718b55240..3abac3ec2c 100644 --- a/docs/src/content/docs/getting-started/changelog.md +++ b/docs/src/content/docs/getting-started/changelog.md @@ -4,7 +4,7 @@ sidebar: order: 3 --- -## Update 14/10/2024 [[68b130088f5e365ec2a341cae48bc5b353ccc2ff...8d58fb6722e2db20717e5ec3bce1abf8496344b7]] +## Update 16/10/2024 [[68b130088f5e365ec2a341cae48bc5b353ccc2ff...4fbfe429e9a1bdf817175cf497177e47fefc6be6]] Bingo! We are running the 3rd official OSB bingo. See the [Bingo Page](/getting-started/bingo) for information. @@ -19,6 +19,7 @@ Bingo! We are running the 3rd official OSB bingo. See the [Bingo Page](/getting- - Various "engine" changes/improvements - Various wiki fixes/improvements - Fixed several bugs that were causing errors/issues +- Made some changes to fix roles (they may not be fully fixed yet) ### [[Arodab]] @@ -38,6 +39,7 @@ Bingo! We are running the 3rd official OSB bingo. See the [Bingo Page](/getting- ### [[nwjgit]] +- Fixed the droprate of tormented demons uniques (instead of a roll that gets you either a synapse/claw, you get a roll at both now) - [[Bow of faerdhinen (c)]] no longer requires arrows - Improved code relating to item rerolling (e.g. bludgeon pieces) - Added the **Colossal Wyrm Agility Course** @@ -52,6 +54,7 @@ Bingo! We are running the 3rd official OSB bingo. See the [Bingo Page](/getting- ### [[00justas]] - Updated agility xp/hr rates based on the osrs update (buffed) +- Added [[Clue scroll (elite)]] drop to Araxxor ## Update 9/10/2024 [[8de72b2de5a275497c67123904a280981415c553...68b130088f5e365ec2a341cae48bc5b353ccc2ff]] diff --git a/package.json b/package.json index ed6356f2e1..0ea2fdf7c9 100644 --- a/package.json +++ b/package.json @@ -62,7 +62,7 @@ "murmurhash": "^2.0.1", "node-cron": "^3.0.3", "node-fetch": "^2.6.7", - "oldschooljs": "git+https://github.com/oldschoolgg/oldschooljs.git#15a1cfd4995d939fbffec46d5ebf76f749c2066c", + "oldschooljs": "git+https://github.com/oldschoolgg/oldschooljs.git#50025d60df15b59dda616306b8aebd576514ab6e", "p-queue": "^6.6.2", "piscina": "^4.7.0", "postgres": "^3.4.4", diff --git a/src/lib/crons.ts b/src/lib/crons.ts index ae104c06c5..8e058c58cf 100644 --- a/src/lib/crons.ts +++ b/src/lib/crons.ts @@ -22,7 +22,6 @@ GROUP BY item_id;`); * Analytics */ schedule('*/5 * * * *', () => { - debugLog('Analytics cronjob starting'); return analyticsTick(); }); @@ -41,7 +40,6 @@ GROUP BY item_id;`); }); schedule('35 */48 * * *', async () => { - debugLog('cacheGEPrices cronjob starting'); await cacheGEPrices(); }); } diff --git a/src/lib/data/CollectionsExport.ts b/src/lib/data/CollectionsExport.ts index acdad821b5..16e7672bc5 100644 --- a/src/lib/data/CollectionsExport.ts +++ b/src/lib/data/CollectionsExport.ts @@ -1547,7 +1547,8 @@ export const allPetsCL = resolveItems([ 'Butch', 'Baron', 'Scurry', - 'Smol heredit' + 'Smol heredit', + 'Nid' ]); export const camdozaalCL = resolveItems([ 'Barronite mace', diff --git a/src/lib/data/buyables/buyables.ts b/src/lib/data/buyables/buyables.ts index 1cfa03c0c3..d0bd21578b 100644 --- a/src/lib/data/buyables/buyables.ts +++ b/src/lib/data/buyables/buyables.ts @@ -71,6 +71,15 @@ const randomEventBuyables: Buyable[] = [ outputItems: new Bank({ 'Frog mask': 1 }) + }, + { + name: 'Genie lamp', + itemCost: new Bank({ + 'Frog token': 1 + }), + outputItems: new Bank({ + 'Genie lamp': 1 + }) } ]; diff --git a/src/lib/minions/data/killableMonsters/low.ts b/src/lib/minions/data/killableMonsters/low.ts index c7804c4b8f..e7fc6da676 100644 --- a/src/lib/minions/data/killableMonsters/low.ts +++ b/src/lib/minions/data/killableMonsters/low.ts @@ -172,7 +172,7 @@ const killableMonsters: KillableMonster[] = [ timeToFinish: Time.Second * 6, table: Monsters.Araxyte, qpRequired: 1, - healAmountNeeded: 100, + healAmountNeeded: 40, attackStyleToUse: GearStat.AttackCrush, attackStylesUsed: [GearStat.AttackStab], levelRequirements: { diff --git a/src/lib/rolesTask.ts b/src/lib/rolesTask.ts index e019ba6864..3f27dac126 100644 --- a/src/lib/rolesTask.ts +++ b/src/lib/rolesTask.ts @@ -350,6 +350,7 @@ async function globalCL() { export async function runRolesTask(dryRun: boolean): Promise { const results: RoleResult[] = []; + const debugMessages: string[] = []; const promiseQueue = new PQueue({ concurrency: 2 }); @@ -374,8 +375,10 @@ export async function runRolesTask(dryRun: boolean): Promise { results.push(...validResults); if (invalidResults.length > 0) { logError(`[RolesTask] Invalid results for ${name}: ${JSON.stringify(invalidResults)}`); + debugMessages.push(`The ${name} roles had invalid results.`); } } catch (err) { + debugMessages.push(`The ${name} roles errored.`); logError(`[RolesTask] Error in ${name}: ${err}`); } finally { debugLog(`[RolesTask] Ran ${name} in ${stopwatch.stop()}`); @@ -385,7 +388,7 @@ export async function runRolesTask(dryRun: boolean): Promise { await promiseQueue.onIdle(); - debugLog(`Finished role functions, ${results.length} results`); + debugMessages.push(`Finished role functions, ${results.length} results`); const allBadgeIDs = uniqueArr(results.map(i => i.badge)).filter(notEmpty); const allRoleIDs = uniqueArr(results.map(i => i.roleID)).filter(notEmpty); @@ -396,7 +399,6 @@ export async function runRolesTask(dryRun: boolean): Promise { if (!supportServerGuild) throw new Error('No support guild'); // Remove all top badges from all users (and add back later) - debugLog('Removing badges...'); const badgeIDs = `ARRAY[${allBadgeIDs.join(',')}]`; await loggedRawPrismaQuery(` UPDATE users @@ -405,32 +407,43 @@ WHERE badges && ${badgeIDs} `); // Remove roles from ineligible users - debugLog('Remove roles from ineligible users...'); for (const member of supportServerGuild.members.cache.values()) { - const rolesToRemove = member.roles.cache.filter(r => allRoleIDs.includes(r.id)); + const rolesToRemove = member.roles.cache + .filter(r => allRoleIDs.includes(r.id)) + .filter(roleToRemove => { + const shouldHaveThisRole = results.some( + r => r.userID === member.id && r.roleID === roleToRemove.id + ); + return !shouldHaveThisRole; + }); if (rolesToRemove.size > 0) { await member.roles.remove(rolesToRemove.map(r => r.id)).catch(console.error); + debugMessages.push( + `Removing these roles from ${member.user.tag}: ${rolesToRemove.map(r => r.name).join(', ')}` + ); } } // Add roles to users - debugLog('Add roles to users...'); for (const { userID, roleID, badge } of results) { if (!userID) continue; const role = await supportServerGuild.roles.fetch(roleID).catch(console.error); const member = await supportServerGuild.members.fetch(userID).catch(noOp); if (!member) { - debugLog(`Failed to find member ${userID}`); + debugMessages.push(`Failed to find member ${userID}`); continue; } if (!role) { - debugLog(`Failed to find role ${roleID}`); + debugMessages.push(`Failed to find role ${roleID}`); continue; } roleNames.set(roleID, role.name); if (!member.roles.cache.has(roleID)) { await member.roles.add(roleID).catch(console.error); + debugMessages.push(`Adding the ${role.name} role to ${member.user.tag}`); + } else { + debugMessages.push(`${member.user.tag} already has the ${role.name} role`); } if (badge) { @@ -441,12 +454,19 @@ WHERE badges && ${badgeIDs} push: badge } }); + debugMessages.push(`Adding badge ${badge} to ${member.user.tag}`); + } else { + debugMessages.push(`${member.user.tag} already has badge ${badge}`); } } } return returnStringOrFile( - `**Roles**\n${results.map(r => `${getUsernameSync(r.userID)} got ${roleNames.get(r.roleID)} because ${r.reason}`).join('\n')}` + `Roles +${results.map(r => `${getUsernameSync(r.userID)} got ${roleNames.get(r.roleID)} because ${r.reason}`).join('\n')} + +Debug Messages: +${debugMessages.join('\n')}` ); } diff --git a/tests/unit/snapshots/banksnapshots.test.ts.snap b/tests/unit/snapshots/banksnapshots.test.ts.snap index a5015b9356..e14d56f2d8 100644 --- a/tests/unit/snapshots/banksnapshots.test.ts.snap +++ b/tests/unit/snapshots/banksnapshots.test.ts.snap @@ -2529,6 +2529,15 @@ exports[`OSB Buyables 1`] = ` "6188": 1, }, }, + { + "itemCost": { + "6183": 1, + }, + "name": "Genie lamp", + "outputItems": { + "2528": 1, + }, + }, { "gpCost": 100000, "itemCost": {}, diff --git a/tests/unit/snapshots/clsnapshots.test.ts.snap b/tests/unit/snapshots/clsnapshots.test.ts.snap index 650d6835fa..51d1c06289 100644 --- a/tests/unit/snapshots/clsnapshots.test.ts.snap +++ b/tests/unit/snapshots/clsnapshots.test.ts.snap @@ -5,7 +5,7 @@ exports[`OSB Collection Log Groups/Categories 1`] = ` Achievement Diary (48) Aerial Fishing (9) Alchemical Hydra (11) -All Pets (58) +All Pets (59) Araxxor (10) Barbarian Assault (11) Barrows Chests (25) diff --git a/yarn.lock b/yarn.lock index 0c48a19e71..140ff6927c 100644 --- a/yarn.lock +++ b/yarn.lock @@ -4362,9 +4362,9 @@ __metadata: languageName: node linkType: hard -"oldschooljs@git+https://github.com/oldschoolgg/oldschooljs.git#15a1cfd4995d939fbffec46d5ebf76f749c2066c": +"oldschooljs@git+https://github.com/oldschoolgg/oldschooljs.git#50025d60df15b59dda616306b8aebd576514ab6e": version: 0.0.0 - resolution: "oldschooljs@https://github.com/oldschoolgg/oldschooljs.git#commit=15a1cfd4995d939fbffec46d5ebf76f749c2066c" + resolution: "oldschooljs@https://github.com/oldschoolgg/oldschooljs.git#commit=50025d60df15b59dda616306b8aebd576514ab6e" dependencies: e: "npm:^0.2.33" node-fetch: "npm:2.6.7" @@ -5171,7 +5171,7 @@ __metadata: node-cron: "npm:^3.0.3" node-fetch: "npm:^2.6.7" nodemon: "npm:^3.1.7" - oldschooljs: "git+https://github.com/oldschoolgg/oldschooljs.git#15a1cfd4995d939fbffec46d5ebf76f749c2066c" + oldschooljs: "git+https://github.com/oldschoolgg/oldschooljs.git#50025d60df15b59dda616306b8aebd576514ab6e" p-queue: "npm:^6.6.2" piscina: "npm:^4.7.0" postgres: "npm:^3.4.4"