onSkillCast and onLeaveCombat problem

Runes of Magic/Radiant Arcana (http://www.runesofmagic.com)
Post Reply
Message
Author
Personalausweis
Posts: 73
Joined: Mon Aug 16, 2010 12:50 pm

onSkillCast and onLeaveCombat problem

#1 Post by Personalausweis »

Hey there,

i have a problem with a.m. part in my profile.
i wrote two functions whitch shall heal me after a fight/after a cast when fighting against stronger mobs.

functions:

Code: Select all

function heal_after_cast()
	if(50 > player.HP/player.MaxHP*100 ) then
		player:cast("PRIEST_URGENT_HEAL");
		player:cast("PRIEST_REGENERATE");
		player:cast("PRIEST_URGENT_HEAL");
		player:cast("PRIEST_URGENT_HEAL");
	end
end



function full_heal()
while (99 > (Player.HP/player.MaxHP*100))
	do
	player:cast("PRIEST_URGENT_HEAL");
	end;
end

onSkillCast

Code: Select all

<onSkillCast>
	heal_after_cast();
</onSkillCast>
onLeaveCombat

Code: Select all

<onLeaveCombat>
 full_heal();
</onLeaveCombat>


error in log.txt

Code: Select all

Wed Dec 08 22:50:10 2010 : Bot addon 'heal' successfully loaded.
Wed Dec 08 22:50:10 2010 : Bot addon 'Rock5s_Mail_Functions' successfully loaded.
Wed Dec 08 22:50:10 2010 : Language: english
Wed Dec 08 22:50:11 2010 : Using static char address 0x9B5284, player address 0x35A76900
In main thread:
stack traceback:
	.../Desktop/micromacro/scripts/rom/settings.lua:673: in function 'loadOnSkillCastEvent'
	.../Desktop/micromacro/scripts/rom/settings.lua:883: in function 'loadProfile'
	scripts\rom/bot.lua:165: in function 'foo'
	...\Desktop\micromacro\lib\lib.lua:510: in function <...\Desktop\micromacro\lib\lib.lua:508>

----------TRACEBACK END----------

Wed Dec 08 22:50:11 2010 : .../Desktop/micromacro/scripts/rom/settings.lua:673: Failed to compile and run Lua code for onSkillCast in character profile.
Wed Dec 08 22:50:11 2010 : Execution error: Runtime error

any ideas what i did wrong?
User avatar
rock5
Posts: 12173
Joined: Tue Jan 05, 2010 3:30 am
Location: Australia

Re: onSkillCast and onLeaveCombat problem

#2 Post by rock5 »

I can't see anything wrong. Where did you put the functions?
  • 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
Personalausweis
Posts: 73
Joined: Mon Aug 16, 2010 12:50 pm

Re: onSkillCast and onLeaveCombat problem

#3 Post by Personalausweis »

in unserfunctions folder as addon_heal.lua
Personalausweis
Posts: 73
Joined: Mon Aug 16, 2010 12:50 pm

Re: onSkillCast and onLeaveCombat problem

#4 Post by Personalausweis »

no one an idea?
User avatar
Administrator
Site Admin
Posts: 5353
Joined: Sat Jan 05, 2008 4:21 pm

Re: onSkillCast and onLeaveCombat problem

#5 Post by Administrator »

That is pretty strange. Maybe try including the CDATA tags?

Code: Select all

<onSkillCast><![CDATA[
     heal_after_cast();
]]></onSkillCast>
Post Reply