Item Find Barb

Ok… so I know this is clearly an ongoing issue. I have found numerous help requests on this topic or something similar. But despite the fact that the question seems to have been asked an endless number of times, I have yet to find a thread that ends in a solution.

Basically my barb with find items set to true will do everything mostly as expected. But he sometimes gets stuck on a corpse for an indeterminate amount of time just repeating find item until something happens (no idea what) that causes him to move on.

After a lot of observation and experimentation I have found the following changes to be helpful:

if (this.checkCorpse(corpse)) {
	if (getDistance(me, corpse) > 5 || checkCollision(me, corpse, 0x1)) {
		Pather.moveToUnit(corpse);

changing the range at which find item is executed

if (getDistance(me, unit) <= 12 &&
			!unit.getState(1) && // freeze
			!unit.getState(96) && // revive
			!unit.getState(99) && // redeemed
			!unit.getState(104) && // nodraw
			!unit.getState(107) && // shatter
			!unit.getState(118) // noselect

changing the range at which a viable corpse is recognized to attempt find item
this seems to cause my barb to occasionally skip corpses I would prefer he hork, but speeds things up so I choose to leave the distance shorter than the original

While these changes have absolutely reduced the number of times my barb gets stuck in a horking loop, it still happens. I was hoping there was something I could adjust somewhere to basically tell the bot to “only attempt 5 horks per corpse” so I don’t have to sit there wondering why he has tried to hork the same devilkin corpse for 30mins straight in one game, but in another decides to move on after 10 attempts.

I love the learning experience this bot offers, but also have very limited experience when it comes to coding. So I’m hoping there is something simple that is being overlooked, but would also really appreciate someone just saying “been there, tried that, can’t be fixed”

Thats the fix I submitted on the Git and they should change the range in the bot by default. Unfortunately what you are asking would require a recode of how the script actually horks and i dont know Js.