why does this script continue to loop? on 01/21/2011 02:11 PM CST
Links-arrows 1
Reply Reply
1:
put polish assembly
pause
shift
if_1 goto 2
2:
move se
move n
put polish assembly
pause
shift
if_1 goto 3
3:
move s
move ne
put polish assembly
pause
shift
if_1 goto 4
4:
move sw
move se
put polish assembly
pause
shift
if_1 goto 5
5:
move nw
move s
put polish assembly
pause
shift
if_1 goto 6
6:
move n
move sw
put polish assembly
pause
shift
if_1 goto again
again:
move ne
move nw
goto 1

This is a simple script i've written for polishing lens assemblies during Alchemy tasks. It should allow me to add a variable for each rep, and quit when all the variables have been used. So if I wrote .polish 1 1 1 1 1 1, that should polish six assemblies and then quit. But when running the script it never quits, it just loops continually.
Reply Reply
Re: why does this script continue to loop? on 01/21/2011 03:16 PM CST
Links-arrows 2
Reply Reply
Your if statements aren't actually branching anywhere.

if_1 goto 2
2:

will just go straight on whether if_1 is true or false.

You have to give it a branch

if_1 goto 2
exit
2:

then if_1 true will branch to 2: past the exit command and if_1 false will go straight on to the exit command.
Reply Reply
Re: why does this script continue to loop? on 01/21/2011 09:41 PM CST
Links-arrows 3
Reply Reply
excellent, thank you
Reply Reply