Posted 02 February 2015 - 08:21 PM
I want to make an improved excavate program (I sadly have no other idea what I should program). I have done my first semester as CS student and learned C# (we've gone as far as simple sorting algoritms). I tried using Computercraft to keep myself in practice.
I am confused about how when Computercraft does a check for a Bool condition.
The program should keep digging down until it finds bedrock under itself.
The goal is to have a program that stops when it detects either bedrock or mossy cobblestone (I want to save the spawner and loot). This program can be a base for it. However, while the turtle does start digging, it gets stuck in an infinite loop when it hits bedrock.
My code looks like this roughly:
I know that the turtle can accurately detect with this code when IsBedrock is true. My question is, what am I doing wrong thta makes this program get stuck?
I am confused about how when Computercraft does a check for a Bool condition.
The program should keep digging down until it finds bedrock under itself.
The goal is to have a program that stops when it detects either bedrock or mossy cobblestone (I want to save the spawner and loot). This program can be a base for it. However, while the turtle does start digging, it gets stuck in an infinite loop when it hits bedrock.
My code looks like this roughly:
local success, data= turtle.inspectDown()
local bedrockname="minecraft:bedrock"
local IsBedrock= data.name==bedrockname
--Main Program
while IsBedrock==false do
turtle.digDown()
turtle.down()
end
I know that the turtle can accurately detect with this code when IsBedrock is true. My question is, what am I doing wrong thta makes this program get stuck?