Posted 16 April 2015 - 02:00 AM
Hi all,
For some reason my turtle program is triggering a conditional statement every time it runs, when it shouldn't be.
My program is supposed to create stairs in my existing quarry. I have it set to detect if turtle.placeDown() returns false, it will print an error and break out of the loop. However, every time I run the loop, it detects turtle.placeDown() as false (when it did place down a block) and breaks the loop.
How can I fix this?
Code snippet:
I've even tried using
Full program code: http://pastebin.com/YCfjbYwc
On a side note, is it possible to convert strings to boolean variables for use with returnToTop? I've heard of tostring and tonumber, but does toboolean exist?
For some reason my turtle program is triggering a conditional statement every time it runs, when it shouldn't be.
My program is supposed to create stairs in my existing quarry. I have it set to detect if turtle.placeDown() returns false, it will print an error and break out of the loop. However, every time I run the loop, it detects turtle.placeDown() as false (when it did place down a block) and breaks the loop.
How can I fix this?
Code snippet:
if not turtle.placeDown() then
print("Error - could not place block")
print("Check fuel level or existing blocks")
break
end
I've even tried using
if turtle.placeDown() == false then
but that doesn't work either.Full program code: http://pastebin.com/YCfjbYwc
On a side note, is it possible to convert strings to boolean variables for use with returnToTop? I've heard of tostring and tonumber, but does toboolean exist?
Edited on 16 April 2015 - 12:19 AM