Page 1 of 2

Rock5's lootBodies function

Posted: Sun Jan 09, 2011 9:02 pm
by rock5
*** As of revision 597, this function has been incorporated into the bot so this userfunction is obsolete. Please do not use. ***
*** You can read about how to use the profile setting to loot all here under the "Looting" section. ***
*** This file will remain for awhile incase there are people who want to continue using an older version of the bot. ***

______________________________________________________________________________________________

Here is an updated version of my lootbodies function.

Description

When called tries to loot all lootable bodies in range.


Installation

Add the file to the "Userfunctions" folder.

Add the command

Code: Select all

lootBodies()
to the <onLeaveCombat> section of your profile.

You may want to also disable loot in combat as it is no longer necessary.

Code: Select all

<option name="LOOT_IN_COMBAT"		value="false" />
Features
  • Only loots out of combat.
  • Only loots bodies in range as set by 'LOOT_DISTANCE' in profile.
  • Doesn't loot if inventory is full.
  • Doesn't wait for the battle flag to clear so it loots faster.
  • Remembers last 10 bodies it couldn't loot in an ignore list.
  • With all the checks, this version should never 'get stuck' trying to loot.

Re: Rock5's lootBodies function

Posted: Sun Jan 09, 2011 9:13 pm
by jduartedj
You wrote:Installation

Add the file to the "Userfunctions" folder.
What file? xD

You probably should include the file!

Also you could add lootbodies to the wiki addon repository....

Take care

Re: Rock5's lootBodies function

Posted: Sun Jan 09, 2011 9:57 pm
by rock5
I wanted to create the thread first so I could add the link to the file but i just got a little sidetracked. I'm adding it now, and don't worry I will add it to the repository.

Re: Rock5's lootBodies function

Posted: Mon Jan 10, 2011 11:39 pm
by miximixi007
great :D

Re: Rock5's lootBodies function

Posted: Sat Jan 15, 2011 2:20 pm
by checkii
Thank Rock55, this is one of the most awesome add-on.

Re: Rock5's lootBodies function

Posted: Sat Jan 15, 2011 7:03 pm
by rock5
This is a message to everyone who uses this addon.

I'd like to know if anyone ever has any issues with this version, such as getting stuck trying to loot or repetitively trying to re-loot the same body or any other strange behavior, as I personally think there is no reason why we couldn't add this to the bot.

Re: Rock5's lootBodies function

Posted: Mon Jan 17, 2011 12:23 am
by miximixi007
miss loot sometime. if try to loot again would be better.

Re: Rock5's lootBodies function

Posted: Mon Jan 17, 2011 5:38 am
by rock5
miximixi007 wrote:miss loot sometime. if try to loot again would be better.
Why does it miss looting? What happens?

You could always use the profile option LOOT_AGAIN = 1000 to try again after 1 second.

Re: Rock5's lootBodies function

Posted: Mon Jan 17, 2011 1:30 pm
by miximixi007
I'll try it.

Re: Rock5's lootBodies function

Posted: Tue Jan 18, 2011 9:07 pm
by miximixi007
I saw the default value is 2000, should I change it from 2000 to 1000?
It seems didn't try to loot after kill mods sometimes.
and sometimes, new mod attack me when loot bodies, character will kill the mod and move to next waypoint.
and sometimes, if the body have five items, char pick up 4 items.
sry for my bad English

Re: Rock5's lootBodies function

Posted: Wed Jan 19, 2011 12:31 pm
by rock5
miximixi007 wrote:I saw the default value is 2000, should I change it from 2000 to 1000?
You're right, 2000 is the default. I don't think changing it will make any difference.
miximixi007 wrote:It seems didn't try to loot after kill mods sometimes.
This could be anything. It always seems to loot for me.
miximixi007 wrote:and sometimes, new mod attack me when loot bodies, character will kill the mod and move to next waypoint.
When using lootBodies it shouldn't ignore the lootable body just because you were attacked. The only time it should ignore it is if you failed to loot it for whatever reason. Then it would get added to the ignore list and wont be looted.

If you don't have lootbodies installed properly and you have the profile setting "LOOT_IN_COMBAT" set to false then that is how it would behave. It would stop looting if attacked then not loot that body again. Maybe you have to check that lootBodies is installed properly.
miximixi007 wrote:and sometimes, if the body have five items, char pick up 4 items.
sry for my bad English
RoMBot doesn't in any way control what you pick up. That is controlled by your ingame loot filter addon. You might also not pick up an item if you already have the maximum in your inventory. They're the only reasons I can think of right now.

Re: Rock5's lootBodies function

Posted: Tue Jan 25, 2011 2:08 am
by checkii
I use to have some looting problems, but after I updated to the latest revision it worked fine again.

Re: Rock5's lootBodies function

Posted: Wed Jan 26, 2011 5:27 am
by miximixi007
rock5 wrote:If you don't have lootbodies installed properly and you have the profile setting "LOOT_IN_COMBAT" set to false then that is how it would behave. It would stop looting if attacked then not loot that body again. Maybe you have to check that lootBodies is installed properly.
yes. i set LOOT_IN_COMBAT to false. i change it to true now.

Re: Rock5's lootBodies function

Posted: Sat Apr 16, 2011 5:20 am
by rock5
I've started work to incorporate lootbodies into the bot.

So far I've added an option to the profile "LOOT_ALL". If it's enabled it will look for dead mobs to loot when leaving combat. That's pretty much the way lootBodies() works now when added to onLeaveCombat.

But I'm thinking, shouldn't the loot all function be looking for bodies to loot all the time? Or just after combat?

What do you think?

Re: Rock5's lootBodies function

Posted: Sat Apr 16, 2011 11:12 pm
by lisa
Maybe have both LOOT_ALL and LOOT_IN_COMBAT.

LOOT_IN_COMBAT decides if you loot during combat or just after leaving combat.
LOOT_ALL decides if you use the loot bodies function or just loot 1 at a time

Re: Rock5's lootBodies function

Posted: Sun Apr 17, 2011 3:16 am
by rock5
I should have mentioned that I concider the "loot the mob you just killed and still have targeted" as different to the lootall function which searches for other bodies to loot. I wont mess with the original loot so LOOT_IN_COMBAT will work as it did before. I should also mention that lootall wont loot in combat. Just had another idea, I should add a check to see if you're mounted.

What I was asking was should it only do a lootall after combat or should it look for bodies to loot even when it's moving to a waypoint?

In the first case I can just put the lootall at the end of the fight function, just after the initial loot.

In the second case I would have to put it in the main loop or in the moveto function, I'm not sure yet where would be best.

Re: Rock5's lootBodies function

Posted: Sun Apr 17, 2011 8:20 am
by lisa
So you mean loot a corpse someone else has killed? Not sure I'd bother, if they left anything behind it is probably junk.

If you mean loot ones that have been aoe's down so you didn't actually target them, then yes that sounds good.

Re: Rock5's lootBodies function

Posted: Sun Apr 17, 2011 8:26 am
by rock5
In that case it would have to be after combat only. Although different people want different things so sometimes people might leave behind stuff that you want. But you make a good point and it's a good reason to stick to after combat only.

I'll see if I can put the final touches on it tomorrow and commit it.

Re: Rock5's lootBodies function

Posted: Mon Apr 18, 2011 9:17 am
by rock5
I've added 'loot all' profile options to the bot in rev 597. It functions similarly to my lootBodies() userfunction.

To use, set LOOT_ALL to true in the profile options.

Code: Select all

<option name="LOOT_ALL"				value="true" />
Things to note when using the loot all option:
  • It doesn't affect the functioning of the initial loot of the mob you just killed.
  • It only looks for bodies to loot after combat and after the initial loot of the mob you just killed.
  • It doesn't loot while battling. If "LOOT_IN_COMBAT" is enabled, it will only loot the mob you just killed in combat, no others.
  • If it fails to loot a mob for whatever reason, it will be added to an ignore list and it wont try to loot it again.
  • The default length of the ignore list is 10. If you want to change it you can use the profile option LOOT_IGNORE_LIST_SIZE.
  • Like the findEnemy function, the lootAll function wont collect loot from mobs whos distance from your waypoint path is more than MAX_TARGET_DIST. So you wont be led away from your path with a string of dead bodies.

Re: Rock5's lootBodies function

Posted: Mon Apr 18, 2011 7:44 pm
by lisa
sounds good, I'll give it a try today as I am hitting up some instances, aoe style ;)