Hey y'all first time using lua in years, and highly inexperienced in it in the first place.
I wrote this program to go down a BuildCraft Quarry hole in the nether and remove lava as it finds it, but as I'm inexperienced, I'm getting issues and need help.
Code:
local left = true
local descended = false
local function refuel()
if turtle.getFuelLevel() ~= "unlimited" and turtle.getFuelLeve() < 2 then
turtle.refuel(1)
end
end
local function forward()
while(turtle.forward()) do
turtle.suck()
refuel()
end
end
local function turn()
if left then
turtle.turnLeft()
else
turtle.turnRight()
end
turtle.suck()
refuel()
if not turtle.forward() then
descend()
end
if left then
turtle.turnLeft()
else
turtle.turnRight()
end
if not descended then
left = not left
else
descended = false
end
end
local function descend()
turtle.suckDown()
refuel()
while turtle.detectDown() do end
turtle.down()
descnded = true
end
while true do
forward()
turn()
end
Current Error:
Line:46: attempt to call global 'forward' (a nil value)
Line in question:
while true do
forward() <--------
turn()
end