http://www.computercraft.info/forums2/index.php?/topic/16321-mining-turtle-program/page__fromsearch__1
The thing is, when you're digging an endless 3x3, at some point it's going to leave the chunk loaded area and that'll be a problem. I'm making this program with a mod pack, specifically FTB Unleashed 1.1.7 if that helps with anything. Also thinking of switching to Direwolf20 1.6.4 pack. Back to the point, how can I use chunk loaders with my program? Another question I have is since I'm making programs to help me get better at coding, what are some program ideas that would be good practice for a beginner?
term.clear()
term.setCursorPos(1,1)
print("Place torches?")
print("1 = Yes 2 = No")
local x = read()
local test = 0
term.clear()
term.setCursorPos(1,1)
print("How far down should I dig?")
swag = read()
swag = tonumber(swag)
if tonumber(x) == 1 then
test = test + 1
end
function appleTunnel()
turtle.digDown()
while true do
turtle.up()
turtle.dig()
gravityCheck()
turtle.forward()
turtle.turnRight()
turtle.dig()
gravityCheck()
turtle.turnLeft()
turtle.turnLeft()
turtle.dig()
gravityCheck()
turtle.turnRight()
turtle.digDown()
gravityCheck()
turtle.down()
turtle.turnRight()
turtle.dig()
gravityCheck()
turtle.turnLeft()
turtle.turnLeft()
turtle.dig()
gravityCheck()
turtle.turnRight()
turtle.digDown()
turtle.down()
turtle.turnRight()
turtle.dig()
gravityCheck()
turtle.turnLeft()
turtle.turnLeft()
turtle.dig()
gravityCheck()
turtle.turnRight()
turtle.up()
end
end
function placeTorches()
if test == 1 then
turtle.select(3)
turtle.place()
turtle.select(1)
end
end
function emptyInventory()
for i = 4, 16 do
turtle.select(i)
turtle.dropDown(64)
end
end
function gravityCheck()
while turtle.dig() do
if turtle.dig() == false then
break
end
end
end
function appleMine()
for i = 1,swag do
turtle.select(1)
turtle.digDown()
turtle.down()
turtle.digDown()
turtle.down()
turtle.turnRight()
turtle.dig()
gravityCheck()
turtle.turnLeft()
turtle.turnLeft()
turtle.dig()
gravityCheck()
turtle.turnRight()
turtle.dig()
gravityCheck()
turtle.forward()
turtle.turnRight()
turtle.dig()
gravityCheck()
turtle.turnLeft()
turtle.turnLeft()
turtle.dig()
gravityCheck()
turtle.turnRight()
turtle.dig()
gravityCheck()
turtle.forward()
turtle.turnRight()
turtle.dig()
gravityCheck()
turtle.turnLeft()
turtle.turnLeft()
turtle.dig()
gravityCheck()
turtle.turnRight()
turtle.dig()
gravityCheck()
turtle.forward()
turtle.turnRight()
turtle.dig()
gravityCheck()
turtle.turnLeft()
turtle.turnLeft()
turtle.dig()
gravityCheck()
turtle.turnRight()
turtle.back()
placeTorches()
turtle.back()
turtle.up()
turtle.placeDown()
emptyInventory()
appleFuel()
end
end
function appleFuel()
if turtle.getFuelLevel() <= 50 then
turtle.select(2)
turtle.placeUp()
turtle.suckUp()
turtle.refuel(64)
turtle.digUp()
end
end
turtle.select(1)
appleMine()
appleTunnel()