bufxiezds

This commit is contained in:
Ceikry
2021-03-20 22:41:43 -05:00
parent 61b08b18be
commit 2189b907d9
8 changed files with 28 additions and 11 deletions
@@ -9,6 +9,8 @@ import core.game.world.map.zone.ZoneBorders
import org.rs09.consts.Items
import rs09.game.ai.general.ScriptAPI
import rs09.game.ai.skillingbot.SkillingBotAssembler
import rs09.game.interaction.InteractionListener
import rs09.game.interaction.InteractionListeners
@PlayerCompatible
@ScriptName("Falador Coal Miner")
@@ -52,7 +54,7 @@ class CoalMiner() : Script() {
scriptAPI.walkTo(mine.randomLoc)
} else {
val rock = scriptAPI.getNearestNode("rocks",true)
rock?.interaction?.handle(bot,rock.interaction[0])
rock?.let { InteractionListeners.run(rock.id, InteractionListener.OBJECT,"mine",bot,rock) }
}
overlay!!.setAmount(bot.inventory.getAmount(Items.COAL_453) + coalAmount)
}
@@ -7,6 +7,8 @@ import core.game.node.entity.skill.Skills
import core.game.node.item.Item
import core.game.world.map.zone.ZoneBorders
import org.rs09.consts.Items
import rs09.game.interaction.InteractionListener
import rs09.game.interaction.InteractionListeners
import rs09.tools.stringtools.colorize
@PlayerCompatible
@@ -39,7 +41,8 @@ class DraynorWillows : Script(){
scriptAPI.walkTo(willowZone.randomLoc)
else {
val willowtree = scriptAPI.getNearestNode("willow", true)
willowtree?.interaction?.handle(bot, willowtree.interaction[0])
willowtree?.let { InteractionListeners.run(willowtree.id,
InteractionListener.OBJECT,"chop",bot,willowtree) }
if (bot.inventory.isFull)
state = State.BANKING
}
@@ -13,6 +13,8 @@ import core.tools.RandomFunction
import org.rs09.consts.Items
import rs09.game.ai.AIPlayer
import rs09.game.ai.general.ScriptAPI
import rs09.game.interaction.InteractionListener
import rs09.game.interaction.InteractionListeners
import rs09.game.world.GameWorld
import kotlin.random.Random
@@ -71,7 +73,7 @@ class LobsterCatcher : Script() {
if(spot == null){
state = State.IDLE
} else {
spot!!.interaction.handle(bot, spot.interaction[0])
InteractionListeners.run(spot.id,InteractionListener.NPC,"cage",bot,spot)
}
if(bot.inventory.isFull){
state = State.FIND_BANK
@@ -10,6 +10,8 @@ import core.tools.RandomFunction
import org.rs09.consts.Items
import rs09.game.ai.general.ScriptAPI
import rs09.game.ai.skillingbot.SkillingBotAssembler
import rs09.game.interaction.InteractionListener
import rs09.game.interaction.InteractionListeners
@PlayerCompatible
@ScriptName("Seers Magics")
@@ -37,7 +39,7 @@ class SeersMagicTrees : Script(){
State.CHOPPING -> {
val tree = scriptAPI.getNearestNode(1306,true)
tree?.interaction?.handle(bot,tree.interaction[0])
tree?.let { InteractionListeners.run(tree.id, InteractionListener.OBJECT,"chop",bot,tree) }
if(bot.inventory.isFull){
state = State.FIND_BANK
}
@@ -10,6 +10,8 @@ import org.rs09.consts.Items
import rs09.game.ai.AIPlayer
import rs09.game.ai.general.ScriptAPI
import rs09.game.ge.OfferManager
import rs09.game.interaction.InteractionListener
import rs09.game.interaction.InteractionListeners
import kotlin.random.Random
/*
@@ -115,7 +117,7 @@ class SharkCatcher : Script() {
if (Random.nextBoolean()) {
tick = 0
val spot = scriptAPI.getNearestNode(334, false)
spot!!.interaction.handle(bot, spot.interaction[2])
spot?.let { InteractionListeners.run(spot.id, InteractionListener.NPC,"harpoon",bot,spot) }
if(bot.inventory.isFull){
state = State.FIND_BANK
} else {
@@ -6,6 +6,8 @@ import core.game.world.map.Location
import core.game.world.map.zone.ZoneBorders
import org.rs09.consts.Items
import rs09.game.ai.skillingbot.SkillingBotAssembler
import rs09.game.interaction.InteractionListener
import rs09.game.interaction.InteractionListeners
@PlayerCompatible
@ScriptDescription("Start in varrock bank with rune mysteries complete and a pickaxe equipped/in inventory")
@@ -47,7 +49,7 @@ class VarrockEssenceMiner : Script(){
State.MINING -> {
val essence = scriptAPI.getNearestNode(2491,true)
essence?.interaction?.handle(bot,essence.interaction[0])
essence?.let { InteractionListeners.run(essence.id, InteractionListener.OBJECT,"mine",bot,essence) }
if(bot.inventory.isFull)
state = State.TO_BANK
}
@@ -5,9 +5,11 @@ import core.game.node.entity.player.Player
import core.game.world.map.Location
abstract class InteractionListener : Listener{
val ITEM = 0
val OBJECT = 1
val NPC = 2
companion object {
val ITEM = 0
val OBJECT = 1
val NPC = 2
}
fun on(id: Int, type: Int, vararg option: String,handler: (player: Player, node: Node) -> Boolean){
InteractionListeners.add(id,type,option,handler)
}
@@ -41,7 +41,8 @@ enum class Pickpockets(val ids: IntArray, val requiredLevel: Int, val low: Doubl
WeightedItem(Items.RUSTY_SWORD_686,1,1,3.5),
WeightedItem(Items.BROKEN_ARMOUR_698,1,1,3.5),
WeightedItem(Items.BROKEN_STAFF_689,1,1,3.2),
WeightedItem(Items.BROKEN_ARROW_687,1,1,3.1)
WeightedItem(Items.BROKEN_ARROW_687,1,1,3.1),
WeightedItem(Items.BUTTONS_688,1,1,3.0)
).insertEasyClue(1.0)),
FEMALE_HAM_MEMBER(intArrayOf(1715), 15, 135.0, 240.0, 18.5, 1,3,4, WeightBasedTable.create(
WeightedItem(Items.COINS_995,1,21,5.5),
@@ -67,7 +68,8 @@ enum class Pickpockets(val ids: IntArray, val requiredLevel: Int, val low: Doubl
WeightedItem(Items.RUSTY_SWORD_686,1,1,3.5),
WeightedItem(Items.BROKEN_ARMOUR_698,1,1,3.5),
WeightedItem(Items.BROKEN_STAFF_689,1,1,3.2),
WeightedItem(Items.BROKEN_ARROW_687,1,1,3.1)
WeightedItem(Items.BROKEN_ARROW_687,1,1,3.1),
WeightedItem(Items.BUTTONS_688,1,1,3.0)
).insertEasyClue(1.0)),
WARRIOR(intArrayOf(15, 18), 25, 84.0, 240.0, 26.0, 2, 2, 5, WeightBasedTable.create(
WeightedItem(Items.COINS_995,18,18,1.0,true)