I have the bot running around killing only mobs named in <mobs> definition, and then loot. Loot all = false, loot in combat = true.
The problem comes from using AOE to kill the mob and everything around it. If there are more than one named mob killed, only the first gets looted. I need a short function to loot the other dead named mobs.
I can't turn on loot all, otherwise all the trash mobs from AOE get looted too.
I'm thinking a simple function added after <onLeaveCombat>
check for nearby dead/lootable targets
for each, if name defined in <mobs> then loot
I don't know lua well enough to write it though I'd appreciate any help with this!
Thanks
Need a selective loot function
Re: Need a selective loot function
you need loot_all set in true/// it mean it will loot all dead body
Re: Need a selective loot function
There is no way to do that with the current functions.
My first idea was to just copy lootAll and modify it but it uses findNearestNameOrId while using the evalTargetLootable eval function. So I think what we will actually have to do is hook into the evalTargetLootable. Something like this.Put this in the onload of a waypoint or create a userfunction file for it if you want it to always be in effect.
This should cause the lootall function to loot only mobs in the "mobs" list. If there is no mobs list then it will loot all. It wont affect looting the mob you are directly attacking.
I wonder if this should be added to the bot as an option. Anyone have an opinion on that?
My first idea was to just copy lootAll and modify it but it uses findNearestNameOrId while using the evalTargetLootable eval function. So I think what we will actually have to do is hook into the evalTargetLootable. Something like this.
Code: Select all
if evalTargetLootableOrig == nil then evalTargetLootableOrig = evalTargetLootable end
function evalTargetLootable(address, target)
if not target or not target.HP then
target = CPawn.new(address)
end
-- First check the original function
local result = evalTargetLootableOrig(address, target)
-- Further check if it's on the mob list
if settings.profile.mobs and result == true then
if not player:isInMobs(target) then
result = false
end
end
return result
end
This should cause the lootall function to loot only mobs in the "mobs" list. If there is no mobs list then it will loot all. It wont affect looting the mob you are directly attacking.
I wonder if this should be added to the bot as an option. Anyone have an opinion on that?
- Please consider making a small donation to me to support my continued contributions to the bot and this forum. Thank you. Donate
- I check all posts before reading PMs. So if you want a fast reply, don't PM me but post a topic instead. PM me for private or personal topics only.
- How to: copy and paste in micromacro
________________________
Quote:- “They say hard work never hurt anybody, but I figure, why take the chance.”
- Ronald Reagan
Re: Need a selective loot function
Wow! Thanks rock! Works like a champ!
I put it in the waypoint file, as you suggested, and turned loot all on.
I'd love to see a few loot options added, such as:
lootall = true, false, lootonlythese, lootallbutthese
I put it in the waypoint file, as you suggested, and turned loot all on.
Code: Select all
<?xml version="1.0" encoding="utf-8"?><waypoints>
<onload>
if evalTargetLootableOrig == nil then evalTargetLootableOrig = evalTargetLootable end
function evalTargetLootable(address, target)
if not target or not target.HP then
target = CPawn.new(address)
end
-- First check the original function
local result = evalTargetLootableOrig(address, target)
-- Further check if it's on the mob list
if settings.profile.mobs and result == true then
if not player:isInMobs(target) then
result = false
end
end
return result
end
</onload>
<!-- # 1 --><waypoint x="-14317" z="34821" y="106"> </waypoint>
<!-- # 2 --><waypoint x="-14359" z="34731" y="103"> </waypoint>
</waypoints>
lootall = true, false, lootonlythese, lootallbutthese
Re: Need a selective loot function
Hello,
I would also like to loot selective, but not on mobs. I'd like to loot only special Items.
I would also like to loot selective, but not on mobs. I'd like to loot only special Items.
- !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
I know lootomatic and so on
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
Re: Need a selective loot function
I think it's done already with Cleanbag userfunctionC3PO wrote:So the question is: is it possible to loot everything the mob offers, and drop all item's (that where looted and) that are not in the list?
http://solarstrike.net/phpBB3/viewtopic ... 413#p25413
you just need to setup
Code: Select all
-- custom database for user added items to trow out
forcedrop = {
"Lost Gift",
}
-- custom database for user added items to keep
forcekeep = {
"Blend Rune",
"Phirius Potion - Type A",
"Phirius Potion - Type B",
"Phirius Elixir - Type A",
"Phirius Elixir - Type B"
}
Life is a journey, not destination
Who is online
Users browsing this forum: No registered users and 8 guests