Need a selective loot function

Runes of Magic/Radiant Arcana (http://www.runesofmagic.com)
Post Reply
Message
Author
sparky
Posts: 8
Joined: Wed Apr 10, 2013 12:24 pm

Need a selective loot function

#1 Post by sparky » Fri May 10, 2013 7:20 pm

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

kuripot
Posts: 493
Joined: Mon Nov 07, 2011 9:14 pm

Re: Need a selective loot function

#2 Post by kuripot » Sat May 11, 2013 1:20 am

you need loot_all set in true/// it mean it will loot all dead body

User avatar
rock5
Posts: 12173
Joined: Tue Jan 05, 2010 3:30 am
Location: Australia

Re: Need a selective loot function

#3 Post by rock5 » Sat May 11, 2013 7:18 am

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.

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
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?
  • 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

sparky
Posts: 8
Joined: Wed Apr 10, 2013 12:24 pm

Re: Need a selective loot function

#4 Post by sparky » Sat May 11, 2013 11:53 am

Wow! Thanks rock! Works like a champ!

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>
I'd love to see a few loot options added, such as:

lootall = true, false, lootonlythese, lootallbutthese

C3PO
Posts: 109
Joined: Sun Jul 10, 2011 2:45 pm

Re: Need a selective loot function

#5 Post by C3PO » Mon Jul 01, 2013 10:48 am

Hello,

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
    !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
but that's not what I want. 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?

User avatar
lolita
Posts: 139
Joined: Thu Oct 20, 2011 5:39 am
Location: Serbia

Re: Need a selective loot function

#6 Post by lolita » Mon Jul 01, 2013 11:24 am

C3PO 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?
I think it's done already with Cleanbag userfunction
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"
   }
in file
Life is a journey, not destination :D

Post Reply

Who is online

Users browsing this forum: No registered users and 8 guests