Posted 17 November 2013 - 08:08 AM
Edit: Sorry I screwed up the title, I should double check that next time. It should be: Compare entering loop with Tree Mining Program
Hi,
I made a program that mines 4-Block trees. in the 15 slot the turtle carries the saplings, in the 16th he carries a stack of wood for comparing. First the turtle checks if the tree grew, and if yes he starts mining it in layers. Every layer he checks if the block above him is equal to the stack of wood in slot 16. This is where it is malfunctioning.
Here is the full script: http://pastebin.com/Q3KfggcQ
He selects the correct slot beforehand, but when he compares with the block above him he enters the while loop and descends. I tried it out in lua mode and it returned true when I compare them, so I can't see why it enters the loop.
Thanks a lot for your help.
Hi,
I made a program that mines 4-Block trees. in the 15 slot the turtle carries the saplings, in the 16th he carries a stack of wood for comparing. First the turtle checks if the tree grew, and if yes he starts mining it in layers. Every layer he checks if the block above him is equal to the stack of wood in slot 16. This is where it is malfunctioning.
if (turtle.compareUp() == false) then
while (hight ~= 0) do
turtle.down()
hight = hight - 1
end
turtle.back()
i = 1
end
Here is the full script: http://pastebin.com/Q3KfggcQ
He selects the correct slot beforehand, but when he compares with the block above him he enters the while loop and descends. I tried it out in lua mode and it returned true when I compare them, so I can't see why it enters the loop.
Thanks a lot for your help.
Edited on 17 November 2013 - 02:42 PM