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

What am I doing wrong here

Started by skydude92, 16 April 2013 - 10:39 AM
skydude92 #1
Posted 16 April 2013 - 12:39 PM
function invfull()
local invcount = 0
for c = 4, 16 do
turtle.getItemCount©
if turtle.getItemCount© > 0 then
invcount = invcount+1
end
end
if invcount > 12 then
turtle.select(3)
turtle.place()
deposit() – calling the deposit items function
turtle.select(3)
turtle.dig()
invcount = 0
end
else
invcount = 0
end
end
end

keep getting end expected to close function
if I put more ends in it doesn't change or 'eof' expected
Sammich Lord #2
Posted 16 April 2013 - 12:42 PM
Fixed

function invfull()
  local invcount = 0
  for c = 4, 16 do
    turtle.getItemCount©
    if turtle.getItemCount© > 0 then
	  invcount = invcount+1
    end
  end
  if invcount > 12 then
    turtle.select(3)
    turtle.place()
    deposit() -- calling the deposit items function
    turtle.select(3)
    turtle.dig()
    invcount = 0
  else
    invcount = 0
  end
end
skydude92 #3
Posted 16 April 2013 - 12:43 PM
ty .. so I didnt need the end above else and thats why it wouldn't close the function