Party Healer, but only when in combat.

Runes of Magic/Radiant Arcana (http://www.runesofmagic.com)
Post Reply
Message
Author
woah
Posts: 44
Joined: Sat Dec 17, 2011 5:27 pm

Party Healer, but only when in combat.

#1 Post by woah » Wed Jan 04, 2012 2:02 am

How can turn on the PartyHeals() function when I enter combat, and turn it off upon leaving combat?
I want my character to heal the other party members, but also follow the specific waypoints I set up for it, not just auto-follow.

Either that, or have the main char whisper the healer if he drops below 90% health, and the healer monitors chat and casts urgent heal on the main char when it gets that whisper. Which would eliminate the need for partyheals(). Thanks (:

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

Re: Party Healer, but only when in combat.

#2 Post by lisa » Wed Jan 04, 2012 4:08 am

So basically you only want it to heal at a specific part of the waypoint, I'll do some thinking on it as it could be a little tricky.
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 Healer, but only when in combat.

#3 Post by lisa » Wed Jan 04, 2012 4:52 am

ok give this a try.

Add this to the onload for the WP

Code: Select all

function BossFightHeal()
	--=== stand around until fight is started by another character
	repeat
	yrest(100)
	player:update()
	until player.Battling
	
	while player.Battling do
	if settings.profile.options.HEAL_FIGHT ~= true then settings.profile.options.HEAL_FIGHT = false end
		_timexx = os.time()
		while(true) do
		PartyTable()
		for i,v in ipairs(partymemberpawn) do
			player:target(partymemberpawn[i])
			player:update()
			partymemberpawn[i]:update()
			partymemberpawn[i]:updateBuffs()
			target = player:getTarget();
			if target.HP/target.MaxHP*100 > 10 then
			player:checkSkills(true);
			end
			if (not player.Battling) then 
				return
			end	
		end	
	end
	end	
end
Then at the waypoint before the boss call the function.

Code: Select all

BossFightHeal()
For this to work though it has to not be the char that starts fight, I assume you wouldn't start the fight with a healer.

After combat ends it should continue on with the rest of the waypoints.
You might need to add a player:Loot_all type thing after calling the function as it may need it to be able to loot.

it probably doesn't need the check for not player.Battling, added it just to make sure it got out of the loop.

---=== edit ===---
I was 1 "end" short in the code 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

woah
Posts: 44
Joined: Sat Dec 17, 2011 5:27 pm

Re: Party Healer, but only when in combat.

#4 Post by woah » Sat Jan 21, 2012 9:28 am

Hey sorry I took so long to respond. Ok so I tested it, and it works well except that it doesn't execute <onleavecombat> commands (I think), and it doesn't loot the boss after the fight.

Maybe because bossfightheals waits until its out of combat until continuing the waypoints, and the normal functions of rombot are to loot once it leaves combat so BossFightHeals interferes? Idk


Edit: What if I put

Code: Select all

PartyTable()
		for i,v in ipairs(partymemberpawn) do
			player:target(partymemberpawn[i])
			player:update()
			partymemberpawn[i]:update()
			partymemberpawn[i]:updateBuffs()
			target = player:getTarget();
			if target.HP/target.MaxHP*100 > 10 then
			player:checkSkills(true);
			end
end
in the <onSkillCast> section? Would that stop casting a skill and start casting a heal if it saw a party member with low health?

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

Re: Party Healer, but only when in combat.

#5 Post by lisa » Sat Jan 21, 2012 9:59 am

lisa wrote:You might need to add a player:Loot_all type thing after calling the function as it may need it to be able to loot.

Code: Select all

<!-- # 3 --><waypoint x="4081" z="3600" y="28" >
BossFightHeal()
player:lootAll()
</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

woah
Posts: 44
Joined: Sat Dec 17, 2011 5:27 pm

Re: Party Healer, but only when in combat.

#6 Post by woah » Sat Jan 21, 2012 11:11 am

Yep. Works nicely now, player:lootall() didnt work, but player:loot() with a target works. vvv

Code: Select all

BossFightHeal()
   yrest(4000)
   RackEmUp = player:findNearestNameOrId("Okander \"Mad Man\" Mallen")
   if RackEmUp then
   player:target(RackEmUp)
   player:loot()
   end
I could probly do without the "if/then". So I guess the simpler version would be

Code: Select all

RackEmUp = player:findNearestNameOrId("Okander \"Mad Man\" Mallen")
   player:target(RackEmUp)
   player:loot()

woah
Posts: 44
Joined: Sat Dec 17, 2011 5:27 pm

Re: Party Healer, but only when in combat.

#7 Post by woah » Sun Feb 19, 2012 5:36 am

Is this function supposed to move closer if a party member is out of range for healing? From what I've seen, half the time it does and half the time it just does nothing.

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

Re: Party Healer, but only when in combat.

#8 Post by lisa » Sun Feb 19, 2012 7:11 am

the function itself doesn't move at all, however the game will move you as you use skills.
So if you are casting a buff or heal on a player out of range the game will move you closer, this is unreliable movement though as a bump on the ground can stop the movement.
Why arn't your party members close together?
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

woah
Posts: 44
Joined: Sat Dec 17, 2011 5:27 pm

Re: Party Healer, but only when in combat.

#9 Post by woah » Sun Feb 19, 2012 7:22 am

I'm using this in dod, I have my healer out of range of the boss aoe's and it should move in range if my main char needs a heal. I figured out why it only does this half the time -- when I run 2 clients my characters port, so the healer thinks its in range for the heal when it really isn't. Pretty easy fix though

woah
Posts: 44
Joined: Sat Dec 17, 2011 5:27 pm

Re: Party Healer, but only when in combat.

#10 Post by woah » Thu Feb 23, 2012 5:10 am

Hmm, for some reason the healer keeps getting stuck at the waypoint with this code.

Code: Select all

<!-- #  8 --><waypoint x="2167" z="2553" y="413">
   changeProfileOption("AUTO_ELITE_FACTOR", 2500);
   BossFightHeal()
   yrest(6000)
Thats the code for the waypoint, and in the MM window it shows..
"Moving to waypoint 8, We changed the option 'AUTO_ELITE_FACTOR' from 100 to 2500"

And thats it, the character just stands there. Seems to me the only way this could happen is if it is waiting forever because it never saw that i was "battling." vvv

Code: Select all

repeat
   yrest(100)
   player:update()
   until player.Battling
I'm not too sure how to go about fixing this, because my character is in the boss room so it should definitely be in combat.. maybe adjust the code like this.. vvv

Code: Select all

repeat
   yrest(100)
   player:update()
   until player.Battling or checkparty(600) == false
Which would make it so after the fight when the main char exits the instance, the healer stops waiting no matter what. Hopefully.

Tell me what you think (: sorry about the long post lol

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

Re: Party Healer, but only when in combat.

#11 Post by rock5 » Thu Feb 23, 2012 5:33 am

If the other player is definately in range and battling, the healer should be in battling too. The only thing I can think of is you forgot to make a party or the code that makes the party might have failed.
  • 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

woah
Posts: 44
Joined: Sat Dec 17, 2011 5:27 pm

Re: Party Healer, but only when in combat.

#12 Post by woah » Thu Feb 23, 2012 12:31 pm

Hmm, well I was definitely in a party every time this happened.
That change I made doesn't work like its supposed to, so I guess ill just hope it was some weird bug. Random things happen when there's a lot of lag haha

woah
Posts: 44
Joined: Sat Dec 17, 2011 5:27 pm

Re: Party Healer, but only when in combat.

#13 Post by woah » Sat Feb 25, 2012 11:27 am

I know this isn't the best thread to post this in, but it might be related.

I'm getting "Id not found" spammed in the MM window, and then weird things happen in the script. Here's a picture. vv
Image


All of that appeared in about 2 seconds.

Post Reply

Who is online

Users browsing this forum: Ahrefs [Bot], Google [Bot] and 2 guests