Posted 04 December 2013 - 05:43 PM
Hello! I have created a wall building program, and I need help. So, the program works fine, except for big walls, I want it to detect when the slot it is on is empty and switch to the next slot. I wrote some code for it, but it is not working. No errors, it just does not switch. Any help?
Current code:
Current code:
print("How long?")
local long = read()
print("How tall?")
local tall = read()
function wall()
for i = 1, tall do
turtle.up()
for i = 1, long do
turtle.placeDown()
turtle.forward()
end
for i = 1, long do
turtle.back()
end
end
end
a = 1
--Program
if turtle.getItemCount(a) == "0" then
a = a + 1
turtle.select(a)
wall()
else
wall()
end