TheOddByte, on 02 January 2015 - 11:31 PM, said:
There's nothing to be sorry for, this is what AaP is for, asking for help.
Thanks. And Thanks to you all the Bot made a smooth stonefloor in my new crafting hall.
There are many functions missing at the moment (Checking Fuel, doing ceiling and walls as well, replanting torches, configuration via GUI) but for now it has done what I needed.
Thats the code now:
ende = "no"
data = {}
turtle.select(16)
if turtle.getItemCount() > 0 then material = "yes" end
for x=10,0,-1 do
print("Noch " .. x.. " Runden")
ende = "no"
while ende ~= "yes" do
if turtle.detectDown() == false then
turtle.placeDown()
if turtle.getItemCount() == 0 then material = "no" end
else
if turtle.compareDown() == false then
turtle.select(1)
turtle.digDown()
turtle.select(16)
turtle.placeDown()
if turtle.getItemCount() == 0 then material = "no" end
end
end
if turtle.getItemCount() == 0 then
ende = "yes"
break
end
if turtle.detect() == false then turtle.forward()
else
antwort, data = turtle.inspect()
if data.name == "minecraft:torch" then
turtle.select(1)
turtle.dig()
else
ende = "yes"
end
end
end
if material == "yes" then
turtle.turnRight()
if turtle.detect() == true then
ende = "yes"
break
end
turtle.forward()
turtle.turnRight()
end
ende="no"
turtle.select(16)
while ende ~= "yes" do
if turtle.detectDown() == false then
turtle.placeDown()
if turtle.getItemCount() == 0 then material = "no" end
else
if turtle.compareDown() == false then
turtle.select(1)
turtle.digDown()
turtle.select(16)
turtle.placeDown()
if turtle.getItemCount() == 0 then material = "no" end
end
end
if turtle.getItemCount() == 0 then
ende = "yes"
break
end
if turtle.detect() == false then turtle.forward()
else
antwort, data = turtle.inspect()
if data.name == "minecraft:torch" then
turtle.dig()
else
ende = "yes"
end
end
end
if material == "yes" then
turtle.turnLeft()
if turtle.detect() == true then
ende = "yes"
break
end
turtle.forward()
turtle.turnLeft()
end
end