You know, I've never thought of that, but it makes perfect sense. Good observation.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.
Teaming & Aggro Issue
- Administrator
- Site Admin
- Posts: 5330
- Joined: Sat Jan 05, 2008 4:21 pm
Re: Teaming & Aggro Issue
Re: Teaming & Aggro Issue
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.
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

wiki here http://www.solarstrike.net/wiki/index.php?title=Manual
Re: Teaming & Aggro Issue
Yup getting party names works, I only did it with first member though, haven't tested full party.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. Just use GetPartyMemberName(n) to return the name of party member 'n'.
I'll try and incorporate it in the bot tomorrow.
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
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")
Code: Select all
637859072.ToT
40671744.Party
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

wiki here http://www.solarstrike.net/wiki/index.php?title=Manual
Re: Teaming & Aggro Issue
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.
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
Re: Teaming & Aggro Issue
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.
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

wiki here http://www.solarstrike.net/wiki/index.php?title=Manual
Re: Teaming & Aggro Issue
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
Re: Teaming & Aggro Issue
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.
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
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;
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

wiki here http://www.solarstrike.net/wiki/index.php?title=Manual
Re: Teaming & Aggro Issue
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

wiki here http://www.solarstrike.net/wiki/index.php?title=Manual
Re: Teaming & Aggro Issue
Can't you compare by name? eglisa 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.
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
- Administrator
- Site Admin
- Posts: 5330
- Joined: Sat Jan 05, 2008 4:21 pm
Re: Teaming & Aggro Issue
Maybe, but it might require modification of the client.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.
Re: Teaming & Aggro Issue
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
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.
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
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

wiki here http://www.solarstrike.net/wiki/index.php?title=Manual
Re: Teaming & Aggro Issue
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?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.
- 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: Teaming & Aggro Issue
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.
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

wiki here http://www.solarstrike.net/wiki/index.php?title=Manual
Re: Teaming & Aggro Issue
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.
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
Re: Teaming & Aggro Issue
Here's an example function to return a pawns icon number if it has one.
Oops, nearly forgot. This will only work after the GUID has been added to pawn.lua which I just added to rev 582.
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...
- 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: Teaming & Aggro Issue
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
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 =(
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
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

wiki here http://www.solarstrike.net/wiki/index.php?title=Manual
Re: Teaming & Aggro Issue
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.
Then in player.lua you would only need to do this,
Does that make more sense?
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
Code: Select all
local icon = pawn:GetPartyIcon()
if icon == 1 then printf("1\n")
etc...
- 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: Teaming & Aggro Issue
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 =)
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

wiki here http://www.solarstrike.net/wiki/index.php?title=Manual
Re: Teaming & Aggro Issue
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.
I think I need a little break from this 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);
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

wiki here http://www.solarstrike.net/wiki/index.php?title=Manual
Re: Teaming & Aggro Issue
TargetPtr is with a capital 'T'. 
You do realise the second line does nothing?

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
Who is online
Users browsing this forum: Ahrefs [Bot] and 1 guest