Posted 01 August 2013 - 11:22 PM
Thanks for the help! One last error: when I enter in the lengths, it runs the main mining script. I set up the main mining script to recognize the 3 potential lengths and mine based on that. The problem is that my if then statements are not executing the lines below them. For example, this script below will not execute anything even if the input is 3.
if input == 3 then
loop1 = 3
end --if
Pastebin: http://pastebin.com/dce5aszc
-- Script for turning around
function turnAround()
turtle.turnRight(2)
end --turnAround()
-- Script for placing torches
function torch()
turtle.select(16)
turnAround()
turtle.place()
turtle.select(1)
turnAround()
end --torch()
-- Script for primary digging
function dig()
turtle.dig()
turtle.forward()
turtle.digUp()
end --dig()
-- Script for Forward mining
function mineForward()
dig(3)
end --mineForward()
--Sub script for digging sides
function mineSides1()
if dig2 == 5 then
dig(5)
turnAround()
turtle.forward(5)
end --if
if dig2 == 3 then
dig(3)
turnAround()
turtle.forward(3)
end --if
if dig == 1 then
dig()
turnAround()
turtle.forward()
end --if
end --mineSides1
--Script for digging sides
function mineSides2()
turtle.turnLeft()
mineSides1
mineSides1
turtle.turnRight()
end --mineSides2()
-- Script for all mining
function mine()
mineForward()
mineSides2()
end --mine()
-- Script for everything
function main()
if dig1 == 12 then
mine(12)
end --if
if dig1 == 6 then
mine(6)
end --if
if dig1 == 3 then
mine(3)
end --if
end --main()
--Actual program script
term.clear()
print("Hello.")
print("Please enter the tunnel length (3,6,12)")
dig1 = read()
tonumber(dig1)
print("Please enter the side tunnel length (1,3,5)")
dig2 = read()
tonumber(dig2)
term.clear()
print("Mining will now commence.")
main()
print("Done.")
Edited by