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

Bios:338 error

Started by Almerish, 05 April 2013 - 06:47 AM
Almerish #1
Posted 05 April 2013 - 08:47 AM
Made a program and decided to test it and now i got a quarry running with no turtle to manage it for me XD. So I am asking the people of this forum for help in this confusing matter.

The whole error is bios:338: [string "test"]:104: '=' expected

this is the code.
Spoiler

local function drop()
turtle.select(1)
turtle.drop()
turtle.select(2)
turtle.drop()
turtle.select(3)
turtle.drop()
turtle.select(4)
turtle.drop()
turtle.select(5)
turtle.drop()
turtle.select(6)
turtle.drop()
turtle.select(7)
turtle.drop()
turtle.select(8)
turtle.drop()
turtle.select(9)
turtle.drop()
turtle.select(10)
turtle.drop()
turtle.select(11)
turtle.drop()
turtle.select(12)
turtle.drop()
turtle.select(13)
turtle.drop()
turtle.select(14)
turtle.drop()
turtle.select(15)
turtle.drop()
turtle.select(16)
turtle.drop()
turtle.select(1)
end
local function home()
if b > 1 then
  repeat
   turtle.down()
   b = b - 1
  until b == 1
end
if face == 1 then
  turtle.turnRight()
  repeat
   turtle.forward()
   if pos > 1 then
	pos = pos - 1
   end
  until pos == 1
end
if face == 3 then
  turtle.turnLeft()
  face = face - 2
  repeat
   turtle.forward()
   if pos > 1 then
   pos = pos - 1
   end
  until pos == 1
end
end
local function nextChest()
if face == 1 then
  turtle.turnLeft()
  turtle.forward()
  turtle.forward()
  turtle.turnRight()
  pos = pos + 2
end
if face == 3 then
  turtle.turnRight()
  turtle.forward()
  turtle.forward()
  turtle.turnRight()
  pos = pos + 2
  face = 1
end
end
while true do
a = 1
b = 1
face = 1
pos = 1
if turtle.suck() then
  sleep(2)
  repeat
   turtle.suck()
   a = a + 1
  until a == 16
end
repeat
total = turtle.getItemCount(1) + turtle.getItemCount(2) + turtle.getItemCount(3) + turtle.getItemCount(4) + turtle.getItemCount(5) + turtle.getItemCount(6) + turtle.getItemCount(7) + turtle.getItemCount(8) + turtle.getItemCount(9) + turtle.getItemCount(10) + turtle.getItemCount(11) + turtle.getItemCount(12) + turtle.getItemCount(13) + turtle.getItemCount(14) + turtle.getItemCount(15) + turtle.getItemCount(16)
if total > 0 then
  drop()
end
total = turtle.getItemCount(1) + turtle.getItemCount(2) + turtle.getItemCount(3) + turtle.getItemCount(4) + turtle.getItemCount(5) + turtle.getItemCount(6) + turtle.getItemCount(7) + turtle.getItemCount(8) + turtle.getItemCount(9) + turtle.getItemCount(10) + turtle.getItemCount(11) + turtle.getItemCount(12) + turtle.getItemCount(13) + turtle.getItemCount(14) + turtle.getItemCount(15) + turtle.getItemCount(16)
if total > 0 then
  repeat
  turtle.up
  drop()
  b = b + 1
  total = turtle.getItemCount(1) + turtle.getItemCount(2) + turtle.getItemCount(3) + turtle.getItemCount(4) + turtle.getItemCount(5) + turtle.getItemCount(6) + turtle.getItemCount(7) + turtle.getItemCount(8) + turtle.getItemCount(9) + turtle.getItemCount(10) + turtle.getItemCount(11) + turtle.getItemCount(12) + turtle.getItemCount(13) + turtle.getItemCount(14) + turtle.getItemCount(15) + turtle.getItemCount(16)
  if total == 0 then
   b = 4
  end
  until b == 4
end
if total > 0 then
  turlte.turnLeft()
  turtle.turnLeft()
  face = face + 2
  drop()
  total = turtle.getItemCount(1) + turtle.getItemCount(2) + turtle.getItemCount(3) + turtle.getItemCount(4) + turtle.getItemCount(5) + turtle.getItemCount(6) + turtle.getItemCount(7) + turtle.getItemCount(8) + turtle.getItemCount(9) + turtle.getItemCount(10) + turtle.getItemCount(11) + turtle.getItemCount(12) + turtle.getItemCount(13) + turtle.getItemCount(14) + turtle.getItemCount(15) + turtle.getItemCount(16)
end
if total > 0 then
  repeat
   turtle.down()
   b = b - 1
   drop()
   total = turtle.getItemCount(1) + turtle.getItemCount(2) + turtle.getItemCount(3) + turtle.getItemCount(4) + turtle.getItemCount(5) + turtle.getItemCount(6) + turtle.getItemCount(7) + turtle.getItemCount(8) + turtle.getItemCount(9) + turtle.getItemCount(10) + turtle.getItemCount(11) + turtle.getItemCount(12) + turtle.getItemCount(13) + turtle.getItemCount(14) + turtle.getItemCount(15) + turtle.getItemCount(16)
   if total == 0 then
	b = 1
   end
  until b == 1
end
total = turtle.getItemCount(1) + turtle.getItemCount(2) + turtle.getItemCount(3) + turtle.getItemCount(4) + turtle.getItemCount(5) + turtle.getItemCount(6) + turtle.getItemCount(7) + turtle.getItemCount(8) + turtle.getItemCount(9) + turtle.getItemCount(10) + turtle.getItemCount(11) + turtle.getItemCount(12) + turtle.getItemCount(13) + turtle.getItemCount(14) + turtle.getItemCount(15) + turtle.getItemCount(16)
if total > 0 then
  nextChest()
end
until total == 0
home()
end

Thank you for your help.
Lyqyd #2
Posted 05 April 2013 - 08:52 AM
You have at least one instance of "turlte" instead of turtle, and there is a turtle.up in there that's missing its ()s.
Almerish #3
Posted 05 April 2013 - 08:58 AM
You have at least one instance of "turlte" instead of turtle, and there is a turtle.up in there that's missing its ()s.

I found the two problems in the code. Thank you for your speedy reply.