Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function shaft()
- --variables
- shaftdepth = 0
- shaft_branch_count = 0
- term.clear()
- repeat
- turtle.dig()
- if turtle.forward() then
- shaftdepth = shaftdepth + 1
- shaft_branch_count = shaft_branch_count + 1
- --percentage()
- turtle.digUp()
- else
- print("Movement Impeded!")
- turtle.dig()
- end
- if shaft_branch_count == 3 then
- turtle.turnLeft()
- branch()
- end
- until shaftdepth == des_depth
- shaft_return()
- end
- function branch()
- branchdepth = 0
- repeat
- turtle.dig()
- if turtle.forward() then
- branchdepth = branchdepth +1
- turtle.digUp()
- else
- print("Movement Impeded!")
- turtle.dig()
- end
- until branchdepth == des_branch_depth
- turtle.turnLeft()
- turtle.turnLeft()
- repeat
- if turtle.forward() then
- des_branch_depth = des_branch_depth - 1
- else
- print("Movement Impeded!")
- turtle.dig()
- sleep(0.5)
- end
- until des_branch_depth == 0
- turtle.turnLeft()
- end
- function shaft_return()
- end
- function dorotate()
- end
- function percentage()
- percent = tonumber(shaftdepth) / tonumber(des_depth) * 100
- percentage = math.ceil(percent)
- print("Completed " ..percentage.. "%")
- end
- print("Pinwheel Mining System V. 0.2B")
- sleep (1)
- print("Place in a 3x3 room at desired height")
- sleep(1)
- print("Ready? [y/n]")
- sleep(0.5)
- local confirm = read()
- if confirm == "y" then
- term.clear()
- sleep(1)
- print("Desired Shaft Length:")
- sleep(0.5)
- des_depth = read()
- print("Branch Depth = Shaft Length + 2")
- des_branch_depth = des_depth + 2
- term.clear()
- sleep(1)
- --print("Desired Branch Length:")
- --sleep(0.5)
- --des_branch_depth = read()
- shaft()
- else
- os.shutdown()
- end
Advertisement
Add Comment
Please, Sign In to add comment