Page 1 of 1

Never ending loop

Posted: Wed Oct 12, 2011 11:01 am
by dap
hello,

I have problem with repeat - until loop.
It looks like bot doesn't check conditions to leave loop.
Do I have something wrong with my loop?

Code: Select all

local queststate = "incomplete"
		repeat 
			player:target_Object("xxxx", 10000); <-- this function works correctly
			yrest(500);
			queststate = getQuestStatus("questname xxx"); 
		until( queststate == "incomplete")
regards,
dap

Re: Never ending loop

Posted: Wed Oct 12, 2011 11:07 am
by rock5
Try adding a print message to see what value 'queststate' has when it gets updated.

Re: Never ending loop

Posted: Wed Oct 12, 2011 11:51 am
by dap

Code: Select all

local queststate = "incomplete"
      repeat
         player:target_Object("xxxx", 10000); <-- this function works correctly
         yrest(500);
         queststate = getQuestStatus("questname xxx");
         printf(queststate);
      until( queststate == "incomplete")
printf returns "complete"

any suggestions ?

Re: Never ending loop

Posted: Wed Oct 12, 2011 11:56 am
by lisa
dap wrote:

Code: Select all

until( queststate == "incomplete")
wouldn't you want to check if it is complete, not incomplete ?

Code: Select all

until queststate == "complete"
or

Code: Select all

until queststate ~= "incomplete"

Re: Never ending loop

Posted: Wed Oct 12, 2011 12:11 pm
by dap
it works now, thanx