Posted 18 May 2014 - 07:34 AM
ok so i have been revising a program for a turtle to build a 26 by 26 wall but when I run it it gives me a error
bios:339: [string "build"]:54: 'end' expected (to close function at line 11)
and when i got it to not have that error it would only go through 1 line of placing 26 blocks turn and stop but its suposed to do that 4 time. when i tried to fix that i got the error again.its also supposed to change its selected slot so it can continue build after it uses up the stack but that part wont work either. please tell me all the bugs that are in my program
here is the program
function place()
turtle.back()
turtle.placeDown()
end
function turn()
turtle.back()
turtle.turnLeft()
end
function check()–This is for the changing of the selected slot when the stack runs out
turtle.select(sslot)
sslot = (sslot%16)+1
turtle.select(sslot)
turtle.getItemCount(sslot)
while turtle.getItemCount(sslot) < 1 do
sslot = (sslot%16)
turtle.select(sslot)
end
–Main Program
local sslot = 1
local 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()
end
Please help me
bios:339: [string "build"]:54: 'end' expected (to close function at line 11)
and when i got it to not have that error it would only go through 1 line of placing 26 blocks turn and stop but its suposed to do that 4 time. when i tried to fix that i got the error again.its also supposed to change its selected slot so it can continue build after it uses up the stack but that part wont work either. please tell me all the bugs that are in my program
here is the program
function place()
turtle.back()
turtle.placeDown()
end
function turn()
turtle.back()
turtle.turnLeft()
end
function check()–This is for the changing of the selected slot when the stack runs out
turtle.select(sslot)
sslot = (sslot%16)+1
turtle.select(sslot)
turtle.getItemCount(sslot)
while turtle.getItemCount(sslot) < 1 do
sslot = (sslot%16)
turtle.select(sslot)
end
–Main Program
local sslot = 1
local 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()
end
Please help me