Merge remote-tracking branch 'origin/master'

This commit is contained in:
philliam
2021-06-27 10:38:10 -04:00
4 changed files with 0 additions and 62 deletions
@@ -1,9 +1,6 @@
package rs09.game.ai.general.scriptrepository
<<<<<<< refs/remotes/2009scape/master
=======
>>>>>>> Player script fixes, and bankAll scriptAPI function added
import core.game.interaction.DestinationFlag
import core.game.interaction.MovementPulse
import core.game.node.Node
@@ -15,38 +12,24 @@ import rs09.game.ai.general.ScriptAPI
import rs09.game.ai.skillingbot.SkillingBotAssembler
import rs09.game.interaction.InteractionListener
import rs09.game.interaction.InteractionListeners
<<<<<<< refs/remotes/2009scape/master
=======
import api.ContentAPI
import kotlinx.coroutines.delay
import kotlinx.coroutines.runBlocking
import java.util.logging.Handler
>>>>>>> Player script fixes, and bankAll scriptAPI function added
@PlayerCompatible
@ScriptName("Falador Coal Miner")
@ScriptDescription("Start in Falador East Bank with a pick equipped","or in your inventory.")
@ScriptIdentifier("fally_coal")
<<<<<<< refs/remotes/2009scape/master
class CoalMiner() : Script() {
var state = State.INIT
var ladderSwitch = false
=======
class CoalMiner : Script() {
var state = State.INIT
var ladderSwitch = false
>>>>>>> Player script fixes, and bankAll scriptAPI function added
val bottomLadder = ZoneBorders(3016,9736,3024,9742)
val topLadder = ZoneBorders(3016,3336,3022,3342)
val mine = ZoneBorders(3027,9733,3054,9743)
val bank = ZoneBorders(3009,3355,3018,3358)
var overlay: ScriptAPI.BottingOverlay? = null
<<<<<<< refs/remotes/2009scape/master
var coalAmount = 0
=======
var coalAmount = 0
>>>>>>> Player script fixes, and bankAll scriptAPI function added
override fun tick() {
when(state){
@@ -68,10 +51,7 @@ class CoalMiner : Script() {
}
State.MINING -> {
<<<<<<< refs/remotes/2009scape/master
=======
bot.interfaceManager.close()
>>>>>>> Player script fixes, and bankAll scriptAPI function added
if(bot.inventory.freeSlots() == 0){
state = State.TO_BANK
}
@@ -81,11 +61,7 @@ class CoalMiner : Script() {
val rock = scriptAPI.getNearestNode("rocks",true)
rock?.let { InteractionListeners.run(rock.id, InteractionListener.OBJECT,"mine",bot,rock) }
}
<<<<<<< refs/remotes/2009scape/master
overlay!!.setAmount(bot.inventory.getAmount(Items.COAL_453) + coalAmount)
=======
overlay!!.setAmount(ContentAPI.amountInInventory(bot, Items.COAL_453) + coalAmount)
>>>>>>> Player script fixes, and bankAll scriptAPI function added
}
State.TO_BANK -> {
@@ -112,22 +88,14 @@ class CoalMiner : Script() {
}
State.BANKING -> {
<<<<<<< refs/remotes/2009scape/master
coalAmount += bot.inventory.getAmount(Items.COAL_453)
scriptAPI.bankItem(Items.COAL_453)
=======
coalAmount += bot.inventory.getAmount(Items.COAL_453)
scriptAPI.bankAll()
>>>>>>> Player script fixes, and bankAll scriptAPI function added
state = State.TO_MINE
}
State.TO_MINE -> {
if(ladderSwitch){
<<<<<<< refs/remotes/2009scape/master
=======
bot.interfaceManager.close()
>>>>>>> Player script fixes, and bankAll scriptAPI function added
if(!topLadder.insideBorder(bot.location)){
scriptAPI.walkTo(topLadder.randomLoc)
} else {
@@ -162,10 +130,6 @@ class CoalMiner : Script() {
scriptAPI.teleport(bank.randomLoc)
state = State.TO_MINE
}
<<<<<<< refs/remotes/2009scape/master
=======
>>>>>>> Player script fixes, and bankAll scriptAPI function added
}
}
@@ -197,8 +161,4 @@ class CoalMiner : Script() {
equipment.add(Item(Items.IRON_PICKAXE_1267))
skills.put(Skills.MINING,75)
}
<<<<<<< refs/remotes/2009scape/master
=======
>>>>>>> Player script fixes, and bankAll scriptAPI function added
}
@@ -41,14 +41,9 @@ class DraynorWillows : Script(){
scriptAPI.walkTo(willowZone.randomLoc)
else {
val willowtree = scriptAPI.getNearestNode("willow", true)
<<<<<<< refs/remotes/2009scape/master
willowtree?.let { InteractionListeners.run(willowtree.id,
InteractionListener.OBJECT,"chop",bot,willowtree) }
=======
bot.interfaceManager.close()
willowtree?.let { InteractionListeners.run(willowtree.id,
InteractionListener.OBJECT,"Chop down",bot,willowtree) }
>>>>>>> Player script fixes, and bankAll scriptAPI function added
if (bot.inventory.isFull)
state = State.BANKING
}
@@ -69,10 +69,7 @@ class LobsterCatcher : Script() {
State.FISHING -> {
<<<<<<< refs/remotes/2009scape/master
=======
bot.interfaceManager.close()
>>>>>>> Player script fixes, and bankAll scriptAPI function added
val spot = scriptAPI.getNearestNode(333, false)
if(spot == null){
state = State.IDLE
@@ -167,17 +164,10 @@ class LobsterCatcher : Script() {
init {
<<<<<<< refs/remotes/2009scape/master
val setUp = RandomFunction.random(Sets.values().size)
equipment.addAll(Sets.values()[setUp].equipment)
inventory.add(Item(301))
skills[Skills.FISHING] = 40
=======
val setUp = RandomFunction.random(Sets.values().size)
equipment.addAll(Sets.values()[setUp].equipment)
inventory.add(Item(301))
skills[Skills.FISHING] = 40
>>>>>>> Player script fixes, and bankAll scriptAPI function added
}
enum class State{
@@ -39,12 +39,8 @@ class SeersMagicTrees : Script(){
State.CHOPPING -> {
val tree = scriptAPI.getNearestNode(1306,true)
<<<<<<< refs/remotes/2009scape/master
tree?.let { InteractionListeners.run(tree.id, InteractionListener.OBJECT,"chop",bot,tree) }
=======
bot.interfaceManager.close()
tree?.let { InteractionListeners.run(tree.id, InteractionListener.OBJECT,"Chop down",bot,tree) }
>>>>>>> Player script fixes, and bankAll scriptAPI function added
if(bot.inventory.isFull){
state = State.FIND_BANK
}
@@ -74,10 +70,7 @@ class SeersMagicTrees : Script(){
}
State.RETURN_TO_TREES -> {
<<<<<<< refs/remotes/2009scape/master
=======
bot.interfaceManager.close()
>>>>>>> Player script fixes, and bankAll scriptAPI function added
if(!magicsZone.insideBorder(bot)){
scriptAPI.walkTo(magicsZone.randomLoc)
} else {