openkore icon indicating copy to clipboard operation
openkore copied to clipboard

Ai stuck while attacking

Open Jozoko opened this issue 10 years ago • 10 comments

While bot attacking monster what spawned behiend textur - ai stuck http://image.prntscr.com/image/8c304c4dd4f240b9b6458e6fa0078401.png

0: route

1: attack

{
monsterPos=>{ y=>'282', x=>'146'},
ID=>'io?.',
missedFromYou_last=>'',
dmgFromYou_last=>'',
move_start=>'1473166839.02608',
pos_to=>{y=>'282',x=>'146'},
unstuck=>{time=>'',timeout=>'2.75'},
lastSkillTime=>'1473166196.76263',
dmgToYou_last=>'0',
attackMethod=>{maxDistance=>'2',distance=>'1',type=>'weapon'},
pos=>{y=>'282',x=>'146'},
missedYou_last=>'2',
ai_attack_giveup=>{timeout=>'12',time=>'1473166839.02463'},
attackMainTimeout=>'1473166839.02599'
}

2: route

where Prontera Field (prt_fild02) : (baseName: prt_fild02) : 146, 279

Jozoko avatar Sep 06 '16 12:09 Jozoko

What value are you using for attackDistance in your control.txt? Are you using any attackSkillSlot blocks?

itsrachelfish avatar Sep 07 '16 05:09 itsrachelfish

m? i send log from ai print > maxDistance=>'2',distance=>'1', . Also trying some different. I think it will work good if i make distance - 0 - 0.9 But it's very bad solution.

Have not any attackskillslots, just weapon attack

Jozoko avatar Sep 07 '16 23:09 Jozoko

Is this a fld problem cause openkore thinks that slot is a walkable one?

I encounter this very regularly as well and have to have quite a number of hacky solution.

Cozzie avatar Sep 08 '16 14:09 Cozzie

it's classic openkore problem , attacking Immovable monster

c4c1n6kr3m1 avatar Sep 09 '16 10:09 c4c1n6kr3m1

Can confirm this is a common problem. Try setting attackCheckLOS 1 (likely not help though). Or make a simple macro checking position every X seconds if it stays the same then teleport.

deezar avatar Sep 09 '16 16:09 deezar

I reviewed the source code for attackCheckLOS and it seems like whoever wrote it was under the assumption that any attacks 2 or less cells away will always succeed.

It might be possible to fix this bug by simply removing the distance check on that line. I'd recommend trying that and letting us know if it works.

itsrachelfish avatar Sep 11 '16 01:09 itsrachelfish

I'll try, thx

Jozoko avatar Sep 11 '16 19:09 Jozoko

i check source, here is one more condition OR (!$config{attackCanSnipe} && $realMonsterDist <= $args->{attackMethod}{maxDistance} && !checkLineWalkable($realMyPos, $realMonsterPos, 1))) so i dont think what we need to delete attack distance

Jozoko avatar Sep 11 '16 19:09 Jozoko

[Sep 15 05:00:10 2016.73] Target distance 2.0 is >1; moving to target: from (108,112) to (108,111)
[Sep 15 05:00:10 2016.74] You on route to: (): 108, 111
[Sep 15 05:00:10 2016.74] Route You Solution Ready!
[Sep 15 05:00:10 2016.74] Route You - next step moving to (108, 112), index 1, 2 steps left
[Sep 15 05:00:10 2016.74] Move You - (re)trying
[Sep 15 05:00:10 2016.74] Sent move to: 108, 112
[Sep 15 05:00:10 2016.76] Received packet: 01F3 Handler: misc_effect
[Sep 15 05:00:10 2016.77] Received packet: 01F3 Handler: misc_effect
[Sep 15 05:00:10 2016.91] Received packet: 01F3 Handler: misc_effect
[Sep 15 05:00:10 2016.96] Received packet: 0087 Handler: character_moves
[Sep 15 05:00:10 2016.96] You're moving from (108, 112) to (108, 112) - distance 0.0
[Sep 15 05:00:10 2016.96] Move You - done
[Sep 15 05:00:10 2016.97] Route You - trimming down solution (2) by 2 steps
[Sep 15 05:00:10 2016.97] You reached the destination.
[Sep 15 05:00:10 2016.97] Target distance 2.0 is >1; moving to target: from (108,112) to (108,111)
[Sep 15 05:00:10 2016.97] You on route to: (): 108, 111
[Sep 15 05:00:10 2016.98] Route You Solution Ready!

Bot trying to step in unwalkable cell and looping

Jozoko avatar Sep 15 '16 02:09 Jozoko

dplicated issue: #1687

alisonrag avatar Jul 03 '20 18:07 alisonrag