Finding and looting dead bodies

Runes of Magic/Radiant Arcana (http://www.runesofmagic.com)
Message
Author
Petzzz
Posts: 12
Joined: Tue Nov 16, 2010 10:47 am

Re: Finding and looting dead bodies

#41 Post by Petzzz » Tue Dec 14, 2010 1:20 am

its the only way to get this working :)
because if someone enter your framspot kill some mobs but dont loot them you get stucked anyway what your settings says.
i tryed max fight distance = 50 (only mage aoe skills) max loot distance = 60 (sometimes we move a bit so the extra distance is needed) result = bot loots fine in my aoe range, but if a lootable mob is near (somthing betwen 150-225 range) bot says "start looting" but dont move.

i test it with skellet farm spot by boddypull. set the waypoints to travel at bombspot i changed them back to normal. works like a charm but if some other player enter the spot bot get stucked by his dead bodies.

workaround must be a timer. sure the bot will try to loot the same bodie again and again but only after the next lootbodies call. and this only happend if we kill the next mob result = we kill mobs and loot them, one mob is to far away, bot try to loot, get stucked for ?5 sec, skip looting, move to next position, kill next mob wave and now the dead bodie we cant loot last time is now in range so he still get the loot.
sorry for my very bad english but i realy try my best :)
Petz

wizzyslo
Posts: 119
Joined: Sun Nov 01, 2009 6:09 pm

Re: Finding and looting dead bodies

#42 Post by wizzyslo » Sat Dec 18, 2010 7:54 am

I'm testing this function and have little problem with full inventory :lol: Wonderful can be function to check inventory space befoure lootBodies() else skip lootBodies().

User avatar
jduartedj
Posts: 599
Joined: Sat Dec 19, 2009 12:18 am
Location: Lisbon
Contact:

Re: Finding and looting dead bodies

#43 Post by jduartedj » Sat Dec 18, 2010 11:11 am

atm inventory is a little broken specially on detecting empty spaces but the code should be...

Code: Select all

inventory:itemTotalCount(0)
this gives you the number of empty spaces on your bag and allows you to check for that yourself.
Thanks for reading! :D

Some of you might find this useful: RoM-bot Wiki
User Functions Repository (and other useful files): Addon Repo
Latest SVN updates: SVN updates

wizzyslo
Posts: 119
Joined: Sun Nov 01, 2009 6:09 pm

Re: Finding and looting dead bodies

#44 Post by wizzyslo » Sat Dec 18, 2010 12:01 pm

Wich function is to move to next waypoint?
Tested as:
player:moveTo( CWaypoint(waypoint.X, waypoint.Z), true ); rly not works
and
player:moveTo( CWaypoint(nX, nZ), true ); works somehow but dont go to next waypoint.

help pls :roll:
Last edited by wizzyslo on Sat Dec 18, 2010 2:05 pm, edited 1 time in total.

User avatar
jduartedj
Posts: 599
Joined: Sat Dec 19, 2009 12:18 am
Location: Lisbon
Contact:

Re: Finding and looting dead bodies

#45 Post by jduartedj » Sat Dec 18, 2010 2:02 pm

That is meant to move to a specific location point.

But going to the next waypoint is default! So you should do this:

If "more than X empty spaces" then
"loot bodies"
end

So it only loots if you have empty spaces.
Thanks for reading! :D

Some of you might find this useful: RoM-bot Wiki
User Functions Repository (and other useful files): Addon Repo
Latest SVN updates: SVN updates

wizzyslo
Posts: 119
Joined: Sun Nov 01, 2009 6:09 pm

Re: Finding and looting dead bodies

#46 Post by wizzyslo » Sun Dec 19, 2010 3:59 am

Tested next code but dont works

Code: Select all

function lootBodies()
	repeat
	player:update()
		if inventory:itemTotalCount(1) then
			local Lootable = player:findEnemy(false, nil, evalTargetLootable)
			if Lootable and player.Battling == false then
				player:target(Lootable)
				player.TargetPtr = Lootable.Address
				player:loot()
			end
		end
	until not Lootable or player.Battling
end
Is bot detect inventory:itemTotalCount(1) as item ID in inventory?

User avatar
jduartedj
Posts: 599
Joined: Sat Dec 19, 2009 12:18 am
Location: Lisbon
Contact:

Re: Finding and looting dead bodies

#47 Post by jduartedj » Sun Dec 19, 2010 12:50 pm

the code is 0 not 1, try this instead

Code: Select all

inventory:itemTotalCount(0) > 1
Given that you need more than 1 Empty bag slot to loot. If you want to sure at least 2 use "> 2" and so on.
Thanks for reading! :D

Some of you might find this useful: RoM-bot Wiki
User Functions Repository (and other useful files): Addon Repo
Latest SVN updates: SVN updates

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

Re: Finding and looting dead bodies

#48 Post by rock5 » Sun Dec 19, 2010 1:25 pm

jduartedj wrote:Given that you need more than 1 Empty bag slot to loot. If you want to sure at least 2 use "> 2" and so on.
Why do you need more than 1 empty to loot? If you have 1 empty can't you loot? Maybe you mean

Code: Select all

inventory:itemTotalCount(0) > 0
Meaning if you have at least 1 empty.
wizzyslo wrote:Tested next code but dont works
I'm not sure the 'local Lootable' variable will make it out of the if statement. i think you need to declare it first. try,

Code: Select all

function lootBodies()
	repeat
		local Lootable
		player:update()
		if inventory:itemTotalCount(0) > 0 then
			Lootable = player:findEnemy(false, nil, evalTargetLootable)
			if Lootable and player.Battling == false then
				player:target(Lootable)
				player.TargetPtr = Lootable.Address
				player:loot()
			end
		end
	until not Lootable or player.Battling
end
And now that I've released rev 548 of the rombot, itemTotalCount should work again. :)
  • 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

User avatar
jduartedj
Posts: 599
Joined: Sat Dec 19, 2009 12:18 am
Location: Lisbon
Contact:

Re: Finding and looting dead bodies

#49 Post by jduartedj » Sun Dec 19, 2010 1:39 pm

Yes, ofc Rock5. the thing is he might want to secure 2 or more free slots in case the loots has more than 1 item. But that is just my take, >0 is perfectly ok.
I, for one, have a check at the end of my waypoint file. that if I have 3 or less empty slots I load a merchant path to go sell stuff. So I guarantee that the bag isn't full most of the time.
Thanks for reading! :D

Some of you might find this useful: RoM-bot Wiki
User Functions Repository (and other useful files): Addon Repo
Latest SVN updates: SVN updates

checkii
Posts: 50
Joined: Sat Oct 09, 2010 8:50 pm

Re: Finding and looting dead bodies

#50 Post by checkii » Thu Dec 23, 2010 4:38 am

As you all know sometimes the bot get stuck looting something it can't reach. I had this idea to put in the number of times the bot loots. Once it loots over a certain times it will stop looting and continue on its way. Assuming no one is going to kill over 10 mobs at a time, I have modified it to break the cycle after looting 10 times.

Code: Select all

function lootBodies()
   repeat
      local Lootable
      local count
      player:update()
      if inventory:itemTotalCount(0) > 0 then
         Lootable = player:findEnemy(false, nil, evalTargetLootable)
         if Lootable and player.Battling == false then
            player:target(Lootable)
            player.TargetPtr = Lootable.Address
            player:loot()
            count = count + 1
         end
      end
   until not Lootable or player.Battling or count == 10
end
Can anyone tell me if this works?

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

Re: Finding and looting dead bodies

#51 Post by rock5 » Thu Dec 23, 2010 8:41 am

checkii wrote:As you all know sometimes the bot get stuck looting something it can't reach. I had this idea to put in the number of times the bot loots. Once it loots over a certain times it will stop looting and continue on its way. Assuming no one is going to kill over 10 mobs at a time, I have modified it to break the cycle after looting 10 times.

Code: Select all

function lootBodies()
   repeat
      local Lootable
      local count
      player:update()
      if inventory:itemTotalCount(0) > 0 then
         Lootable = player:findEnemy(false, nil, evalTargetLootable)
         if Lootable and player.Battling == false then
            player:target(Lootable)
            player.TargetPtr = Lootable.Address
            player:loot()
            count = count + 1
         end
      end
   until not Lootable or player.Battling or count == 10
end
Can anyone tell me if this works?
The code looks fine but do you realize, if it gets stuck, it will try to loot the same mob 10 times ignoring other bodies? And when it finally gives up it wont loot the other bodies? What's probably needed, as well as a counter, is an 'ignore address'. So if it gets stuck it will move on to the next body. It might go back to the first body but, if it gets stuck again, will move on to the next body. The problem is if you have more than 1 body you can't reach and it goes back and forth trying to loot them. That's where a counter would help to stop the cycle.

I intend to release an updated version which will include suggestions from users. Hopefully it won't be much longer.
  • 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

User avatar
botje
Posts: 656
Joined: Wed Oct 27, 2010 7:17 am

Re: Finding and looting dead bodies

#52 Post by botje » Thu Dec 23, 2010 8:46 am

dont want to be a ungratefull bitch or whatever, but what about fixing the damn stuck at 67% bug first? xd

seems more important then other addons to the bot if ya ask me :)

Botje

checkii
Posts: 50
Joined: Sat Oct 09, 2010 8:50 pm

Re: Finding and looting dead bodies

#53 Post by checkii » Thu Dec 23, 2010 12:32 pm

botje wrote:dont want to be a ungratefull bitch or whatever, but what about fixing the damn stuck at 67% bug first? xd

seems more important then other addons to the bot if ya ask me :)

Botje
There already multiple threads about this. It very bad form to hijack/off topic another thread, please don't do it.

Rock5, its no biggie. I am just trying to find an intermediate solution. Its better than the bot getting stuck there for 10mins (or however long it takes for the dead mob to leave).

User avatar
botje
Posts: 656
Joined: Wed Oct 27, 2010 7:17 am

Re: Finding and looting dead bodies

#54 Post by botje » Thu Dec 23, 2010 6:20 pm

im in no way hyjacking a thread, just pointing out there should be things done first before adding to the bot as is.

O.o

Botje

User avatar
Administrator
Site Admin
Posts: 5307
Joined: Sat Jan 05, 2008 4:21 pm

Re: Finding and looting dead bodies

#55 Post by Administrator » Fri Dec 24, 2010 12:16 am

botje wrote:im in no way hyjacking a thread, just pointing out there should be things done first before adding to the bot as is.

O.o

Botje
How do you propose we fix something when we don't even know what the problem is and do not have the time in our lives to devote to fixing it? I have *still* never been able to reproduce the problem, so I absolutely cannot debug it at all, nor can I even attempt to fix it (as I would be unable to test any changes).

User avatar
botje
Posts: 656
Joined: Wed Oct 27, 2010 7:17 am

Re: Finding and looting dead bodies

#56 Post by botje » Fri Dec 24, 2010 5:23 am

yeah, thats a problem indeed >.<

"luckely" Rock has it, so not all is lost though :)

and yeah, time is short around these days, trust me i know.

Botje

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

Re: Finding and looting dead bodies

#57 Post by rock5 » Sun Jan 09, 2011 9:05 pm

I've updated my lootBodies function and created a dedicated thread for it here.
http://www.solarstrike.net/phpBB3/viewt ... =27&t=2018
  • 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

Post Reply

Who is online

Users browsing this forum: Ahrefs [Bot] and 4 guests