<onLeaveCombat> lua code

Runes of Magic/Radiant Arcana (http://www.runesofmagic.com)
Post Reply
Message
Author
userforum
Posts: 4
Joined: Sun May 30, 2010 6:35 pm

<onLeaveCombat> lua code

#1 Post by userforum » Sun May 30, 2010 6:38 pm

Hello, i need a little help ... im trying to make a lua code to cast druid_recover when i kill an enemy, since there is a delay to attack another enemy and it somethimes kill me. So, i tried to use the code that comes with the profile :

--if( 15 > userforum.HP/userforum.MaxHP*100 ) then
-- player:cast("DRUID_RECOVER");

but it doesnt work, it says it got a error, can someone help me ? or give me some advice? thank you in advance
Last edited by userforum on Sun May 30, 2010 9:18 pm, edited 1 time in total.

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

Re: <onLeaveCombat> lua code

#2 Post by rock5 » Sun May 30, 2010 6:49 pm

userforum wrote:Hello, i need a little help ... im trying to make a lua code to cast druid_recover when i kill an enemy, since there is a delay to attack another enemy and it somethimes kill me. So, i tried to use the code that comes with the profile :

--if( 15 > Timbr.HP/Timbr.MaxHP*100 ) then
-- player:cast("DRUID_RECOVER");

but it doesnt work, it says it got a error, can someone help me ? or give me some advice? thank you in advance
I'm guessing your players name is Timbr? That should be "player". Also needs an "end". Try;

Code: Select all

if( 15 > player.HP/player.MaxHP*100 ) then
	player:cast("DRUID_RECOVER");
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

userforum
Posts: 4
Joined: Sun May 30, 2010 6:35 pm

Re: <onLeaveCombat> lua code

#3 Post by userforum » Sun May 30, 2010 9:10 pm

It was just an example, i put a name to example what i need, because letting like player doesn't work...


--if( 15 > player.HP/player.MaxHP*100 ) then
-- player:cast("DRUID_RECOVER");

it doesn't work.

any new idea?
thxxx

User avatar
Administrator
Site Admin
Posts: 5306
Joined: Sat Jan 05, 2008 4:21 pm

Re: <onLeaveCombat> lua code

#4 Post by Administrator » Sun May 30, 2010 9:49 pm

You need to take out those "--" in front of those two lines. The "--" basically means "ignore this."

userforum
Posts: 4
Joined: Sun May 30, 2010 6:35 pm

Re: <onLeaveCombat> lua code

#5 Post by userforum » Sun May 30, 2010 10:54 pm

humm osrry, i just copy the code on the default profile

but it still doesnt work
since i tried a lot of lua code to make this work, i dont know more what to do

:(

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

Re: <onLeaveCombat> lua code

#6 Post by rock5 » Mon May 31, 2010 2:26 am

userforum wrote:humm osrry, i just copy the code on the default profile

but it still doesnt work
since i tried a lot of lua code to make this work, i dont know more what to do

:(
Did you put the "end" after it like I told you too?

Also, what do you mean "doesn't work"? What happens? What do you expect to happen? Did you get an error message?
  • 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

filipsworks
Posts: 53
Joined: Mon May 10, 2010 10:37 am

Re: <onLeaveCombat> lua code

#7 Post by filipsworks » Mon May 31, 2010 8:58 am

maybe delete <CDATA... tag?

userforum
Posts: 4
Joined: Sun May 30, 2010 6:35 pm

Re: <onLeaveCombat> lua code

#8 Post by userforum » Tue Jun 01, 2010 1:28 pm

doesnt work too.

well, i put the CD on the recover(druid) in 4 seconds, then it will check even if im already healing.

thx for the help

KillerTHC
Posts: 63
Joined: Tue May 25, 2010 8:49 pm

Re: <onLeaveCombat> lua code

#9 Post by KillerTHC » Tue Jun 01, 2010 3:12 pm

Try this code it should work.

Code: Select all

if( (player.HP/player.MaxHP*100) < 15) then
	player:cast("DRUID_RECOVER");
else
	return false;
end

Post Reply

Who is online

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