Added some bot debugging support via the "Request Assist" option on bots

Found and fixed the issue causing bots to get stuck or only interact with one thing
Added some additional safety checks in the script processor
This commit is contained in:
Ceikry
2023-05-25 04:33:27 +00:00
committed by Ryan
parent b995436ea4
commit 6eed461162
5 changed files with 63 additions and 17 deletions
@@ -77,7 +77,7 @@ class Adventurer(val style: CombatStyle): Script() {
return "${bot.name} is an Adventurer bot at ${bot.location}! State: $state - City: $city"
}
private var state = State.START
var state = State.START
fun getRandomCity(): Location{
return cities.random()
@@ -7,6 +7,7 @@ import core.game.node.entity.player.link.request.RequestType
import core.plugin.Initializable
import core.game.interaction.IntType
import core.game.interaction.InteractionListener
import core.game.bots.*
/**
* Represents the plugin used to handle the player option interacting.
@@ -22,8 +23,10 @@ class RequestOption : InteractionListener {
return@on true
}
on(_P_ASSIST.name, IntType.PLAYER) { player, node ->
if (node is AIPlayer)
AIRepository.sendBotInfo(player, node)
player.requestManager.request((node as Player), RequestType.ASSIST)
return@on true
}
}
}
}