Posted 03 January 2013 - 11:47 AM
Here again with a script that will dig a 2x1 mine shaft and place a torch and fuel if need be
Whever I run it I get the error
I find this odd because line 18 is just function declaration.
Here is the code
Whever I run it I get the error
"turtle:18:number expected"
I find this odd because line 18 is just function declaration.
Here is the code
--Variables
local tArgs = { ... }
local togo = tonumber (tArgs[1])
local num = 0
--Function
function tfuel(amount)
local fuelLevel = turtle.getFuelLevel()
if fuelLevel < 50 then
turtle.select(16)
turtle.refuel(amount)
turtle.select(1)
end
end
function torch()
if num == 10 then
turtle.select(15)
turtle.placeUp()
turtle.select(1)
num = 0
end
end
function detect()
turtle.detect()
if result == true then
turtle.dig()
end
end
function layer()
turtle.dig()
os.sleep(.25)
detect()
turtle.up()
turtle.dig()
os.sleep(.25)
detect()
turtle.down()
turtle.forward()
end
--Main Script
repeat
tfuel()
layer()
torch()
num = num + 1
togo = togo - 1
until togo == 0