Teaming & Aggro Issue

Runes of Magic/Radiant Arcana (http://www.runesofmagic.com)
Message
Author
User avatar
Administrator
Site Admin
Posts: 5330
Joined: Sat Jan 05, 2008 4:21 pm

Re: Teaming & Aggro Issue

#21 Post by Administrator » Mon Mar 21, 2011 9:53 am

lisa wrote: Bot has to start attacking, so it has already decided player:fighting and then you heal it before the mob fights back. So with the memory targeting it doesn't actually get a physical target until the mob attacks you which means any heals or buffs makes the physical target the player healing/buffing.
You know, I've never thought of that, but it makes perfect sense. Good observation.

User avatar
lisa
Posts: 8332
Joined: Tue Nov 09, 2010 11:46 pm
Location: Australia

Re: Teaming & Aggro Issue

#22 Post by lisa » Mon Mar 21, 2011 8:43 pm

I'm curious if there is a way to make the memory target also the physical target? So bot decides it is going to attack something and then code makes it also physically target it? would also help with the assist from other bots.
A romscript target by GUID maybe.
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: Teaming & Aggro Issue

#23 Post by lisa » Mon Mar 21, 2011 10:12 pm

rock5 wrote:Not sure why that happened. I'm pretty sure there should be a check to see if the target is a mob.

I just had a look. The eval function checks to see if the target is attackable, which players aren't so it shouldn't try to attack.

Anyway I found the party member names in memory. I've whipped up a userfunctions file to test it out. Try it out.
userfunction_GetPartyNames.lua
Just use GetPartyMemberName(n) to return the name of party member 'n'.

I'll try and incorporate it in the bot tomorrow.
Yup getting party names works, I only did it with first member though, haven't tested full party.
Just to double check would the address of the first party member be "listAddress" which is the same as

Code: Select all

listAddress + (1 - 1) * 0x60
Because the addresses don't match up when I use a printf for that address and pawn.TargetPtr. I tried pawn.TargetPtr.Name but it wouldn't work.

Atm I am still trying to compare party member with the targets target. whether name or address I still just can't get it right.

Code: Select all

	local listAddress = memoryReadRepeat("int", getProc(), partyMemberList_address ) + partyMemberList_offset
	local memberAddress = listAddress + (1 - 1) * 0x60
 printf("" ..pawn.TargetPtr.. ".ToT\n") printf("" ..memberAddress.. ".Party\n")
prints this

Code: Select all

637859072.ToT
40671744.Party
GetPartyMemberName(1) prints the correct name though.
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: Teaming & Aggro Issue

#24 Post by rock5 » Mon Mar 21, 2011 11:23 pm

The way it works is listAddress is the start of the list. Each member is in a block of 0x60. The first byte tells you if there is a member at that number and 8 bytes after that is the start of the members name. There are some other numbers in that block but i don't know what they mean.

The memberAddress is not the same as the members pawn address. it is just the address that that members party info starts. I don't think it's possible to get a members pawn address if he is not near by. I think you need to do a name comparison.
  • 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: Teaming & Aggro Issue

#25 Post by lisa » Mon Mar 21, 2011 11:58 pm

ahh that explains it, hmm the romscript UnitName isn't working for this, seems to only work if you have a physical target and not when you have memory target.

have to come up with a new plan then.
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: Teaming & Aggro Issue

#26 Post by rock5 » Tue Mar 22, 2011 12:32 am

Why do you need to use 'UnitName'? I thought what we were trying to do is identify if a mob has you or your party members targeted so that you could attack it. I thought what we needed to do was scan the area for pawns using the memory functions s usual, check the targets target address against your own and check the targets targets name with the party members using my new function.
  • 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: Teaming & Aggro Issue

#27 Post by lisa » Tue Mar 22, 2011 12:34 am

little breakthrough atleast. I added a check for the address I got already from my testing and it works perfectly. Protects party member anytime it is attacked.


So trick now is to be able to make it detect the actual address of the party members for it to compare to pawn.TargetPtr.

Code: Select all

	local SCORE_FRIEND = 150; -- lower health = more score

Code: Select all

				if( evalFunc(obj.Address) == true ) then printf(""..pawn.TargetPtr..".ToT\n") if (pawn.TargetPtr == 268053760) then printf("Omg it's targeting a party member.\n") else printf("nope\n") end 
					if( distance(self.X, self.Z, pawn.X, pawn.Z ) < settings.profile.options.MAX_TARGET_DIST and
					(( (pawn.TargetPtr == self.Address or (pawn.TargetPtr == self.PetPtr and self.PetPtr ~= 0) or pawn.TargetPtr == 268053760 ) and
					aggroOnly == true) or aggroOnly == false) ) then
						local currentScore = 0;
						currentScore = currentScore + ( (settings.profile.options.MAX_TARGET_DIST - dist) / settings.profile.options.MAX_TARGET_DIST * SCORE_DISTANCE );
						currentScore = currentScore + ( (pawn.MaxHP - pawn.HP) / pawn.MaxHP * SCORE_HEALTHPERCENT );
						if ( pawn.TargetPtr == 268053760) then  currentScore = currentScore + SCORE_FRIEND; end;
						if( pawn.TargetPtr == self.Address ) then currentScore = currentScore + SCORE_ATTACKING; end;
						if( pawn.Aggressive ) then
							currentScore = currentScore + SCORE_AGGRESSIVE;
						end;
Looks like this atm, obviously this won't work until we can detect the address of party members. So I created a new score for friends, prob better to call it SCORE_PARTY but either way it is working.



Edit: lol completely forgot about the romscript for party names, lemme add it in
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: Teaming & Aggro Issue

#28 Post by lisa » Tue Mar 22, 2011 12:37 am

sorry trouble is getting the name of the targets target, I can't get that to work.
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: Teaming & Aggro Issue

#29 Post by rock5 » Tue Mar 22, 2011 12:41 am

lisa wrote:So trick now is to be able to make it detect the actual address of the party members for it to compare to pawn.TargetPtr.
Can't you compare by name? eg

Code: Select all

if CPawn(target.targetPtr).Name == GetPartyMemberName(1) then
    -- target has party member 1 targeted
end
  • 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
Administrator
Site Admin
Posts: 5330
Joined: Sat Jan 05, 2008 4:21 pm

Re: Teaming & Aggro Issue

#30 Post by Administrator » Tue Mar 22, 2011 2:08 am

lisa wrote:I'm curious if there is a way to make the memory target also the physical target? So bot decides it is going to attack something and then code makes it also physically target it? would also help with the assist from other bots.
A romscript target by GUID maybe.
Maybe, but it might require modification of the client.

User avatar
lisa
Posts: 8332
Joined: Tue Nov 09, 2010 11:46 pm
Location: Australia

Re: Teaming & Aggro Issue

#31 Post by lisa » Tue Mar 22, 2011 4:38 am

Been doing lots more testing last few hours. Running 1 bot and another client not botting, in same party.

Withthe way the current bot runs it doesn't consistently have a physical target, it can go for an hour of just having itself as physical target. This messes with what other clients see.
From other client I watched it's target of target and half the time it showed the bot as having no target at all even when it had itself targeted, I attribute this to the memory targeting messing with the info sent to other clients.

I also ran round with a little script to get GUID of target and target of target, it would only show results of what the client can physically see.

it looked like this

Code: Select all

_id = UnitGUID("target")
_tt = UnitGUID("targettarget")

if _id ~= nil then SendChatMessage(_id,"PARTY") else SendChatMessage("no target","PARTY") end
if _tt ~= nil then SendChatMessage(_tt,"PARTY") else SendChatMessage("no ToT","PARTY") end
So I think it comes back to communication. Should be able to get the bot not just run off when it's team mate is being killed soonish but still need the issue of what to focus dps on.
Rock have you had any luck with an offset for the raid icons? Might be able to add in a score for a raid icon offset.
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: Teaming & Aggro Issue

#32 Post by rock5 » Tue Mar 22, 2011 6:11 am

lisa wrote:Rock have you had any luck with an offset for the raid icons? Might be able to add in a score for a raid icon offset.
I remember doing some work on it but don't remember how far I got. I just had a search for any discussion about it but couldn't find it. Do you remember which post it was?
  • 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: Teaming & Aggro Issue

#33 Post by lisa » Tue Mar 22, 2011 6:36 am

It was in another post about party botting, maybe "party bot revolution" I'd need to search aswell lol

I did some testing by making on skill cast change raid icon to III and I set the findenemy to set it to I. It very consistently changed it to III regardless of the memory targeting or physical. It very inconsistantly changed it to I, seemed to me it would only do that when a mob wandered into range while it was already attacking something, so I guess it was re-evaluating score.
Setting it to change on skill cast means alot of romscripts going though but it would deffinately be more reliable.
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: Teaming & Aggro Issue

#34 Post by rock5 » Tue Mar 22, 2011 7:54 am

Ok. From the clues I left in the previous discussion I was able to refind the list. It's a list, in order, of the GUIDs with the icons set. So if you just have III set to a mob it would look like this.
FFFFFFFF
FFFFFFFF
mobguid
FFFFFFFF
FFFFFFFF
FFFFFFFF
etc.

The GUID in memory includes the zone id. I think we can ignore the zone part and just use the GUID part. The benefit of this is it will match the GUID you would get from the ingame function UnitGUID(). Note that when you change zone, your GUID changes.

So the way it would work is, while searching for enemies you would compare their GUID to the GUIDs in the GUID list.

Maybe I should add the pawn GUID to the bot? Then you could continue your work.
  • 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
rock5
Posts: 12173
Joined: Tue Jan 05, 2010 3:30 am
Location: Australia

Re: Teaming & Aggro Issue

#35 Post by rock5 » Tue Mar 22, 2011 8:50 am

Here's an example function to return a pawns icon number if it has one.
userfunction_GetPartyIcon.lua
(337 Bytes) Downloaded 125 times
To use it you would do something like

Code: Select all

icon = GetPartyIcon(target)
if icon == 1 then
    currentScore = currentScore + whatever
elseif icon == 2 then
    currentScore = currentScore + whatever2
etc...
Oops, nearly forgot. This will only work after the GUID has been added to pawn.lua which I just added to rev 582.
  • 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: Teaming & Aggro Issue

#36 Post by lisa » Tue Mar 22, 2011 11:40 am

Ok got rev 582, I added the function directly into player.lua as it uses 2 locals from player.lua target and self.
Couldn't get it to return anything but nil.
Took out the arg purely as trouble shooting, all I can get is icon equals nil.

To test it I set up 4 mobs around me with raid icons 1-4 and then ran with this

Code: Select all

PartyIconList_base = 0xA11B88
PartyIconList_offset = 0xC

function GetPartyIcon()
	local _target = self:getTarget();
	local listStart = memoryReadRepeat("intptr", getProc(), PartyIconList_base, PartyIconList_offset)
	for i = 0, 6 do
		local guid = memoryReadShort(getProc(), listStart + i * 12)
		if guid == _target.GUID then
			return i + 1
		end
	end
end

	for i = 0,objectList:size() do
		obj = objectList:getObject(i);

		if( obj ~= nil ) then
			if( obj.Type == PT_MONSTER and (_id == obj.Id or _id == nil) and obj.Address ~= ignore) then
				local dist = distance(self.X, self.Z, obj.X, obj.Z);
				local pawn = CPawn(obj.Address);
				pawn:update();

				if( evalFunc(obj.Address) == true ) then
					if( distance(self.X, self.Z, pawn.X, pawn.Z ) < settings.profile.options.MAX_TARGET_DIST and
					(( (pawn.TargetPtr == self.Address or (pawn.TargetPtr == self.PetPtr and self.PetPtr ~= 0)) and
					aggroOnly == true) or aggroOnly == false) ) then
						local currentScore = 0;
						currentScore = currentScore + ( (settings.profile.options.MAX_TARGET_DIST - dist) / settings.profile.options.MAX_TARGET_DIST * SCORE_DISTANCE );
						currentScore = currentScore + ( (pawn.MaxHP - pawn.HP) / pawn.MaxHP * SCORE_HEALTHPERCENT );
						if( pawn.TargetPtr == self.Address ) then currentScore = currentScore + SCORE_ATTACKING; end;
						if( pawn.Aggressive ) then
							currentScore = currentScore + SCORE_AGGRESSIVE;
						end;
						local icon = GetPartyIcon()
					if icon == 1 then printf("1\n")
   						-- currentScore = currentScore + 300
					elseif icon == 2 then printf("2\n")
    				--	currentScore = currentScore + 250
					elseif icon == 3 then printf("3\n")
    				--	currentScore = currentScore + 200
					elseif icon == 4 then printf("4\n")
    				--	currentScore = currentScore + 180
					elseif icon == 5 then printf("5\n")
    				--	currentScore = currentScore + 100
    				else printf("No icon detected.\n")
    				end
It only ever printed "No icon detected." either I am missing something or something is off. I can't work it out, memory stuff is still a bit beyond me =(
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: Teaming & Aggro Issue

#37 Post by rock5 » Tue Mar 22, 2011 6:06 pm

You changed my function to return only the icon of your current target but the way you used it you should probably have left it the way it was so that you can check each object in the object list.

Also you used 'self' in the GetPartyIcon() function but it has no meaning there. To use it you would need to name the function 'CPlayer:GetPartyIcon()'. Actually I suggest adding it to pawn.lua instead to return the icon of the pawn because it applies to all pawns. eg.

Code: Select all

function CPawn:GetPartyIcon()
   local listStart = memoryReadRepeat("intptr", getProc(), PartyIconList_base, PartyIconList_offset)
   for i = 0, 6 do
      local guid = memoryReadShort(getProc(), listStart + i * 12)
      if guid == self.GUID then
         return i + 1
      end
   end
end
Then in player.lua you would only need to do this,

Code: Select all

                  local icon = pawn:GetPartyIcon()
               if icon == 1 then printf("1\n")
etc...
Does that make more sense?
  • 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: Teaming & Aggro Issue

#38 Post by lisa » Tue Mar 22, 2011 8:21 pm

Yup it makes much more sense now, I have it detecting the icons and killing them in order of the appropriate score I set. I did notice that when bot was in combat the rules changed though, it ignored the score system and killed the mob that was targeting it, must be more checks somewhere else, I'll look into it.
Actually there arn't more checks I just realised each score is added that it checks. So if it was being attacked then it adds that score, if has aggro adds that score, also adds distance, by the time those 3 are added the mere single score from a mob not attacking would be smaller. So if I set icon scores at like 1000 it should attack them in order regardless. Not going to set it to that it's just an example lol

Thanks for all your help so far =)
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: Teaming & Aggro Issue

#39 Post by lisa » Tue Mar 22, 2011 11:02 pm

I feel like I am so close to making this work it annoys me lol

I still can't get the target of targets name to work =(

I have this in player.lua but it keeps printing <UNKNOWN> which tells me it is using the .Name correctly as otherwise it would return nil since in pawn.lua it sets Name to "<UNKNOWN>" at the start.

Code: Select all

local target = self:getTarget();
CPawn(target.targetPtr).Name
printf(CPawn(target.targetPtr).Name);
I think I need a little break from this lol
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: Teaming & Aggro Issue

#40 Post by rock5 » Tue Mar 22, 2011 11:28 pm

TargetPtr is with a capital 'T'. :)

You do realise the second line does nothing?
  • 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], Bing [Bot] and 1 guest