Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- term.clear()
- term.setCursorPos(1,1)
- function fwd()
- turtle.forward()
- end
- function lft()
- turtle.turnLeft()
- end
- function rgt()
- turtle.turnRight()
- end
- function up()
- turtle.up()
- end
- function dwn()
- turtle.down()
- end
- function dig()
- turtle.dig()
- end
- function dup()
- turtle.digUp()
- end
- print("Tunnel Digger by ReactionCraft")
- print("")
- print("")
- print("Length?")
- print("")
- l = tonumber(read())
- print("Height?")
- h = tonumber(read())
- print("Left or right?")
- d = read()
- count = 0
- term.clear()
- term.setCursorPos(1,1)
- print("Length: "..tostring(l))
- print("Height: "..tostring(h))
- print("")
- print("Digging...")
- dig()
- fwd()
- rgt()
- for i2=1,h do
- for i1=1,l do
- dig()
- fwd()
- end
- if count == h-1 then
- break
- else
- dup()
- up()
- lft()
- lft()
- count = count+1
- end
- end
- term.clear()
- term.setCursorPos(1,1)
- print("Returning home...")
- for i3=1,l do
- turtle.back()
- end
- for i4=1,h do
- dwn()
- end
- term.clear()
- term.setCursorPos(1,1)
- print("Finished digging!")
- print("")
- print("Press any key to exit")
- os.pullEvent("key")
- term.clear()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement