Page 1 of 1

Failure in function for onleavecombat

Posted: Fri Dec 03, 2010 1:14 pm
by Personalausweis
hi there,

i wanted to write a function whitch gives me full HP after a fight (damn elite worms in limo ;) )

function(s) (addon_heal.lua)

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
and i included them in my profile:

Code: Select all

<onLeaveCombat>
	full_heal();
</onLeaveCombat>

<onSkillCast>
	heal_after_cast();
</onSkillCast>
but when i start RoMBot he always gives an error:

Code: Select all

scripts\rom/bot.lua:25: .../micromacro/scripts/rom/userfunctions/addon_heal.lua:1: unexpected symbol near 'ยด'
i don't know what he wants me to change :(

Re: Failure in function for onleavecombat

Posted: Fri Dec 03, 2010 2:46 pm
by Administrator
Provide a full copy of addon_heal.lua and log.txt

Re: Failure in function for onleavecombat

Posted: Fri Dec 03, 2010 8:34 pm
by Personalausweis
this is full copy of addon_heal.lua

what log.txt do ou mean? where can i find it?

Re: Failure in function for onleavecombat

Posted: Fri Dec 03, 2010 8:44 pm
by Administrator
Upload your copy of addon_heal.lua as an attachment (same with log.txt). It could be an encoding issue or any number of things.

You will find log.txt in the MicroMacro root folder. Only upload log.txt immediately after getting the error (to make sure it's even stored in the log).

Re: Failure in function for onleavecombat

Posted: Sat Dec 04, 2010 2:32 am
by Personalausweis
here they are

Re: Failure in function for onleavecombat

Posted: Sat Dec 04, 2010 2:44 am
by Administrator
Yeah. It was just an encoding issue. If you are using Notepad++, just open the file, then go to Encoding->Convert to UTF-8 without BOM, then save the file.

Re: Failure in function for onleavecombat

Posted: Sat Dec 04, 2010 11:19 am
by Personalausweis
thanks a lot now its working as intended :)