party looting

Runes of Magic/Radiant Arcana (http://www.runesofmagic.com)
Message
Author
CNKTHoward
Posts: 32
Joined: Thu Jul 12, 2012 8:31 am

party looting

#1 Post by CNKTHoward »

Hi guys!

I have made some waypoint files for DoD for a group, but there are some problems when looting. If every partymember runs to the boss to loot him, only one is able to loot, the others can't open his "bag" (interface message) and then they run leave the mementos in there.

This is how my bots are looting. It also checks, if a member is a priest and is then healing the others.

Code: Select all

	<!-- #  7 --><waypoint x="2282" z="2418" y="401">
		local main, second = RoMScript("UnitClass('player')")
		if (main == "Priester") then
			BossFightHeal();
		end
		changeProfileOption("LOOT", true);
		changeProfileOption("LOOT_ALL", true);
		player:lootAll();
		changeProfileOption("LOOT", false);
		changeProfileOption("LOOT_ALL", false);
	</waypoint>
This code does only try to loot once, and not until the boss is empty. Is there a way to repeat until the bot gets the mementos or until the mob doesn't have any more loot?

edit: There is another problem. If the boss knocks back my bots, they skip the waypoint and don't loot the boss. Can I force the bot to loot at that waypoint in any case?

edit2: This is a bit off-topic, but still of my interest. Sometimes, there is no portal in DoD, so the bots can't leave the instance anymore. Is there a way to force the bot to get out of there? I have a return file for ressurection point -> DoD.
User avatar
Ego95
Posts: 564
Joined: Tue Feb 28, 2012 12:38 pm
Contact:

Re: party looting

#2 Post by Ego95 »

I've got the same "off-topic-problem". I think the best you can do, is a group reset like

Code: Select all

SlashCommand("ILG destroy")
(is ghis the right command? I'm not home now.) and after that start the main/party_return.

Btw why do you write a party script, if you configure it, the script of Xmen's main/party is working well.
CNKTHoward
Posts: 32
Joined: Thu Jul 12, 2012 8:31 am

Re: party looting

#3 Post by CNKTHoward »

yes, my script does work perfectly.

Still, the looting issue is not fixed.

I'd have the looting issue with Xmen's script as well, and it's easier (for me) to change my own script rather than another one.
User avatar
lisa
Posts: 8332
Joined: Tue Nov 09, 2010 11:46 pm
Location: Australia

Re: party looting

#4 Post by lisa »

Add this to the onload of your WP and see if it helps.

I'd need to test if mob corpse stays as Lootable if party members can loot it but you can't. It will probably work though. At worst it will just try looting for 30 seconds and then give up.

Code: Select all

settings.profile.events.onLeaveCombat = function() 
	yrest(math.random(10000)) -- 10 seconds
	lootstart = os.time()
	repeat
		local Lootable = player:findEnemy(false, nil, evalTargetLootable)
		player:target(Lootable)
		player:loot()
		Lootable:update();
	until Lootable == nil or (os.time() - lootstart >= 30)
end
If it was me I would put that code at the waypoint before the boss and then reset the event to nothing at waypoint after boss so you don't have the pause on every mob killed but that's just me lol

Mind you I think that when madman does his jump the bot thinks it leaves combat, would need testing I guess.
Remember no matter you do in life to always have a little fun while you are at it ;)

wiki here http://www.solarstrike.net/wiki/index.php?title=Manual
User avatar
rock5
Posts: 12173
Joined: Tue Jan 05, 2010 3:30 am
Location: Australia

Re: party looting

#5 Post by rock5 »

What's that 'return' doing at the beginning of the functions?

I don't think it is necessarily a bad thing that it waits for the mobs to become unlootable because that means that all party members will start moving again after the last member has looted the body and it disappears. So it's a good way to keep them syncronised. Otherwise, if it's mainly to do with mementos, you could have it loot until it's memento count has gone up.
  • 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
lisa
Posts: 8332
Joined: Tue Nov 09, 2010 11:46 pm
Location: Australia

Re: party looting

#6 Post by lisa »

rock5 wrote:What's that 'return' doing at the beginning of the functions?
You mean the code I posted?

That is how we have always defined the code for the profile events outside of the profile. I've never tried to do it any other way.
Remember no matter you do in life to always have a little fun while you are at it ;)

wiki here http://www.solarstrike.net/wiki/index.php?title=Manual
User avatar
rock5
Posts: 12173
Joined: Tue Jan 05, 2010 3:30 am
Location: Australia

Re: party looting

#7 Post by rock5 »

lisa wrote:settings.profile.events.onLeaveCombat() = function() return
I think that will cause a syntax error because after a return statement there has to be a logical end. You can't follow it by code.

Example;
function
if something then
return
end
more code
end
is ok.

Code: Select all

function
   return
   more code
end
will error.
  • 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
lisa
Posts: 8332
Joined: Tue Nov 09, 2010 11:46 pm
Location: Australia

Re: party looting

#8 Post by lisa »

Just spent about 30 mins looking through old posts, I was sure you were the one that said to do the return lol
Closest I came to was this from survival WP

Code: Select all

settings.profile.events.onPreSkillCast = function() return trashhp() end -- deals with trash hp.
It probably works in that case as it just returns the value returned by the other function, I edited the code in previous post =)

Hopefully I will remember not to add it in anymore.
Remember no matter you do in life to always have a little fun while you are at it ;)

wiki here http://www.solarstrike.net/wiki/index.php?title=Manual
CNKTHoward
Posts: 32
Joined: Thu Jul 12, 2012 8:31 am

Re: party looting

#9 Post by CNKTHoward »

lisa wrote: If it was me I would put that code at the waypoint before the boss and then reset the event to nothing at waypoint after boss so you don't have the pause on every mob killed but that's just me lol

Mind you I think that when madman does his jump the bot thinks it leaves combat, would need testing I guess.
I have all looting functions disabled and they only get enabled at the WP right in the boss room, so no looting of trash mobs.

I don't have a problem with the boss jumping, since he won't live that long ;)

I'll try the WP later and let you know, if it works just fine.

PS: Does this code actually override my profiles <onLeaveCombat> or just add the function to it?


edit: @lisa: I tried your code, it does not work. The code cannot be compiled. I haven't found the issue though yet
User avatar
lisa
Posts: 8332
Joined: Tue Nov 09, 2010 11:46 pm
Location: Australia

Re: party looting

#10 Post by lisa »

CNKTHoward wrote:PS: Does this code actually override my profiles <onLeaveCombat> or just add the function to it?
Yes it will over ride any existing data in the "function", if you want to add it then you will need to check function already exists and if it does then add the 2 together as such.
CNKTHoward wrote:dit: @lisa: I tried your code, it does not work. The code cannot be compiled. I haven't found the issue though yet
Did you do the code without the "return" or with it, I did edit it but yeah I will have to test it out to make sure.


--=== Edit ===--
Slaps forehead, I think I was half asleep when I posted the code, I edited previous post, I had an extra "()" in it =(
Tested and works fine but still over rides any existing code in the event.
Remember no matter you do in life to always have a little fun while you are at it ;)

wiki here http://www.solarstrike.net/wiki/index.php?title=Manual
CNKTHoward
Posts: 32
Joined: Thu Jul 12, 2012 8:31 am

Re: party looting

#11 Post by CNKTHoward »

tried both, return and without return. I take it you tested it without a return.

I'll test it later. It works almost perfect (sometimes they don't loot - I have multiple player:loot() calls) and I don't want to ruin anything^^

You said you tested it, so ...

"I'd need to test if mob corpse stays as Lootable if party members can loot it but you can't. It will probably work though. At worst it will just try looting for 30 seconds and then give up."

What's your result?
User avatar
lisa
Posts: 8332
Joined: Tue Nov 09, 2010 11:46 pm
Location: Australia

Re: party looting

#12 Post by lisa »

Ok tested this and works perfectly, for me lol

Code: Select all

oldleave = settings.profile.events.onLeaveCombat 
settings.profile.events.onLeaveCombat = function() 
	if oldleave then
		oldleave()
	end
	yrest(math.random(10000))
	lootstart = os.time()
	local Lootable = player:findEnemy(false, nil, evalTargetLootable)
	if Lootable then
		repeat
			player:target(Lootable)
			player:loot()
			Lootable:update();
		until Lootable == nil or (os.time() - lootstart >= 30)
	end
end
pop that in the onload section of the WP, it will add the code to any existing onleavecombat code.
Remember no matter you do in life to always have a little fun while you are at it ;)

wiki here http://www.solarstrike.net/wiki/index.php?title=Manual
User avatar
lisa
Posts: 8332
Joined: Tue Nov 09, 2010 11:46 pm
Location: Australia

Re: party looting

#13 Post by lisa »

I guess you could also try this

Code: Select all

  <!-- #  7 --><waypoint x="2282" z="2418" y="401">
      local main, second = RoMScript("UnitClass('player')")
      if (main == "Priester") then
         BossFightHeal();
      end
      changeProfileOption("LOOT", true);
      changeProfileOption("LOOT_ALL", true);
		yrest(math.random(10000))
		lootstart = os.time()
		local Lootable = player:findEnemy(false, nil, evalTargetLootable)
		if Lootable then
			repeat
				player:target(Lootable)
				player:loot()
				Lootable:update();
			until Lootable == nil or (os.time() - lootstart >= 30)
		end
      changeProfileOption("LOOT", false);
      changeProfileOption("LOOT_ALL", false);
   </waypoint>
Remember no matter you do in life to always have a little fun while you are at it ;)

wiki here http://www.solarstrike.net/wiki/index.php?title=Manual
CNKTHoward
Posts: 32
Joined: Thu Jul 12, 2012 8:31 am

Re: party looting

#14 Post by CNKTHoward »

seems to work fine. thanks lisa!
CNKTHoward
Posts: 32
Joined: Thu Jul 12, 2012 8:31 am

Re: party looting

#15 Post by CNKTHoward »

I need to check if all the groupmembers are in the boss room before they fight.

Code: Select all

repeat
	yrest(100)
until checkGroup(20) == true
yrest(1000)
The problem is, that if one already checks if the group is complete and the others join, the first one runs before the others can successfully check. So I'd need a way to check, if the player state changes from NOT BATTELING to BATTLEING

Code: Select all

player.Battling
But how can I check if the state actually changes? I could write a repeat until player.Battling, but one member might still be battling one of the trashmobs :/
CNKTHoward
Posts: 32
Joined: Thu Jul 12, 2012 8:31 am

Re: party looting

#16 Post by CNKTHoward »

sry for double post.

There is another problem with your loot function. It seems the loot function is causing the client to crash (I get this typical critical error from RoM). It is looting the boss on WP #7 though, but crashes afterwards. This doesn't happen all the time (1 time out of 10 tries). Suggestions?

MM loads this WP:

Code: Select all

	<!-- #	8 --><waypoint x="2224" z="2485" y="401">
		changeProfileOption("LOOT", true);
		changeProfileOption("LOOT_ALL", true);
		lootMob();
		changeProfileOption("LOOT", false);
		changeProfileOption("LOOT_ALL", false);
	</waypoint>
lootMob()

Code: Select all

		function lootMob() 
			yrest(math.random(1000))
				lootstart = os.time()
				local Lootable = player:findEnemy(false, nil, evalTargetLootable)
				if Lootable then
					repeat
						player:target(Lootable)
						player:loot()
						Lootable:update();
				until Lootable == nil or (os.time() - lootstart >= 10)
			end
		end
MM log:
Clear target (lösche ziel).
Wir gehen zum Wegpunkt #8 (2224, 2485) (loading WP #8)
Clear target (lösche ziel).
-- Here it gets stuck. So no Option-change call or what so ever.

edit: On WP #7 where the character is looting, it stands around for some time, rapidly calling multiple times "clear target", then continuing to WP #8 and then the client is crashing.

edit2: a little sidequestion:
Can I change the following call:

Code: Select all

local Lootable = player:findEnemy(false, nil, evalTargetLootable)
so that it only loots the first DoD boss?

edit3:
Alright, the character tries to loot the boss, succeeds, but then tries to loot the other dead trash mobs (for some reason, Loot Distance is at 125). It clears the target hundreds of times and then I get the message, if "we got stuck" (rooted to the spot). Then MM puts out, that the mob couldn't have been looted, then the client crashes. Then MM tries to unroot the character.
This doesn't happen with the second groupmember though - it works perfectly with it.

This is WP #7 and WP #8. I deleted the changeProfileOptions, because I thought they might cause this problem (they didn't though). Maybe my RoMScript creates this issue?

Code: Select all

	<!-- #	7 --><waypoint x="2282" z="2418" y="401">
		changeProfileOption("LOOT", true);
		changeProfileOption("LOOT_ALL", true);
		local main, second = RoMScript("UnitClass('player')")
		
		if (main == "Priester" and second == "Ritter") then
			BossFightHeal();
		end
		lootMob();
	</waypoint>	
	<!-- #	8 --><waypoint x="2224" z="2485" y="401">
		lootMob();
		changeProfileOption("LOOT", false);
		changeProfileOption("LOOT_ALL", false);
	</waypoint>
User avatar
rock5
Posts: 12173
Joined: Tue Jan 05, 2010 3:30 am
Location: Australia

Re: party looting

#17 Post by rock5 »

Code: Select all

            local Lootable = player:findEnemy(false, nil, evalTargetLootable)
            if Lootable then
If no enemy is found then Lootable will = nil. So this 'if' statement works. But ...

Code: Select all

Lootable:update();
until Lootable == nil or (os.time() - lootstart >= 10)
Lootable:update(), though, does not nil the variable so it will always do the loop for the full 10 seconds. Add to that that there is no yrest in the loop and you get cpu spike and client crash.

So change the "until" statement

Code: Select all

until Lootable.Id == 0 or (os.time() - lootstart >= 10)
And add a small yrest in the loop.
  • 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
CNKTHoward
Posts: 32
Joined: Thu Jul 12, 2012 8:31 am

Re: party looting

#18 Post by CNKTHoward »

is there a limitation of how small the yrest may be?
User avatar
rock5
Posts: 12173
Joined: Tue Jan 05, 2010 3:30 am
Location: Australia

Re: party looting

#19 Post by rock5 »

Even 50ms would do, I think. That's 20 times a second. Plenty.
  • 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
CNKTHoward
Posts: 32
Joined: Thu Jul 12, 2012 8:31 am

Re: party looting

#20 Post by CNKTHoward »

Thanks rock5, works like a charm! :)
Post Reply