Posted 14 January 2013 - 02:46 PM
I am working on making a simple branch mining program (as shown below), however i seem to be having two problems. First is i am not sure how i am going to handle invintory. I want to make it so that when the turtle's slots get full it gose back to the start of the mine and drops off its invintory in a chest. I already put a code in to drop its invintory at the start of the program, but this is a temporary part of the coding. Second when my turtle hit lava it stoped its script completly. I know this for when i found it in the middle of a lava lake the script was off (it still had about 25,000 fuel if you were wondering). Any help would be apreciated (i do know i haven't put in the coding for gravle yet, but i do know how to do that coding so please don't put a post about it).
Spoiler
local function Torch()
turtle.turnLeft()
turtle.turnLeft()
turtle.up()
turtle.select(1)
turtle.place()
turtle.down()
turtle.turnLeft()
turtle.turnLeft()
end
turtle.turnLeft()
turtle.turnLeft()
turtle.select(2)
turtle.drop()
turtle.select(3)
turtle.drop()
turtle.select(4)
turtle.drop()
turtle.select(5)
turtle.drop()
turtle.select(6)
turtle.drop()
turtle.select(7)
turtle.drop()
turtle.select(8)
turtle.drop()
turtle.select(9)
turtle.drop()
turtle.select(10)
turtle.drop()
turtle.select(11)
turtle.drop()
turtle.select(12)
turtle.drop()
turtle.select(13)
turtle.drop()
turtle.select(14)
turtle.drop()
turtle.select(15)
turtle.drop()
turtle.select(16)
turtle.drop()
turtle.select(1)
turtle.turnLeft()
turtle.turnLeft()
Arg = (...)
if Arg ~= nil then
Length = tonumber(Arg)
Place = 8
a = 1
b = 1
c = 1
d = 0
e = 1
while a<= Length do
if turtle.detect() then
d = d+1
turtle.dig()
turtle.forward()
if turtle.detectUp() then
turtle.digUp()
end
elseif not turtle.detect() then
while b<= d do
turtle.back()
b = b+1
a = Arg
end
end
a = a+1
c = c+1
while c>= Place do
Torch()
c = c-7
end
end
while a>= Length do
turtle.back()
e = e+1
while e>= a do
a = a-a
end
end
end