<onLeaveCombat> lua code
<onLeaveCombat> lua code
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
--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.
Re: <onLeaveCombat> lua code
I'm guessing your players name is Timbr? That should be "player". Also needs an "end". Try;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
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
Re: <onLeaveCombat> lua code
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
--if( 15 > player.HP/player.MaxHP*100 ) then
-- player:cast("DRUID_RECOVER");
it doesn't work.
any new idea?
thxxx
- Administrator
- Site Admin
- Posts: 5307
- Joined: Sat Jan 05, 2008 4:21 pm
Re: <onLeaveCombat> lua code
You need to take out those "--" in front of those two lines. The "--" basically means "ignore this."
Re: <onLeaveCombat> lua code
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
but it still doesnt work
since i tried a lot of lua code to make this work, i dont know more what to do
Re: <onLeaveCombat> lua code
Did you put the "end" after it like I told you too?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
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
-
- Posts: 53
- Joined: Mon May 10, 2010 10:37 am
Re: <onLeaveCombat> lua code
maybe delete <CDATA... tag?
Re: <onLeaveCombat> lua code
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
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
Re: <onLeaveCombat> lua code
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
Who is online
Users browsing this forum: Bing [Bot] and 52 guests