Please Help me with computercraft

Josh Senneff

New Member
Jul 29, 2019
10
0
0
Hi. Ive been trying to program a mining turtle to mine a 2x1 tunnel. Ive tried to program it to place torches, place blocks underneith it as it goes and I tried to make it go to a chest when its done and put everything in it and then to move on to the next tunnel. Everytime I try to mine a certain distance long tunnel, it doesnt mine the amount of blocks I want and when it tries to go back to the chest but it doesnt make it the whole way there. Heres the pastebin link:
Http://pastebin.com/CMFGZLDR
Please Help!
 

Lawbroken

New Member
Jul 29, 2019
1,336
0
0
You make have to change it a little and also this was used in before 1.6

Code:
-- Sand and gravel safe
function safe()
  if turtle.forward() == false then
    repeat
      turtle.dig()
        sleep(0.40)
  until turtle.forward() == true
end
end
--Placing Light
local M = 0
function Light()
  if M == 8 then
    M = M-8
    turtle.digDown()
    turtle.down()
    turtle.detectDown() if true then
      turtle.select(1)
      turtle.placeDown()
      turtle.up()
        turtle.select(15)
        turtle.placeDown()
      end
      turtle.detectDown() if false then
        turtle.select(15)
        turtle.placeDown()
      end
      end
    end
-- Pattern
function Mining()
turtle.digUp()
safe()
turtle.digDown()
end
-- Asks for input
write ("How long? > ")
  local num = tostring(
  read() )
-- Replies when input is complete 
write (" Request Accept. ")
local L = num
-- Loop for mining
for i=1,L do
  Mining()
end
turtle.turnLeft()
safe()
turtle.digUp()
turtle.digDown()
turtle.dig()
safe()
turtle.digUp()
turtle.digDown()
turtle.dig()
safe()
turtle.turnRight()
turtle.dig()
safe()
turtle.turnLeft()
turtle.turnLeft()
for i=1,L do
  Mining()
end
 

Josh Senneff

New Member
Jul 29, 2019
10
0
0
Oh ok. I got the base of it online and I added to it cause I dont know how to start it off so do you know what I have to do to get it to work?