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
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