Page 1 of 1

Loop

Posted: Sat Apr 14, 2012 7:30 am
by trias
I'm trying to do some script to my profile but it seems to get in loop everytime I try to use it.

Code: Select all

<onSkillCast><![CDATA[
	   while(true) do
		      if (player:hasBuff("High Voltage III")) then 
		      player:cast("WARRIOR_LIGHTNINS_TOUCH")
		else
		player:cast("WARRIOR_ELECTRICAL_RAGE")
		end
	end
	]]></onSkillCast>
Any suggestion to fix this problem?

Re: Loop

Posted: Sat Apr 14, 2012 8:31 am
by rock5
That "while" loop has no exit. It just goes round and round checking that buff indefinately. Probably you don't want the "while" loop, just if "if" statement. That way, everytime you cast a skill, it will check that buff once.

Re: Loop

Posted: Sat Apr 14, 2012 9:18 am
by silinky
also, it is in the wrong section (^_^)

Re: Loop

Posted: Sat Apr 14, 2012 9:54 am
by rock5
silinky wrote:also, it is in the wrong section (^_^)
So it is.

Moved.

Re: Loop

Posted: Wed Apr 18, 2012 9:27 am
by trias
Sorry and thanks. :oops:
But now it works like I intended :)