I want to rest after combat if HP is low

Runes of Magic/Radiant Arcana (http://www.runesofmagic.com)
Post Reply
Message
Author
randomuser01
Posts: 29
Joined: Mon Jul 19, 2010 7:32 pm

I want to rest after combat if HP is low

#1 Post by randomuser01 » Thu Aug 05, 2010 11:15 pm

My bot runs through a pretty dense area of non-aggressive mobs. The combination of them hitting me + dots + there being so many, I have a decent chance of dieing.

What I'd like to do is once a fight is finished, if my HP is under 80% use the hide skill, wait til HP is over 90%, and then continue doing whatever.

I tried this and it didn't work:

Code: Select all

	<onLeaveCombat><![CDATA[
		sendMacro("ActionButtonUp(12)"); yrest(100);
		if (80 > player.HP/player.MaxHP*100) then
			repeat player.HP; yrest(1000) until player.HP > 13000
		end
		sendMacro("ActionButtonUp(12)"); yrest(100);
	]]></onLeaveCombat>
But that code doesn't work. I'm not very good at LUA, is there a loop..break..end type of code I could use?

Help?

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

Re: I want to rest after combat if HP is low

#2 Post by rock5 » Fri Aug 06, 2010 4:17 am

randomuser01 wrote:My bot runs through a pretty dense area of non-aggressive mobs. The combination of them hitting me + dots + there being so many, I have a decent chance of dieing.

What I'd like to do is once a fight is finished, if my HP is under 80% use the hide skill, wait til HP is over 90%, and then continue doing whatever.

I tried this and it didn't work:

Code: Select all

	<onLeaveCombat><![CDATA[
		sendMacro("ActionButtonUp(12)"); yrest(100);
		if (80 > player.HP/player.MaxHP*100) then
			repeat player.HP; yrest(1000) until player.HP > 13000
		end
		sendMacro("ActionButtonUp(12)"); yrest(100);
	]]></onLeaveCombat>
But that code doesn't work. I'm not very good at LUA, is there a loop..break..end type of code I could use?

Help?
The problem is

Code: Select all

			repeat player.HP; yrest(1000) until player.HP > 13000
It's equivalent to

Code: Select all

			repeat 
				player.HP;
				yrest(1000)
			until player.HP > 13000
player.HP does nothing. It's just a variable. What you meant to do was update it using player:update() and you should do it after the pause. Like this;

Code: Select all

			repeat yrest(1000) player:update() until player.HP > 13000
Try that.
  • 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

randomuser01
Posts: 29
Joined: Mon Jul 19, 2010 7:32 pm

Re: I want to rest after combat if HP is low

#3 Post by randomuser01 » Fri Aug 06, 2010 1:44 pm

Works great, thanks a lot!

Post Reply

Who is online

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