Q: How to clear Last_ignore_target_ptr ?
Posted: Wed Dec 14, 2011 7:28 pm
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 :
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)
Is there something wrong in this code?
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 )thenIt 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);