From 9359757f552abaf80f0f3db145a63ef5621b7ff5 Mon Sep 17 00:00:00 2001 From: TURB042O Date: Wed, 21 Feb 2024 23:49:34 -0600 Subject: [PATCH 1/9] dung & rc work in bank --- src/lib/skilling/skills/dung/dungDbFunctions.ts | 4 ++-- src/mahoji/commands/runecraft.ts | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/lib/skilling/skills/dung/dungDbFunctions.ts b/src/lib/skilling/skills/dung/dungDbFunctions.ts index 22d09751c5..134206edbf 100644 --- a/src/lib/skilling/skills/dung/dungDbFunctions.ts +++ b/src/lib/skilling/skills/dung/dungDbFunctions.ts @@ -15,9 +15,9 @@ export function calcMaxFloorUserCanDo(user: MUser) { export function calcUserGorajanShardChance(user: MUser) { return calcGorajanShardChance({ - hasMasterCape: user.hasEquipped('Dungeoneering master cape'), + hasMasterCape: user.hasEquippedOrInBank('Dungeoneering master cape'), dungLevel: user.skillLevel(SkillsEnum.Dungeoneering), - hasRingOfLuck: user.hasEquipped('Ring of luck') + hasRingOfLuck: user.hasEquippedOrInBank('Ring of luck') }); } diff --git a/src/mahoji/commands/runecraft.ts b/src/mahoji/commands/runecraft.ts index 41215356f8..00c2aa381f 100644 --- a/src/mahoji/commands/runecraft.ts +++ b/src/mahoji/commands/runecraft.ts @@ -140,7 +140,7 @@ export const runecraftCommand: OSBMahojiCommand = { tripLength /= 2; boosts.push('2x from Obis (3x more essence)'); } - if (user.hasEquipped('Runecraft master cape')) { + if (user.hasEquippedOrInBank('Runecraft master cape')) { tripLength /= 2; boosts.push(`${Emoji.RunecraftMasterCape} 2x faster`); } @@ -254,8 +254,8 @@ export const runecraftCommand: OSBMahojiCommand = { let removeTalismanAndOrRunes = new Bank(); let hasRingOfTheElements = false; if (runeObj.inputTalisman) { - const tomeOfFire = user.hasEquipped(['Tome of fire', 'Tome of fire (empty)']) ? 0 : 7; - const tomeOfWater = user.hasEquipped(['Tome of water', 'Tome of water (empty)']) ? 0 : 7; + const tomeOfFire = user.hasEquippedOrInBank(['Tome of fire', 'Tome of fire (empty)']) ? 0 : 7; + const tomeOfWater = user.hasEquippedOrInBank(['Tome of water', 'Tome of water (empty)']) ? 0 : 7; const magicImbueRuneCost = determineRunes( user, new Bank({ 'Astral rune': 2, 'Fire rune': tomeOfFire, 'Water rune': tomeOfWater }) From ad5bf5a9bf101c84d77b848219fee3f5776d1586 Mon Sep 17 00:00:00 2001 From: TURB042O Date: Thu, 7 Mar 2024 06:31:39 -0600 Subject: [PATCH 2/9] 2nd addition to Cyr's works in bank project --- src/lib/fishingContest.ts | 4 ++-- src/mahoji/commands/hunt.ts | 2 +- src/mahoji/commands/mine.ts | 8 ++++---- src/mahoji/lib/abstracted_commands/farmingCommand.ts | 2 +- src/mahoji/lib/abstracted_commands/minionKill.ts | 8 ++++---- src/mahoji/lib/abstracted_commands/odsCommand.ts | 2 +- .../lib/abstracted_commands/warriorsGuildCommand.ts | 2 +- src/tasks/minions/bso/fishingContestActivity.ts | 2 +- src/tasks/minions/miningActivity.ts | 2 +- 9 files changed, 16 insertions(+), 16 deletions(-) diff --git a/src/lib/fishingContest.ts b/src/lib/fishingContest.ts index 4aba455fcf..533a94ced8 100644 --- a/src/lib/fishingContest.ts +++ b/src/lib/fishingContest.ts @@ -296,12 +296,12 @@ export async function catchFishAtLocation({ user, location }: { user: MUser; loc const boosts: string[] = []; - if (user.hasEquipped('Ring of luck')) { + if (user.hasEquippedOrInBank('Ring of luck')) { maxLength += 1; boosts.push('+1cm max len for RoL'); } - if (user.hasEquipped('Crystal fishing rod')) { + if (user.hasEquippedOrInBank('Crystal fishing rod')) { maxLength += 5; boosts.push('+5cm max len for Crystal fishing rod'); } diff --git a/src/mahoji/commands/hunt.ts b/src/mahoji/commands/hunt.ts index 6cb1aeaa1b..a2ab4aa5dc 100644 --- a/src/mahoji/commands/hunt.ts +++ b/src/mahoji/commands/hunt.ts @@ -306,7 +306,7 @@ export const huntCommand: OSBMahojiCommand = { const hunterInputArgs: Parameters['0'] = { creature, - hasHunterMasterCape: user.hasEquipped('Hunter master cape'), + hasHunterMasterCape: user.hasEquippedOrInBank('Hunter master cape'), hasGraceful: userHasGracefulEquipped(user), maxTripLength, quantityInput: options.quantity, diff --git a/src/mahoji/commands/mine.ts b/src/mahoji/commands/mine.ts index 4cfcf15aa1..e556bc3895 100644 --- a/src/mahoji/commands/mine.ts +++ b/src/mahoji/commands/mine.ts @@ -83,7 +83,7 @@ export function calculateMiningInput({ effectiveMiningLevel += 7; } // Checks if user own Celestial ring or Celestial signet - if (gearValues.some(g => g.hasEquipped(['Celestial ring (uncharged)']))) { + if (gearValues.some(g => g.hasEquippedOrInBank(['Celestial ring (uncharged)']))) { messages.push('+4 invisible Mining lvls for Celestial ring'); effectiveMiningLevel += 4; } @@ -105,7 +105,7 @@ export function calculateMiningInput({ let glovesRate = 0; if (miningLevel >= 60) { for (const glove of miningGloves) { - if (!gearValues.some(g => g.hasEquipped(glove.id)) || !glove.Percentages.has(ore.id)) continue; + if (!gearValues.some(g => g.hasEquippedOrInBank(glove.id)) || !glove.Percentages.has(ore.id)) continue; glovesRate = glove.Percentages.amount(ore.id); if (glovesRate !== 0) { messages.push(`Lowered rock depletion rate by **${glovesRate}%** for ${itemNameFromID(glove.id)}`); @@ -116,7 +116,7 @@ export function calculateMiningInput({ let armourEffect = 0; for (const armour of varrockArmours) { - if (!gearValues.some(g => g.hasEquipped(armour.id)) || !armour.Percentages.has(ore.id)) continue; + if (!gearValues.some(g => g.hasEquippedOrInBank(armour.id)) || !armour.Percentages.has(ore.id)) continue; armourEffect = armour.Percentages.amount(ore.id); if (armourEffect !== 0) { messages.push(`**${armourEffect}%** chance to mine an extra ore using ${itemNameFromID(armour.id)}`); @@ -131,7 +131,7 @@ export function calculateMiningInput({ } let miningCapeEffect = 0; - if (gearValues.some(g => g.hasEquipped('Mining cape')) && miningCapeOreEffect.has(ore.id)) { + if (gearValues.some(g => g.hasEquippedOrInBank('Mining cape')) && miningCapeOreEffect.has(ore.id)) { miningCapeEffect = miningCapeOreEffect.amount(ore.id); if (miningCapeEffect !== 0) { messages.push(`**${miningCapeEffect}%** chance to mine an extra ore using Mining cape`); diff --git a/src/mahoji/lib/abstracted_commands/farmingCommand.ts b/src/mahoji/lib/abstracted_commands/farmingCommand.ts index d7ba3259b0..2cc089639d 100644 --- a/src/mahoji/lib/abstracted_commands/farmingCommand.ts +++ b/src/mahoji/lib/abstracted_commands/farmingCommand.ts @@ -221,7 +221,7 @@ export async function farmingPlantCommand({ duration *= 0.9; } - if (user.hasEquipped('Ring of endurance')) { + if (user.hasEquippedOrInBank('Ring of endurance')) { boostStr.push('10% time for Ring of Endurance'); duration *= 0.9; } diff --git a/src/mahoji/lib/abstracted_commands/minionKill.ts b/src/mahoji/lib/abstracted_commands/minionKill.ts index 553908f851..874d0d747e 100644 --- a/src/mahoji/lib/abstracted_commands/minionKill.ts +++ b/src/mahoji/lib/abstracted_commands/minionKill.ts @@ -584,16 +584,16 @@ export async function minionKillCommand( } } - if (attackStyles.includes(SkillsEnum.Ranged) && user.hasEquipped('Ranged master cape')) { + if (attackStyles.includes(SkillsEnum.Ranged) && user.hasEquippedOrInBank('Ranged master cape')) { timeToFinish *= 0.85; boosts.push('15% for Ranged master cape'); - } else if (attackStyles.includes(SkillsEnum.Magic) && user.hasEquipped('Magic master cape')) { + } else if (attackStyles.includes(SkillsEnum.Magic) && user.hasEquippedOrInBank('Magic master cape')) { timeToFinish *= 0.85; boosts.push('15% for Magic master cape'); } else if ( !attackStyles.includes(SkillsEnum.Magic) && !attackStyles.includes(SkillsEnum.Ranged) && - user.hasEquipped('Attack master cape') + user.hasEquippedOrInBank('Attack master cape') ) { timeToFinish *= 0.85; boosts.push('15% for Attack master cape'); @@ -686,7 +686,7 @@ export async function minionKillCommand( const prayerPots = user.bank.amount('Prayer potion(4)'); const fiveMinIncrements = Math.ceil(duration / (Time.Minute * 5)); let prayerPotsNeeded = Math.max(1, fiveMinIncrements); - const hasPrayerMasterCape = user.hasEquipped('Prayer master cape'); + const hasPrayerMasterCape = user.hasEquippedOrInBank('Prayer master cape'); if (hasPrayerMasterCape && hasBlessing) { boosts.push('40% less prayer pots'); prayerPotsNeeded = Math.floor(0.6 * prayerPotsNeeded); diff --git a/src/mahoji/lib/abstracted_commands/odsCommand.ts b/src/mahoji/lib/abstracted_commands/odsCommand.ts index 30b8e495f3..0869bf466b 100644 --- a/src/mahoji/lib/abstracted_commands/odsCommand.ts +++ b/src/mahoji/lib/abstracted_commands/odsCommand.ts @@ -76,7 +76,7 @@ export async function odsStartCommand(klasaUser: MUser, channelID: string) { let waveTime = randomVariation(Time.Minute * 4, 10); - if (klasaUser.hasEquipped('Runecraft master cape')) { + if (klasaUser.hasEquippedOrInBank('Runecraft master cape')) { waveTime /= 2; boosts.push(`${Emoji.RunecraftMasterCape} 2x faster`); } diff --git a/src/mahoji/lib/abstracted_commands/warriorsGuildCommand.ts b/src/mahoji/lib/abstracted_commands/warriorsGuildCommand.ts index 7612b07fc3..358dc8e06d 100644 --- a/src/mahoji/lib/abstracted_commands/warriorsGuildCommand.ts +++ b/src/mahoji/lib/abstracted_commands/warriorsGuildCommand.ts @@ -77,7 +77,7 @@ async function tokensCommand(user: MUser, channelID: string, quantity: number | async function cyclopsCommand(user: MUser, channelID: string, quantity: number | undefined) { const userBank = user.bank; - const hasAttackCape = user.gear.melee.hasEquipped('Attack cape'); + const hasAttackCape = user.gear.melee.hasEquippedOrInBank('Attack cape'); const maxTripLength = calcMaxTripLength(user, 'Cyclops'); // Check if either 100 warrior guild tokens or attack cape (similar items in future) const amountTokens = userBank.amount('Warrior guild token'); diff --git a/src/tasks/minions/bso/fishingContestActivity.ts b/src/tasks/minions/bso/fishingContestActivity.ts index c2ac234130..859dac3673 100644 --- a/src/tasks/minions/bso/fishingContestActivity.ts +++ b/src/tasks/minions/bso/fishingContestActivity.ts @@ -44,7 +44,7 @@ export const fishingContestTask: MinionTask = { }); const loot = new Bank(); - let tackleBoxChance = user.hasEquipped('Fishing master cape') ? 2 : 3; + let tackleBoxChance = user.hasEquippedOrInBank('Fishing master cape') ? 2 : 3; if (roll(tackleBoxChance)) { for (const [tackleBox, fishLevel] of [ ['Basic tackle box', 75], diff --git a/src/tasks/minions/miningActivity.ts b/src/tasks/minions/miningActivity.ts index 14f51a379c..d549395e3a 100644 --- a/src/tasks/minions/miningActivity.ts +++ b/src/tasks/minions/miningActivity.ts @@ -256,7 +256,7 @@ export const miningTask: MinionTask = { const spiritOre = stoneSpirits.find(t => t.ore.id === ore.id); const amountOfSpiritsToUse = spiritOre !== undefined ? Math.min(quantity, user.bank.amount(spiritOre.spirit.id)) : 0; - const hasMiningMasterCape = user.hasEquipped('Mining master cape'); + const hasMiningMasterCape = user.hasEquippedhasEquipped('Mining master cape'); const portentResult = amountOfSpiritsToUse > 0 ? await chargePortentIfHasCharges({ From 24edab9b72deec609929d8e1a47ef6da76ed5471 Mon Sep 17 00:00:00 2001 From: TURB042O Date: Thu, 7 Mar 2024 06:54:39 -0600 Subject: [PATCH 3/9] fixes --- src/mahoji/commands/mine.ts | 6 +++--- src/mahoji/lib/abstracted_commands/warriorsGuildCommand.ts | 2 +- src/tasks/minions/miningActivity.ts | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/mahoji/commands/mine.ts b/src/mahoji/commands/mine.ts index e556bc3895..dd16359d6d 100644 --- a/src/mahoji/commands/mine.ts +++ b/src/mahoji/commands/mine.ts @@ -83,7 +83,7 @@ export function calculateMiningInput({ effectiveMiningLevel += 7; } // Checks if user own Celestial ring or Celestial signet - if (gearValues.some(g => g.hasEquippedOrInBank(['Celestial ring (uncharged)']))) { + if (gearValues.some(g => g.hasEquipped(['Celestial ring (uncharged)']))) { messages.push('+4 invisible Mining lvls for Celestial ring'); effectiveMiningLevel += 4; } @@ -105,7 +105,7 @@ export function calculateMiningInput({ let glovesRate = 0; if (miningLevel >= 60) { for (const glove of miningGloves) { - if (!gearValues.some(g => g.hasEquippedOrInBank(glove.id)) || !glove.Percentages.has(ore.id)) continue; + if (!gearValues.some(g => g.hasEquipped(glove.id)) || !glove.Percentages.has(ore.id)) continue; glovesRate = glove.Percentages.amount(ore.id); if (glovesRate !== 0) { messages.push(`Lowered rock depletion rate by **${glovesRate}%** for ${itemNameFromID(glove.id)}`); @@ -116,7 +116,7 @@ export function calculateMiningInput({ let armourEffect = 0; for (const armour of varrockArmours) { - if (!gearValues.some(g => g.hasEquippedOrInBank(armour.id)) || !armour.Percentages.has(ore.id)) continue; + if (!gearValues.some(g => g.hasEquipped(armour.id)) || !armour.Percentages.has(ore.id)) continue; armourEffect = armour.Percentages.amount(ore.id); if (armourEffect !== 0) { messages.push(`**${armourEffect}%** chance to mine an extra ore using ${itemNameFromID(armour.id)}`); diff --git a/src/mahoji/lib/abstracted_commands/warriorsGuildCommand.ts b/src/mahoji/lib/abstracted_commands/warriorsGuildCommand.ts index 358dc8e06d..7612b07fc3 100644 --- a/src/mahoji/lib/abstracted_commands/warriorsGuildCommand.ts +++ b/src/mahoji/lib/abstracted_commands/warriorsGuildCommand.ts @@ -77,7 +77,7 @@ async function tokensCommand(user: MUser, channelID: string, quantity: number | async function cyclopsCommand(user: MUser, channelID: string, quantity: number | undefined) { const userBank = user.bank; - const hasAttackCape = user.gear.melee.hasEquippedOrInBank('Attack cape'); + const hasAttackCape = user.gear.melee.hasEquipped('Attack cape'); const maxTripLength = calcMaxTripLength(user, 'Cyclops'); // Check if either 100 warrior guild tokens or attack cape (similar items in future) const amountTokens = userBank.amount('Warrior guild token'); diff --git a/src/tasks/minions/miningActivity.ts b/src/tasks/minions/miningActivity.ts index d549395e3a..b2aea35dc6 100644 --- a/src/tasks/minions/miningActivity.ts +++ b/src/tasks/minions/miningActivity.ts @@ -256,7 +256,7 @@ export const miningTask: MinionTask = { const spiritOre = stoneSpirits.find(t => t.ore.id === ore.id); const amountOfSpiritsToUse = spiritOre !== undefined ? Math.min(quantity, user.bank.amount(spiritOre.spirit.id)) : 0; - const hasMiningMasterCape = user.hasEquippedhasEquipped('Mining master cape'); + const hasMiningMasterCape = User.hasEquipped('Mining master cape'); const portentResult = amountOfSpiritsToUse > 0 ? await chargePortentIfHasCharges({ From 03251692a0a8177d7454efc77899316ac9f2ec9e Mon Sep 17 00:00:00 2001 From: TURB042O Date: Thu, 7 Mar 2024 06:57:48 -0600 Subject: [PATCH 4/9] fix --- src/mahoji/commands/mine.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/mahoji/commands/mine.ts b/src/mahoji/commands/mine.ts index dd16359d6d..4cfcf15aa1 100644 --- a/src/mahoji/commands/mine.ts +++ b/src/mahoji/commands/mine.ts @@ -131,7 +131,7 @@ export function calculateMiningInput({ } let miningCapeEffect = 0; - if (gearValues.some(g => g.hasEquippedOrInBank('Mining cape')) && miningCapeOreEffect.has(ore.id)) { + if (gearValues.some(g => g.hasEquipped('Mining cape')) && miningCapeOreEffect.has(ore.id)) { miningCapeEffect = miningCapeOreEffect.amount(ore.id); if (miningCapeEffect !== 0) { messages.push(`**${miningCapeEffect}%** chance to mine an extra ore using Mining cape`); From de4d157df66d5a727013fbbefd8d16df2498e4e3 Mon Sep 17 00:00:00 2001 From: TURB042O Date: Thu, 7 Mar 2024 07:07:55 -0600 Subject: [PATCH 5/9] fix --- src/tasks/minions/miningActivity.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/tasks/minions/miningActivity.ts b/src/tasks/minions/miningActivity.ts index b2aea35dc6..14f51a379c 100644 --- a/src/tasks/minions/miningActivity.ts +++ b/src/tasks/minions/miningActivity.ts @@ -256,7 +256,7 @@ export const miningTask: MinionTask = { const spiritOre = stoneSpirits.find(t => t.ore.id === ore.id); const amountOfSpiritsToUse = spiritOre !== undefined ? Math.min(quantity, user.bank.amount(spiritOre.spirit.id)) : 0; - const hasMiningMasterCape = User.hasEquipped('Mining master cape'); + const hasMiningMasterCape = user.hasEquipped('Mining master cape'); const portentResult = amountOfSpiritsToUse > 0 ? await chargePortentIfHasCharges({ From 525e1a75b5bdd47c3b7e03f070af0f2991186194 Mon Sep 17 00:00:00 2001 From: TURB042O Date: Fri, 8 Mar 2024 19:55:44 -0600 Subject: [PATCH 6/9] mining master cape --- src/tasks/minions/miningActivity.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/tasks/minions/miningActivity.ts b/src/tasks/minions/miningActivity.ts index 14f51a379c..c6eec2888d 100644 --- a/src/tasks/minions/miningActivity.ts +++ b/src/tasks/minions/miningActivity.ts @@ -256,7 +256,7 @@ export const miningTask: MinionTask = { const spiritOre = stoneSpirits.find(t => t.ore.id === ore.id); const amountOfSpiritsToUse = spiritOre !== undefined ? Math.min(quantity, user.bank.amount(spiritOre.spirit.id)) : 0; - const hasMiningMasterCape = user.hasEquipped('Mining master cape'); + const hasMiningMasterCape = User.hasEquippedOrInBank('Mining master cape'); const portentResult = amountOfSpiritsToUse > 0 ? await chargePortentIfHasCharges({ From 0343176cd9d04b183b61569f70e512eee65a23d8 Mon Sep 17 00:00:00 2001 From: TURB042O Date: Fri, 8 Mar 2024 20:18:06 -0600 Subject: [PATCH 7/9] reverted tomes, Combat masters & Thieves' armband, --- src/mahoji/commands/mine.ts | 8 ++++---- src/mahoji/commands/runecraft.ts | 4 ++-- src/mahoji/commands/steal.ts | 2 +- src/mahoji/lib/abstracted_commands/minionKill.ts | 8 ++++---- src/mahoji/lib/abstracted_commands/monkeyRumbleCommand.ts | 2 +- .../lib/abstracted_commands/warriorsGuildCommand.ts | 2 +- src/tasks/minions/miningActivity.ts | 2 +- 7 files changed, 14 insertions(+), 14 deletions(-) diff --git a/src/mahoji/commands/mine.ts b/src/mahoji/commands/mine.ts index 4cfcf15aa1..e556bc3895 100644 --- a/src/mahoji/commands/mine.ts +++ b/src/mahoji/commands/mine.ts @@ -83,7 +83,7 @@ export function calculateMiningInput({ effectiveMiningLevel += 7; } // Checks if user own Celestial ring or Celestial signet - if (gearValues.some(g => g.hasEquipped(['Celestial ring (uncharged)']))) { + if (gearValues.some(g => g.hasEquippedOrInBank(['Celestial ring (uncharged)']))) { messages.push('+4 invisible Mining lvls for Celestial ring'); effectiveMiningLevel += 4; } @@ -105,7 +105,7 @@ export function calculateMiningInput({ let glovesRate = 0; if (miningLevel >= 60) { for (const glove of miningGloves) { - if (!gearValues.some(g => g.hasEquipped(glove.id)) || !glove.Percentages.has(ore.id)) continue; + if (!gearValues.some(g => g.hasEquippedOrInBank(glove.id)) || !glove.Percentages.has(ore.id)) continue; glovesRate = glove.Percentages.amount(ore.id); if (glovesRate !== 0) { messages.push(`Lowered rock depletion rate by **${glovesRate}%** for ${itemNameFromID(glove.id)}`); @@ -116,7 +116,7 @@ export function calculateMiningInput({ let armourEffect = 0; for (const armour of varrockArmours) { - if (!gearValues.some(g => g.hasEquipped(armour.id)) || !armour.Percentages.has(ore.id)) continue; + if (!gearValues.some(g => g.hasEquippedOrInBank(armour.id)) || !armour.Percentages.has(ore.id)) continue; armourEffect = armour.Percentages.amount(ore.id); if (armourEffect !== 0) { messages.push(`**${armourEffect}%** chance to mine an extra ore using ${itemNameFromID(armour.id)}`); @@ -131,7 +131,7 @@ export function calculateMiningInput({ } let miningCapeEffect = 0; - if (gearValues.some(g => g.hasEquipped('Mining cape')) && miningCapeOreEffect.has(ore.id)) { + if (gearValues.some(g => g.hasEquippedOrInBank('Mining cape')) && miningCapeOreEffect.has(ore.id)) { miningCapeEffect = miningCapeOreEffect.amount(ore.id); if (miningCapeEffect !== 0) { messages.push(`**${miningCapeEffect}%** chance to mine an extra ore using Mining cape`); diff --git a/src/mahoji/commands/runecraft.ts b/src/mahoji/commands/runecraft.ts index 00c2aa381f..ca73beca76 100644 --- a/src/mahoji/commands/runecraft.ts +++ b/src/mahoji/commands/runecraft.ts @@ -254,8 +254,8 @@ export const runecraftCommand: OSBMahojiCommand = { let removeTalismanAndOrRunes = new Bank(); let hasRingOfTheElements = false; if (runeObj.inputTalisman) { - const tomeOfFire = user.hasEquippedOrInBank(['Tome of fire', 'Tome of fire (empty)']) ? 0 : 7; - const tomeOfWater = user.hasEquippedOrInBank(['Tome of water', 'Tome of water (empty)']) ? 0 : 7; + const tomeOfFire = user.hasEquipped(['Tome of fire', 'Tome of fire (empty)']) ? 0 : 7; + const tomeOfWater = user.hasEquipped(['Tome of water', 'Tome of water (empty)']) ? 0 : 7; const magicImbueRuneCost = determineRunes( user, new Bank({ 'Astral rune': 2, 'Fire rune': tomeOfFire, 'Water rune': tomeOfWater }) diff --git a/src/mahoji/commands/steal.ts b/src/mahoji/commands/steal.ts index 7d99d49811..b0e4b278cb 100644 --- a/src/mahoji/commands/steal.ts +++ b/src/mahoji/commands/steal.ts @@ -157,7 +157,7 @@ export const stealCommand: OSBMahojiCommand = { quantity, user.hasEquipped(['Thieving cape', 'Thieving cape(t)']), hasArdyHard, - user.hasEquippedOrInBank(["Thieves' armband"]) + user.hasEquipped(["Thieves' armband"]) ); if (user.hasEquipped(['Thieving cape', 'Thieving cape(t)', 'Thieving master cape'])) { diff --git a/src/mahoji/lib/abstracted_commands/minionKill.ts b/src/mahoji/lib/abstracted_commands/minionKill.ts index 874d0d747e..553908f851 100644 --- a/src/mahoji/lib/abstracted_commands/minionKill.ts +++ b/src/mahoji/lib/abstracted_commands/minionKill.ts @@ -584,16 +584,16 @@ export async function minionKillCommand( } } - if (attackStyles.includes(SkillsEnum.Ranged) && user.hasEquippedOrInBank('Ranged master cape')) { + if (attackStyles.includes(SkillsEnum.Ranged) && user.hasEquipped('Ranged master cape')) { timeToFinish *= 0.85; boosts.push('15% for Ranged master cape'); - } else if (attackStyles.includes(SkillsEnum.Magic) && user.hasEquippedOrInBank('Magic master cape')) { + } else if (attackStyles.includes(SkillsEnum.Magic) && user.hasEquipped('Magic master cape')) { timeToFinish *= 0.85; boosts.push('15% for Magic master cape'); } else if ( !attackStyles.includes(SkillsEnum.Magic) && !attackStyles.includes(SkillsEnum.Ranged) && - user.hasEquippedOrInBank('Attack master cape') + user.hasEquipped('Attack master cape') ) { timeToFinish *= 0.85; boosts.push('15% for Attack master cape'); @@ -686,7 +686,7 @@ export async function minionKillCommand( const prayerPots = user.bank.amount('Prayer potion(4)'); const fiveMinIncrements = Math.ceil(duration / (Time.Minute * 5)); let prayerPotsNeeded = Math.max(1, fiveMinIncrements); - const hasPrayerMasterCape = user.hasEquippedOrInBank('Prayer master cape'); + const hasPrayerMasterCape = user.hasEquipped('Prayer master cape'); if (hasPrayerMasterCape && hasBlessing) { boosts.push('40% less prayer pots'); prayerPotsNeeded = Math.floor(0.6 * prayerPotsNeeded); diff --git a/src/mahoji/lib/abstracted_commands/monkeyRumbleCommand.ts b/src/mahoji/lib/abstracted_commands/monkeyRumbleCommand.ts index 5545460b51..65bd93b521 100644 --- a/src/mahoji/lib/abstracted_commands/monkeyRumbleCommand.ts +++ b/src/mahoji/lib/abstracted_commands/monkeyRumbleCommand.ts @@ -66,7 +66,7 @@ export async function monkeyRumbleCommand(user: MUser, channelID: string): Comma const boosts = []; let fightDuration = Time.Minute * 9; - if (user.hasEquippedOrInBank('Strength master cape')) { + if (user.hasEquipped('Strength master cape')) { fightDuration = reduceNumByPercent(fightDuration, 17); boosts.push('17% faster fights for strength master cape'); } diff --git a/src/mahoji/lib/abstracted_commands/warriorsGuildCommand.ts b/src/mahoji/lib/abstracted_commands/warriorsGuildCommand.ts index 7612b07fc3..358dc8e06d 100644 --- a/src/mahoji/lib/abstracted_commands/warriorsGuildCommand.ts +++ b/src/mahoji/lib/abstracted_commands/warriorsGuildCommand.ts @@ -77,7 +77,7 @@ async function tokensCommand(user: MUser, channelID: string, quantity: number | async function cyclopsCommand(user: MUser, channelID: string, quantity: number | undefined) { const userBank = user.bank; - const hasAttackCape = user.gear.melee.hasEquipped('Attack cape'); + const hasAttackCape = user.gear.melee.hasEquippedOrInBank('Attack cape'); const maxTripLength = calcMaxTripLength(user, 'Cyclops'); // Check if either 100 warrior guild tokens or attack cape (similar items in future) const amountTokens = userBank.amount('Warrior guild token'); diff --git a/src/tasks/minions/miningActivity.ts b/src/tasks/minions/miningActivity.ts index c6eec2888d..d549395e3a 100644 --- a/src/tasks/minions/miningActivity.ts +++ b/src/tasks/minions/miningActivity.ts @@ -256,7 +256,7 @@ export const miningTask: MinionTask = { const spiritOre = stoneSpirits.find(t => t.ore.id === ore.id); const amountOfSpiritsToUse = spiritOre !== undefined ? Math.min(quantity, user.bank.amount(spiritOre.spirit.id)) : 0; - const hasMiningMasterCape = User.hasEquippedOrInBank('Mining master cape'); + const hasMiningMasterCape = user.hasEquippedhasEquipped('Mining master cape'); const portentResult = amountOfSpiritsToUse > 0 ? await chargePortentIfHasCharges({ From b56df2fad709af6b332192b8c8dc63d9f7fa60e2 Mon Sep 17 00:00:00 2001 From: TURB042O Date: Fri, 8 Mar 2024 20:19:19 -0600 Subject: [PATCH 8/9] reverted tomes, Combat masters, Thieves' armband, --- src/mahoji/commands/mine.ts | 8 ++++---- .../lib/abstracted_commands/warriorsGuildCommand.ts | 2 +- src/tasks/minions/miningActivity.ts | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/mahoji/commands/mine.ts b/src/mahoji/commands/mine.ts index e556bc3895..4cfcf15aa1 100644 --- a/src/mahoji/commands/mine.ts +++ b/src/mahoji/commands/mine.ts @@ -83,7 +83,7 @@ export function calculateMiningInput({ effectiveMiningLevel += 7; } // Checks if user own Celestial ring or Celestial signet - if (gearValues.some(g => g.hasEquippedOrInBank(['Celestial ring (uncharged)']))) { + if (gearValues.some(g => g.hasEquipped(['Celestial ring (uncharged)']))) { messages.push('+4 invisible Mining lvls for Celestial ring'); effectiveMiningLevel += 4; } @@ -105,7 +105,7 @@ export function calculateMiningInput({ let glovesRate = 0; if (miningLevel >= 60) { for (const glove of miningGloves) { - if (!gearValues.some(g => g.hasEquippedOrInBank(glove.id)) || !glove.Percentages.has(ore.id)) continue; + if (!gearValues.some(g => g.hasEquipped(glove.id)) || !glove.Percentages.has(ore.id)) continue; glovesRate = glove.Percentages.amount(ore.id); if (glovesRate !== 0) { messages.push(`Lowered rock depletion rate by **${glovesRate}%** for ${itemNameFromID(glove.id)}`); @@ -116,7 +116,7 @@ export function calculateMiningInput({ let armourEffect = 0; for (const armour of varrockArmours) { - if (!gearValues.some(g => g.hasEquippedOrInBank(armour.id)) || !armour.Percentages.has(ore.id)) continue; + if (!gearValues.some(g => g.hasEquipped(armour.id)) || !armour.Percentages.has(ore.id)) continue; armourEffect = armour.Percentages.amount(ore.id); if (armourEffect !== 0) { messages.push(`**${armourEffect}%** chance to mine an extra ore using ${itemNameFromID(armour.id)}`); @@ -131,7 +131,7 @@ export function calculateMiningInput({ } let miningCapeEffect = 0; - if (gearValues.some(g => g.hasEquippedOrInBank('Mining cape')) && miningCapeOreEffect.has(ore.id)) { + if (gearValues.some(g => g.hasEquipped('Mining cape')) && miningCapeOreEffect.has(ore.id)) { miningCapeEffect = miningCapeOreEffect.amount(ore.id); if (miningCapeEffect !== 0) { messages.push(`**${miningCapeEffect}%** chance to mine an extra ore using Mining cape`); diff --git a/src/mahoji/lib/abstracted_commands/warriorsGuildCommand.ts b/src/mahoji/lib/abstracted_commands/warriorsGuildCommand.ts index 358dc8e06d..7612b07fc3 100644 --- a/src/mahoji/lib/abstracted_commands/warriorsGuildCommand.ts +++ b/src/mahoji/lib/abstracted_commands/warriorsGuildCommand.ts @@ -77,7 +77,7 @@ async function tokensCommand(user: MUser, channelID: string, quantity: number | async function cyclopsCommand(user: MUser, channelID: string, quantity: number | undefined) { const userBank = user.bank; - const hasAttackCape = user.gear.melee.hasEquippedOrInBank('Attack cape'); + const hasAttackCape = user.gear.melee.hasEquipped('Attack cape'); const maxTripLength = calcMaxTripLength(user, 'Cyclops'); // Check if either 100 warrior guild tokens or attack cape (similar items in future) const amountTokens = userBank.amount('Warrior guild token'); diff --git a/src/tasks/minions/miningActivity.ts b/src/tasks/minions/miningActivity.ts index d549395e3a..c6eec2888d 100644 --- a/src/tasks/minions/miningActivity.ts +++ b/src/tasks/minions/miningActivity.ts @@ -256,7 +256,7 @@ export const miningTask: MinionTask = { const spiritOre = stoneSpirits.find(t => t.ore.id === ore.id); const amountOfSpiritsToUse = spiritOre !== undefined ? Math.min(quantity, user.bank.amount(spiritOre.spirit.id)) : 0; - const hasMiningMasterCape = user.hasEquippedhasEquipped('Mining master cape'); + const hasMiningMasterCape = User.hasEquippedOrInBank('Mining master cape'); const portentResult = amountOfSpiritsToUse > 0 ? await chargePortentIfHasCharges({ From a9c1dc6c22e95ee7dd57911d245eb30665280c52 Mon Sep 17 00:00:00 2001 From: TURB042O Date: Fri, 8 Mar 2024 20:29:25 -0600 Subject: [PATCH 9/9] User to user --- src/tasks/minions/miningActivity.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/tasks/minions/miningActivity.ts b/src/tasks/minions/miningActivity.ts index c6eec2888d..a93f76593b 100644 --- a/src/tasks/minions/miningActivity.ts +++ b/src/tasks/minions/miningActivity.ts @@ -256,7 +256,7 @@ export const miningTask: MinionTask = { const spiritOre = stoneSpirits.find(t => t.ore.id === ore.id); const amountOfSpiritsToUse = spiritOre !== undefined ? Math.min(quantity, user.bank.amount(spiritOre.spirit.id)) : 0; - const hasMiningMasterCape = User.hasEquippedOrInBank('Mining master cape'); + const hasMiningMasterCape = user.hasEquippedOrInBank('Mining master cape'); const portentResult = amountOfSpiritsToUse > 0 ? await chargePortentIfHasCharges({