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

bios:14 '<name>' expected

Started by suitinacow, 25 May 2016 - 01:10 PM
suitinacow #1
Posted 25 May 2016 - 03:10 PM
I have some experience with programming and I just started learning lua last night on computer craft, my first program which dug spiral stairs was successful but my next two programs give me the same error saying bios:14 '<name>' expected and that doesn't really explain the error.. the line where it told me the problem was didn't seem to have any mistakes.

Below is my flint program

function refuel()
  if turtle.getFuelLevel() < 10 then
    while turtle.getFuelLever() < 100 do
	  turtle.select(1)
	  turtle.refuel(5)
    end
  end
end
function placeAndBreak()
  for i=2,16 do
    turtle.place()
    turtle.break()
    refuel()
  end
end
placeAndBreak()

Below is my shaft program

function refuel()
  if turtle.getFuelLevel() < 10 then
    while turtle.getFuelLevel() < 100 do
	  turtle.select(1)
	  turtle.refuel(5)
    end
  end
end
function pathWays()
  turtle.dig()
  turtle.forward()
  turtle.digUp()
end
function mainHallway()
  pathWays()
  pathWays()
  turtle.turnLeft()
end
function theTunnels()
  while turtle.detect() do
    refuel()
    pathWays()
  end 
end
function return()
  turtle.turnLeft()
  turtle.turnLeft()
  while turtle.detect() == false do
    refuel()
    turtle.forward()
  end
  turtle.turnLeft()
end
while true do
  refuel()
  mainHallway()
  theTunnels()
  reutrn()
end
Lyqyd #2
Posted 25 May 2016 - 03:20 PM
That probably wasn't the full text of the error message. The issue is that "return" is a Lua keyword, so you'll need to rename your function.
suitinacow #3
Posted 25 May 2016 - 03:59 PM
That probably wasn't the full text of the error message. The issue is that "return" is a Lua keyword, so you'll need to rename your function.

It's not the whole error message but the point of the error is the same for both programs, thank you for letting me know the return problem, I'll try to get to it once I get on mine craft. I'm guessing you didn't see any errors in the 1st program?
Dragon53535 #4
Posted 25 May 2016 - 04:02 PM
You've got a mistype in the flint program, line 3. turtle.getFuelLevel not turtle.getFuelLever

But yeah, don't create anything any sort of variable that overrides a keyword in any language. That usually being

if, else, for, while, do, return, break. And a few other's you're not going to really encounter in Lua.
Bomb Bloke #5
Posted 25 May 2016 - 04:18 PM
There's also no such function as "turtle.break()" - I'd've expected the "flint" script to throw an "attempt to call nil" on that one.
Creator #6
Posted 25 May 2016 - 05:26 PM
Here is the wiki page for the turtle api. Lookup which functions exist and which don't.