Page 1 of 1

Q: How to clear Last_ignore_target_ptr ?

Posted: Wed Dec 14, 2011 7:28 pm
by kkulesza
Sometimes, when there are obstacles betwin bot and target, bot moves on and ignores that particular mob and doesn't try to fight again even if there is no obstacle anymore.
I've found this code in player.lua :

Code: Select all

if(address == player.Last_ignore_target_ptr  and
	   os.difftime(os.time(), player.Last_ignore_target_time)  < 10 )then
and i believe it is responsible for that behavior.
It looks like it ignores a mob for 10 seconds.

10 secs is too long for me. And i have to kill all mobs on my way.
So i want to shorten that time to 4 seconds, to let the bot go to the next wp and then try to fight again.
I've put the code below in the onload section of my file, but it looks like it doesn't work (bot still ignores a mob)

Code: Select all

function clearIgnored()
	player.Last_ignore_target_ptr=nil;
	return
end
-- Default 10 secs is too long. Bot can pass a mob and then the chest will not spawn. 
registerTimer("clearIgnored", secondsToTimer(4), clearIgnored);
Is there something wrong in this code?

Re: Q: How to clear Last_ignore_target_ptr ?

Posted: Wed Dec 14, 2011 9:37 pm
by rock5
I can't see anything wrong with it. Maybe your not attacking for some other reason such as the mobs becoming out of range after those 4 seconds?