Fixed Adventure bots to use new listen system for interactions.

This commit is contained in:
Badhad 2021-03-15 20:25:56 -04:00
parent 3ebd9c2614
commit 8dfa6a1188
2 changed files with 18 additions and 13 deletions

View file

@ -21,6 +21,7 @@ import core.game.world.update.flag.player.ChatFlag
import core.tools.RandomFunction
import rs09.game.ai.AIRepository
import rs09.game.ai.pvmbots.CombatBotAssembler
import rs09.game.interaction.InteractionListeners
import java.time.LocalDateTime
import java.time.format.DateTimeFormatter
import kotlin.random.Random
@ -816,9 +817,10 @@ class Adventurer(val style: CombatStyle): Script() {
"Maple tree","Yew","Magic tree",
"Teak","Mahogany")
val resource = scriptAPI.getNearestNodeFromList(resources,true)
try {
resource?.interaction?.handle(bot, resource.interaction[0])
} catch (e: Exception){}
if(resource != null){
if(resource.name.contains("ocks")) InteractionListeners.run(resource.id,1,"mine",bot,resource)
else InteractionListeners.run(resource.id,1,"chop down",bot,resource)
}
}
}
return
@ -917,15 +919,18 @@ class Adventurer(val style: CombatStyle): Script() {
}
if (RandomFunction.random(1000) <= 50 && poi){
val roamDistancePoi = if(poiloc == teakfarm || poiloc == crawlinghands) 5
else if (poiloc == treegnome) 50
else if (poiloc == isafdar) 40
else if (poiloc == eaglespeek) 40
else if (poiloc == keldagrimout) 40
else if (poiloc == teak1) 30
else if (poiloc == miningguild) 6
else if (poiloc == magics || poiloc == coal) 8
else if (poiloc == gemrocks || poiloc == chaosnpc) 1 else 60
val roamDistancePoi = when(poiloc){
teakfarm,crawlinghands -> 5
treegnome -> 50
isafdar -> 40
eaglespeek -> 40
keldagrimout -> 40
teak1 -> 30
miningguild -> 6
magics,coal -> 8
gemrocks,chaosnpc -> 1
else -> 60
}
scriptAPI.randomWalkTo(poiloc,roamDistancePoi)
return
}

View file

@ -16,7 +16,7 @@
"enable_bots": true,
"autostock_ge": true,
"allow_token_purchase": true,
"max_adv_bots": "0",
"max_adv_bots": "100",
"message_of_the_week_identifier": "0",
"message_of_the_week_text": "Welcome to 2009Scape! <br><col=11ff00>N</col><col=ecff00>o</col><col=ff8300>w</col <col=ff0000>i</col><col=ff00d4>n</col> <col=6100ff>T</col><col=000fff>e</col><col=00f0ff>c</col><col=00ff59>h</col><col=93ff00>n</col><col=ff9e00>i</col><col=ff0000>c</col><col=ff00d1>o</col><col=2700ff>l</col><col=00f7ff>o</col><col=00ff0c>r</col><col=ff0000>!</col>"
},