Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function getvar(text)
- term.clear()
- term.setCursorPos(1,1)
- print(text)
- var = read()
- return var
- end
- function printpos(text)
- term.clear()
- term.setCursorPos(1,1)
- print(text)
- end
- function check()
- nope = false
- for i=1,3 do
- turtle.select(i)
- if turtle.compare() then
- nope = true
- end
- if i==3 and nope == false then
- turtle.dig()
- end
- end
- end
- torch = getvar("use torches? y/n")
- if torch == "y" then
- everyblocks = tonumber(getvar("place torch every how many blocks?"))
- else
- everyblocks = 1
- end
- looksides = getvar("look for ore on sides? y/n")
- finish = tonumber(getvar("How far to dig?"))
- pos = 0
- repeat
- for p=1, everyblocks do
- if pos < finish then
- turtle.dig()
- turtle.forward()
- turtle.digDown()
- if looksides == "y" then
- turtle.turnRight()
- check()
- turtle.turnRight()
- turtle.turnRight()
- check()
- turtle.turnRight()
- end
- if p == everyblocks and torch == "y" then
- turtle.select(16)
- turtle.placeDown()
- end
- pos = pos+1
- end
- end
- until pos >= finish
- turtle.turnRight()
- turtle.turnRight()
- for i=1, finish do
- turtle.forward()
- end
- for i=4, 15 do
- turtle.select(i)
- turtle.dropDown()
- end
- turtle.turnLeft()
- for i=1, 3 do
- turtle.dig()
- turtle.forward()
- turtle.digDown()
- end
- turtle.turnLeft()
- os.reboot()
Advertisement
Add Comment
Please, Sign In to add comment