Posted 19 May 2014 - 01:14 AM
ok so i have this program working pretty well but when i run it it only build one layer of 25 blocks,= then it turns stops and givers me an error that says turtle:22: Expected number. and my Function Check() wasnt working when i had it working before, please help me with these two problems.
here is the program
function place()
turtle.back()
turtle.placeDown()
end
function turn()
turtle.back()
turtle.turnLeft()
end
function check() –this makes it change its slot if it has less than 20 in its current slot
turtle.select(x)
turtle.getItemCount(x)
while turtle.getItemCout(x) < 20 do
x = (x)=1
turtle.select(x)
end
end
–Main Program
local x
x = 1
local levels
levels = 0
term.write("How many levels should be created:")
levels = read()
for i =1, levels do
for i =1, 25 do
place()
end
turn()
check()
for i =1, 25 do
place()
end
turn()
check()
for i =1, 25 do
place()
end
turn()
check()
for i =1, 25 do
place()
end
turn()
turtle.up()
end
here is the program
function place()
turtle.back()
turtle.placeDown()
end
function turn()
turtle.back()
turtle.turnLeft()
end
function check() –this makes it change its slot if it has less than 20 in its current slot
turtle.select(x)
turtle.getItemCount(x)
while turtle.getItemCout(x) < 20 do
x = (x)=1
turtle.select(x)
end
end
–Main Program
local x
x = 1
local levels
levels = 0
term.write("How many levels should be created:")
levels = read()
for i =1, levels do
for i =1, 25 do
place()
end
turn()
check()
for i =1, 25 do
place()
end
turn()
check()
for i =1, 25 do
place()
end
turn()
check()
for i =1, 25 do
place()
end
turn()
turtle.up()
end