Never ending loop

Additional botting resources. Addons may be either for the game itself or for the RoM bot.
Forum rules
Only post additional bot resources here. Please do not ask unrelated questions.
Post Reply
Message
Author
User avatar
dap
Posts: 23
Joined: Thu Aug 11, 2011 1:44 am

Never ending loop

#1 Post by dap » Wed Oct 12, 2011 11:01 am

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

User avatar
rock5
Posts: 12173
Joined: Tue Jan 05, 2010 3:30 am
Location: Australia

Re: Never ending loop

#2 Post by rock5 » Wed Oct 12, 2011 11:07 am

Try adding a print message to see what value 'queststate' has when it gets updated.
  • 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

User avatar
dap
Posts: 23
Joined: Thu Aug 11, 2011 1:44 am

Re: Never ending loop

#3 Post by dap » Wed Oct 12, 2011 11:51 am

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 ?

User avatar
lisa
Posts: 8332
Joined: Tue Nov 09, 2010 11:46 pm
Location: Australia

Re: Never ending loop

#4 Post by lisa » Wed Oct 12, 2011 11:56 am

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"
Remember no matter you do in life to always have a little fun while you are at it ;)

wiki here http://www.solarstrike.net/wiki/index.php?title=Manual

User avatar
dap
Posts: 23
Joined: Thu Aug 11, 2011 1:44 am

Re: Never ending loop

#5 Post by dap » Wed Oct 12, 2011 12:11 pm

it works now, thanx

Post Reply

Who is online

Users browsing this forum: No registered users and 3 guests