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

bios:338 turtle not working

Started by Gujet, 28 December 2012 - 10:50 PM
Gujet #1
Posted 28 December 2012 - 11:50 PM
I have handwritten one of Hypnotizd turtle programs (pokehole) and I have been getting the "bios:338" errors.
the first coupl were spelling mistakes I have made but on line 102 is says that '=' was expected. I have it put in as j = 0and have tried j == 0 and j=0 but none of them work.
Does anyone have a soluton to this problem?
hand writtne code below becuase I don't know how to copy of paste from a turtle

local depth = 50
local lenght = 100
local fuelNeeded = ((length/3)*20) + (depth*2)
local function checkFuel()
while (turtle.getFuelLevl() < fuelNeeded) do
turtle.select(1)
if (turtle.getItemCoun(1) – 0) then
print("not enogh fuel.")
return false
end
turtle.refuel(1)
end
return true
end
local function checkTorches()
if (length / 10 > turtle.getItemCount(2)) then
print("Not enough torches.")
return false
end
return true
end
local dunction checkLadders()
if (turtle.getItemCount(3) < depth) then
print ("Not enough ladders.")
return false
end
return true
end
local function placeTorch()
turtle.select(2)
turtle.placeDown()
end
local function dig()
while (turtle.detect()) do
turtle.dig()
slep(0.5)
end
end
local function dig PokeHoles()
local i = 0
turtle.turnRight()
for i=0, 4 do
dig()
turtle.forward()
end
turtle.turnLeft()
turtle.turnLeft(0
for i=0, 4 do
dig(0
turtle.forward()
end
turtle.turnRight(0
turtle.turnRight(0
for i=0, 4 do
turtle.forward()
end
turtle.turnLeft(0
end
local function digToDepth(0
local ladder = false
if (depth > 1) then
ladder = true
end
if (ladder) then
turtle.turnRight()
turtle.turnRight()
end
local i = 0
while (i < depth) do
turtle.digDown(0
turtle.down(0
if(ladder) then
turtle.dig()
turtle.select(3)
turtle.place()
end
i = i + 1
end
trtle.dgDown()
if (ladder) then
turtle.down()
turtle.dig()
turtle.select(3)
trtle.place(0
turtle.up()
turtle.turnRight()
turtle.turnRiht(
end
placeTorch()
digPokeHoles()
end
local function digTunel(0
local i = 0
local j = 0
loacl k = 0
while (i < length) do
dig()
turtle.forward()
turtle.digDown(0
j = j + 1
if (j == 10) then
placeTorch
j = 0
end
k = k + 1
if (k / 3 – 0) then
digPokeHoles()
k = 0
end
i = i + 1
endend
local function turnAround()
turtle.turnRight()
turtle.turnRight()
end
local function moveToTunnelStart()
local i = 0
for i=1,length do
turtle.forward(0
end
end
local function moveToStartDepth()
local i = 0
for i=1,depth do
turtle.up()
end
end
local function placeSafetyBlock(0
turtle.select(4)
turtle.placeDown(0
print("Complete")
end
if checkFuel(0 and checkTorches and checkLadders() then
digToDepth()
digTunnel()
placeTorch(
turnAround()
moveToTunnelStart()
turnAround(0
moveToStartDepth()
placeSafetyBlock()
end
Jack #2
Posted 29 December 2012 - 01:31 AM
This should be in the Ask A Pro section. But while I'm here, I'll point out the lack of parentheses in the preceding line.

Have a nice day! :)/>
dangranos #3
Posted 29 December 2012 - 05:22 AM
There just missing closing bracket, there: local function digTunel(0.
Bindre12 #4
Posted 29 December 2012 - 06:26 AM
A lot of your code is missing brackets like:

turtle.placeDown(0
turtle.forward(0
correct code

turte.placeDown()
turtle.forward()

And not sure if this will throw a error but when you use For loops there should be more spaces

for i=1,length do
correct code

for i = 1, length do
Tsa6 #5
Posted 01 January 2013 - 03:12 PM
To get codes from turtles just type "pastebin put (Filename)". It will give you info on how to get it off pastebin. Just make sure HTTP_API is true in your turtle config file.
Tsa6 #6
Posted 01 January 2013 - 03:14 PM
Oh, and type your codes in the "code" section of the "Speicel BB Code" menu (Third button on the top).
Lyqyd #7
Posted 01 January 2013 - 03:27 PM
Moved to Ask a Pro.