This is a read-only snapshot of the ComputerCraft forums, taken in April 2020.
MasterGAM's profile picture

builder turtle problem

Started by MasterGAM, 17 May 2014 - 08:01 PM
MasterGAM #1
Posted 17 May 2014 - 10:01 PM
OK so I'm trying to build a program that makes my wireless advanced mining turtle build a large building for me
every time i run it I get an error. bios:339: [string "build}:5: '<eof>' expected

could you lease tell me what that means and if there is anything else wrong with the program. its supposed to build a 26 by 20 wall and continuously going up and adding layers according to the number of levels i put in. It is also supposed to switch to the next slot over when the stack in the slot runs out.
here is the program


function place()
turtle.place()
turtle.back()
end
end

function turn()
turtle.turnleft()
turtle.back()
end
end
–Main Program
term.write("How many levels need to be built?")
for i = 1, levels do
for i = 1, 25 do
place()
end

turn()

for i = 1, 19 do
place()
end

turn()

for i = 1, 18 do
place()
end

turtle.up()
turtle.back()
turtle.turnleft()
end

local sslot = 1
turtle.select(ssleot)
sslot = (sslot%16)+1
turtle..select(sslot)
turtle.ItemCount(sslot)
end
while turtle.getItemCount(sslot) <1 do
sslot = (sslot%16)+1
end
turtle.select(sslot)
end
CCJJSax #2
Posted 18 May 2014 - 02:09 AM
first of all, put your code in code tags.


-- don't use any spaces in between the brackets
[ code]
  print("your code here")


now for the answer to your problem.


-- your functions have extra ends on them

function place()
  turtle.place()
  turtle.back()
end

you have other functions with this same problem

essentially, every if, while, or function needs one end.
Edited on 18 May 2014 - 12:10 AM