From b96a1e370b7ce66571a4753c84d9506e10d24950 Mon Sep 17 00:00:00 2001 From: Robby Date: Thu, 22 Dec 2022 04:46:43 +0000 Subject: [PATCH] Fixed the non-banking miner bot Non-banking miner bot will now drop power-mined tin ore --- .../scriptrepository/NonBankingMiner.kt | 20 ++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/Server/src/main/kotlin/rs09/game/ai/general/scriptrepository/NonBankingMiner.kt b/Server/src/main/kotlin/rs09/game/ai/general/scriptrepository/NonBankingMiner.kt index 79d3bf9cd..fa66c4112 100644 --- a/Server/src/main/kotlin/rs09/game/ai/general/scriptrepository/NonBankingMiner.kt +++ b/Server/src/main/kotlin/rs09/game/ai/general/scriptrepository/NonBankingMiner.kt @@ -1,17 +1,28 @@ package rs09.game.ai.general.scriptrepository +import api.produceGroundItem import core.game.node.entity.skill.Skills import core.game.node.item.Item import org.rs09.consts.Items import rs09.game.ai.skillingbot.SkillingBotAssembler +import rs09.game.interaction.IntType +import rs09.game.interaction.InteractionListeners class NonBankingMiner : Script() { override fun tick() { val rock = scriptAPI.getNearestNode(11957,true) - if(rock != null){ - rock.interaction.handle(bot,rock.interaction[0]) - if(bot.inventory.isFull) - bot.inventory.clear() + if(rock != null && !bot.inventory.isFull){ + InteractionListeners.run(rock.id, IntType.SCENERY,"mine",bot,rock) + } + //checks if the bot has tin ore in his inventory and drops it if he does + if(bot.inventory.containsAtLeastOneItem(Items.TIN_ORE_438)){ + produceGroundItem(null,438,1,bot.location) + bot.inventory.remove(Item(Items.TIN_ORE_438,1)) + } + //The following is to prevent lucky bots from breaking by having a full inventory of gems + if(bot.inventory.isFull && (!bot.inventory.containsAtLeastOneItem(Items.TIN_ORE_438))){ + bot.inventory.clear() + bot.inventory.add(Item(Items.MITHRIL_PICKAXE_1273)) } } @@ -23,7 +34,6 @@ class NonBankingMiner : Script() { init { skills[Skills.ATTACK] = 99 - equipment.add(Item(Items.MITHRIL_PICKAXE_1273)) inventory.add(Item(Items.MITHRIL_PICKAXE_1273)) skills[Skills.MINING] = 50 }