Page 1 of 1

Cannot see target, perma-stuck

Posted: Wed Oct 27, 2010 3:24 am
by checkii
If the bot acquires a target and cannot attack it due to an obstacle, he will switch to another target. Problem is the other target is also behind an obstacle. He then switches back to original target that is still behind an obstacle. This creates an infinite loop of targets he can't attack.

The conditions seems to be limited when 2 of the closest targets are behind an obstacle. And most likely only applies to casters using range attack. My temp fix is to reduce the combat distance to bypass the obstacle. However this doesn't work every time.

Is there a way for the bot to try and target something else? Or at least make him move a little when he gets stuck due to target issues.

Re: Cannot see target, perma-stuck

Posted: Wed Oct 27, 2010 4:15 am
by swietlowka
it happends always when i bot for liquid energy outside hos... and its really annoying, it would be nice to have a mark to mark allready not accesible targets to do not target them for some time, but i cant see it comming anytime soon imho

Re: Cannot see target, perma-stuck

Posted: Wed Oct 27, 2010 10:53 am
by checkii
swietlowka wrote:but i cant see it comming anytime soon imho
Why not? its actually not that hard. I just didn't give a lot of thought into it. The reason I am asking is so we can all pitch in a solution.

Here is one. Put this in your onskillcast

Code: Select all

player:update()
if player.Fighting then
    if( os.difftime(os.time(), player.lastHitTime) > 5 ) then -- more than 5 sec without damaging target
        keyboardHold(key.VK_W);
        yrest(1000)
        keyboardRelease(key.VK_W);
    end
end
This is obviously very crude so you probably want a much smoother solution in the future.

There is literally hundreds of solutions. Hell you can make him turn a bit then go forward if you want.

Re: Cannot see target, perma-stuck

Posted: Thu Oct 28, 2010 1:44 am
by swietlowka
maybe this would be better?

Code: Select all

player:update()
if player.Fighting then
    if( os.difftime(os.time(), player.lastHitTime) > 5 ) then -- more than 5 sec without damaging target
        player:unstick();
        yrest(1000);
    end
end

Re: Cannot see target, perma-stuck

Posted: Thu Oct 28, 2010 2:55 pm
by checkii
Yeah the unstick thing totally works. I guess this mystery is solved.