Improvement for party healer

Runes of Magic/Radiant Arcana (http://www.runesofmagic.com)
Message
Author
romaniac
Posts: 79
Joined: Sat Feb 04, 2012 8:25 am

Improvement for party healer

#1 Post by romaniac » Fri Aug 03, 2012 12:56 am

I played with the party healer and I have made a change that you might want to incorporate into the bot.

I used it to heal my char while questing. While the healer works pretty well, for quests you have to ride long distances. So I added some code that makes the healer mount & follow automatically when the lead char mounts his horse.

I just changed the getNameFollow function.

Code: Select all

unction getNameFollow()
	while (true) do	
  		if ( settings.profile.options.PARTY_FOLLOW_NAME ) then
			for i = 1,5 do
				if GetPartyMemberName(i) == settings.profile.options.PARTY_FOLLOW_NAME  then RoMScript("FollowUnit('party"..i.."');"); break  end
			end	
			RoMScript("FollowUnit('party1');");
		else 
            RoMScript("TargetUnit('party1');");
           	player:update();
            partner = player:getTarget();
            if( partner ) then
   				if( partner.Mounted and not player.Mounted ) then
					while not player.Mounted do
						player:mount()
						yrest( 1000 );
						player:update();
					end
				end
            end
        
			RoMScript("FollowUnit('party1');");		
		end
		break
	end
end
Likely there's a way to do this a little more elegantly, but it's working. :-)

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

Re: Improvement for party healer

#2 Post by lisa » Fri Aug 03, 2012 1:15 am

Interesting idea.

First thing to note is that the mount code is only done if you don't have a name specified in your profile to follow and it just follows party1.

What I did in partydps as an example for people was a check for an icon and then mount.

Code: Select all

		local selficon = player:GetPartyIcon()
		
		--=== if self icon II then mount up and follow ===--
		if selficon == 2 then
			while not player.Mounted do
				player:mount()
			end
		end
So if the partydps character gets a II icon on it then it mounts up, it means you have to actually put the icon on the character but it also means that it will only mount when you want it to.
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

romaniac
Posts: 79
Joined: Sat Feb 04, 2012 8:25 am

Re: Improvement for party healer

#3 Post by romaniac » Fri Aug 03, 2012 1:25 am

lisa wrote: First thing to note is that the mount code is only done if you don't have a name specified in your profile to follow and it just follows party1.
[...]
So if the partydps character gets a II icon on it then it mounts up, it means you have to actually put the icon on the character but it also means that it will only mount when you want it to.
Yes, I only put it into the "nameless" branch. That is the way I am currently using it. For the bot, it should be more general of course.

And I definitely want it to mount automatically without any command, icon or switch to the char. I need to mount hundreds of times during questing.

It would be even better if it would mount as soon as the lead char starts mounting. Is there a way to detect that?

Tamyra
Posts: 133
Joined: Tue Feb 01, 2011 6:09 pm

Re: Improvement for party healer

#4 Post by Tamyra » Mon Aug 06, 2012 2:51 pm

Oh wow, I was going to ask if something like this existed, cause I was doing the same thing this weekend, and it was highly annoying to have to mount them both individually. Probably more so annoying when they are already mounted and moving and a buff wears off. The Healer dismounts then casts the buff and because the lead player is still mounted it stops following. So yeah is there a way to also tell the healer to not cast buffs if mounted, and to check for the mounted status of the lead player to determine when to mount and dismount?

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

Re: Improvement for party healer

#5 Post by lisa » Mon Aug 06, 2012 7:11 pm

Hmm I thought there was a check added so it didn't cast skills while mounted, seems it was commented out though, can't remember why.

Line 870 of player.lua

Code: Select all

	--if settings.profile.options.DISMOUNT == false and player.Mounted then return false end
When I look at it I think the code should check for if friendly skills or not, so it won't dismount to heal but will dismount to attack/defend itself.
So maybe something like this instead?

Code: Select all

if _only_friendly == true and player.Mounted then return false end
Ahh I found the code to not cast heals while mounted is in bot.lua

Code: Select all

			if not player.Mounted then
				player:checkPotions();
				player:checkSkills( ONLY_FRIENDLY );	-- only cast hot spells to ourselfe
			end
I should just add a similar check to party.lua but then again I didn't add code to mount so no need to check if mounted lol

Tamyra wrote: check for the mounted status of the lead player to determine when to mount and dismount?
As for making the default version mount and dismount I added the Icon check (DPS only for testing) because it doesn't matter how many chars in group or who is party leader it would still work.
The trouble is to make code that would work for everyone, if I add code that only mounts and dismounts if just 2 in party then people who have more in party wouldn't be happy.
I haven't looked for if a pawn is party leader or not so if you wanted to mount only if party leader mounted then it would need to be done using in game functions (RoMScript)
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: Improvement for party healer

#6 Post by lisa » Mon Aug 06, 2012 10:06 pm

--=== Removed ===--
better version a few posts down.
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

romaniac
Posts: 79
Joined: Sat Feb 04, 2012 8:25 am

Re: Improvement for party healer

#7 Post by romaniac » Tue Aug 07, 2012 4:50 am

lisa wrote:

Code: Select all

	--if settings.profile.options.DISMOUNT == false and player.Mounted then return false end
When I look at it I think the code should check for if friendly skills or not, so it won't dismount to heal but will dismount to attack/defend itself.
It should not cast anything while mounted, and it should not defend itself! Or there should be an option for the behaviour, similar to the waypoint type.

Reason is: Usually to get somewhere you need to ride past mobs. If you just continue on, the horses are fast enough to simply carry you away after one or two hits. That is what you want.

But if the bot stops to defend itself, you need to notice that, return with the lead char, fight the mob, kill some more mobs that joined, mount again and continue. You loose a lot of time that way.

When I travel longer distances, I have to pause the bot after it was mounted and following to avoid this. But of course it would be great if you could just set the mounted behaviour to
- buff and defend (NORMAL)
- defend only (RUN)
- do nothing (TRAVEL). Maybe switch to buff+defend if hp are dropping too low

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

Re: Improvement for party healer

#8 Post by rock5 » Tue Aug 07, 2012 5:31 am

Regardless if your mounted or not, whether it fights or not depends on the waypoint type, as it should. Otherwise, if it's traveling, it will not dismount to use buffs or heals regardless of the waypoint type. That's the way the main bot is set up. I'm not sure about party.lua though. If it dismounts when using party functions then they probably need updating.
  • 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: Improvement for party healer

#9 Post by lisa » Tue Aug 07, 2012 6:58 am

rock5 wrote: I'm not sure about party.lua though. If it dismounts when using party functions then they probably need updating.
Current version, as in rev 731, it will dismount anytime it wants to use any skills. There actually isn't any real usage for mounting in the partyhealer. partydps has usage if you put a II icon on the bot it will mount up.

The party.lua version is an upgrade to the partyhealer, if the party leader is mounted then it will mount aswell, if party leader isn't mounted then it will dismount. This version will dismount anytime it decides to use skills though, I should prob change that to only dismount when party leader dismounts.

Ok adding another version, this will only use skills if not mounted and will mount and dismount according to the party leader's mounted status.

This version will also loot if your profile is set to loot and lootall
Attachments
party.lua
(5.64 KiB) Downloaded 158 times
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: Improvement for party healer

#10 Post by lisa » Wed Aug 08, 2012 12:11 am

I'm not completely happy with how it is working atm.

It does 5 romscript every time function is called for determining which char is party leader. I had a quick look in memory for an indicator of party leader but nothing jumped out at me, since the in game function uses untId then I figure the info must be part of each objects info as opposed to a seperate section of memory like party name does, so more like the inParty indicator.
I guess I could check the number of party members and if just the 2 in party then assume other char is party leader, atleast then only bigger groups will do the romscript, that seems better.

Also since I don't play RoM anymore I am struggling to work out what people want it to be doing, I mainly used it for instances and so never mounted or much else.
So comments please.
1. Only use skills while not mounted, heal or dps
2. Mount and dismount only when party leader does
3. Only check for the I icon or just attack same as normal bot
4. Do some party chat monitoring for commands like target NPC and accept/complete quests
5. Some quest status prints to party chat, responding to party chat queries
6. Loot all when not in combat, if mounted or only when not mounted?
7. ??
8. ??

Maybe leave party healer and party dps as is for instances and make a new party follower for questing and such which will both heal and dps as needed ?

--=== Added ===--
Looking at this atm for party leader check

Code: Select all

		if #partymemberpawn > 2 then
			for i = 1,5 do
				if RoMScript('UnitIsRaidLeader("party'..i..'")') == true then partyleader = GetPartyMemberName(i) end
			end
		else
			partyleader = GetPartyMemberName(1)
		end
So if just the 2 in party it will check the other character for if it mounts or not, if more than 2 it will do the 5 romscripts.
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: Improvement for party healer

#11 Post by rock5 » Wed Aug 08, 2012 1:42 am

I found a couple of constant addresses that seem to hold the party leaders name. They seem to work in both parties and raids.
0x9BB8C8
0x9FBF18

Looks like the first one doesn't change when you leave the party. So the second one is better because it becomes empty when you leave the party.
  • 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: Improvement for party healer

#12 Post by lisa » Wed Aug 08, 2012 3:31 am

rock5 wrote:0x9FBF18
Wonder if we can just do that as an offset of an existing address, less to update with patches. Probably wouldn't be reliable 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: Improvement for party healer

#13 Post by rock5 » Wed Aug 08, 2012 4:46 am

lisa wrote:
rock5 wrote:0x9FBF18
Wonder if we can just do that as an offset of an existing address, less to update with patches. Probably wouldn't be reliable though.
Basically now, update.lua searches for all addresses except when the address can't be found, in which case it is assumed from another address. 9FBF18 can be found in memory so there's no reason why we can't make a pattern for it.
  • 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: Improvement for party healer

#14 Post by lisa » Wed Aug 08, 2012 5:52 am

I guess I am just reluctant to add more and more addresses with the memory of having to find them after a patch, those days are mostly gone though so I guess it can't hurt to add another =)

Did a quick test, doesn't actually return nil if not in party, should be ok though.

Just used this for testing

Code: Select all

local name = memoryReadString(getProc(), 0x9FBF18) print(name)
printed nothing when not in party, when was in party it printed the names fine. When I mean nothing I mean the same as print("")
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: Improvement for party healer

#15 Post by lisa » Wed Aug 08, 2012 6:50 am

I made a seperate function to get party leader name and have this for the mount/dismount code.

Code: Select all

	local function Mount()
		local partyleader, mounted, leaderobj
		partyleader = getPartyLeaderName()	
		leaderobj = player:findNearestNameOrId(partyleader)
		if partyleader and leaderobj then
			local attackableFlag = memoryReadRepeat("int", getProc(), leaderobj.Address + addresses.pawnAttackable_offset) or 0;
			mounted = bitAnd(attackableFlag, 0x10000000)
			if not player.Mounted then
				if mounted then 
					player:mount() 
				end
			end
			if not mounted then
				if player.Mounted then
					player:dismount()
				end
			end
		end	
	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

romaniac
Posts: 79
Joined: Sat Feb 04, 2012 8:25 am

Re: Improvement for party healer

#16 Post by romaniac » Wed Aug 08, 2012 7:09 am

lisa wrote: 1. Only use skills while not mounted, heal or dps
2. Mount and dismount only when party leader does
3. Only check for the I icon or just attack same as normal bot
4. Do some party chat monitoring for commands like target NPC and accept/complete quests
5. Some quest status prints to party chat, responding to party chat queries
6. Loot all when not in combat, if mounted or only when not mounted?
1. Yes!
2. Yes.
3. Should be an option. For healer I'd want it only with I icon, for dps always.
4,5 don't know, never used it this way
6. As an option. I usually do not want support chars to loot during questing, but it might be useful for a loot collector when farming.

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

Re: Improvement for party healer

#17 Post by lisa » Wed Aug 08, 2012 7:31 am

romaniac wrote: 1. Yes!
2. Yes.
3. Should be an option. For healer I'd want it only with I icon, for dps always.
4,5 don't know, never used it this way
6. As an option. I usually do not want support chars to loot during questing, but it might be useful for a loot collector when farming.
1. done
2. done
3. I can change DPS to kill anything in sight but how do you tell it to stop killing if you want to go to new area? or wait for you to buff up for the boss fight?
6. done, existing profile settings will change if you want to loot or not.

4/5, still trying to work out best way to do it.
Deciding at the moment if to look for arguments in party chat of it to just spam party chat with quest status of all current quests. Checking party chats for an arg is harder than just spam all quests.

example
you post in party chat
quest"Catch Butterflies"
bot responds with the getqueststatus
"complete"

easy version
you post in party chat
quest
bot responds
Catch Butterflies complete
Some other quest incomplete
another quest complete
yetanother quest incomplete
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: Improvement for party healer

#18 Post by lisa » Wed Aug 08, 2012 10:49 pm

made a bit of progress on 4/5.

using this to populate a table with all quests the character has

Code: Select all

	repeat
		i = i + 1
		local index, catalogID, name, track, level, daily, bDaily_num, iQuestType, 
		questID, completed, QuestGroup = RoMScript("GetQuestInfo("..i..")")
		if name ~= nil then table.insert(questtable, name) end
	until name == nil
I could probably just use the completed from that, it is boolean and only for if it is complete or not, so probably won't need the getquest status for what I want.

So in party chat you could do
quest"Catch"
and then the bot will populate the quest table and do a search for "catch" and then it will post in party chat if complete or not.
"quest Catch Butterflies is Complete"

I don't really need to populate a table for that little example but for bigger and brighter things it will be handy =)
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: Improvement for party healer

#19 Post by lisa » Thu Aug 09, 2012 12:13 am

ok quest usage in 4/5 is working nicely.

Real example
partyquest.jpg
It was a little complicated for me but I got there
All this learning new things is time consuming lol

So next is the target NPC, accept/complete quest.

--=== Added ===--

Ok cruising along now, have it so

npc"accept" will target your current target and complete/accept all quests.
npc"sell" will target your current target and do the usual merchant selling/repair/buying


Is there anything else anyone wants done?
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: Improvement for party healer

#20 Post by lisa » Thu Aug 09, 2012 6:04 am

Ok can I get some testers for this.
removed file, newer version next page

--=== changes to DPS ===--
DPS will now kill anything using normal profile settings, to go back to only kill mobs with icon I then just put an icon on the bot 4,5,6,7 or 8

--=== Usage ===--
use partyhealer or partydps as normal but you now have commands in party chat to tell the bot character what to do.


you type:

Code: Select all

quest"questname"
result: bot character will post in party chat if complete or incomplete
questname can be part of the quest name and lowercase, so "catch" will work for "Catch Butterflies"

you type:

Code: Select all

npc"accept" 
or 
npc"complete"
result: bot will target your current target and complete and accept all quests for that NPC.

you type:

Code: Select all

npc"sell"
result: bot will target your target and do the usual merchant sell/buy/repair according to it's profile settings.

I added the usage to both partyhealer and partydps, I also added another type of party called partyfollower but for now it is pretty much the same as partyhealer so don't be to worried about it at this stage.

Added another 150ish lines of code, ohh well lol

Also I noticed the potion checks managed to get lost at some stage, added them back 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

Post Reply

Who is online

Users browsing this forum: Ahrefs [Bot] and 1 guest