Guest User

Digger2

a guest
Aug 25th, 2019
80
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. term.clear()
  2. term.setCursorPos(1,1)
  3.  
  4. function fwd()
  5.   turtle.forward()
  6. end
  7.  
  8.  
  9. function lft()
  10.   turtle.turnLeft()
  11. end
  12.  
  13. function rgt()
  14.   turtle.turnRight()
  15. end
  16.  
  17. function up()
  18.   turtle.up()
  19. end
  20.  
  21. function dwn()
  22.   turtle.down()
  23. end
  24.  
  25. function dig()
  26.   turtle.dig()
  27. end
  28.  
  29. function dup()
  30.   turtle.digUp()
  31. end
  32.  
  33. print("Tunnel Digger by ReactionCraft")
  34. print("")
  35. print("")
  36. print("Length?")
  37. print("")
  38.  
  39. l = tonumber(read())
  40.  
  41. print("Height?")
  42.  
  43. h = tonumber(read())
  44.  
  45. print("Left or right?")
  46.  
  47. d = read()
  48.  
  49. count = 0
  50.  
  51. term.clear()
  52. term.setCursorPos(1,1)
  53. print("Length: "..tostring(l))
  54. print("Height: "..tostring(h))
  55. print("")
  56. print("Digging...")
  57.  
  58. dig()
  59. fwd()
  60. rgt()
  61.  
  62. for i2=1,h do
  63.   for i1=1,l do
  64.     dig()
  65.     fwd()
  66.   end
  67.   if count == h-1 then
  68.     break
  69.   else
  70.   dup()
  71.   up()
  72.   lft()
  73.   lft()
  74.   count = count+1
  75.   end
  76. end
  77.  
  78. term.clear()
  79. term.setCursorPos(1,1)
  80. print("Returning home...")
  81. for i3=1,l do
  82.   turtle.back()
  83. end
  84.  
  85. for i4=1,h do
  86.   dwn()
  87. end
  88.  
  89. term.clear()
  90. term.setCursorPos(1,1)
  91. print("Finished digging!")
  92. print("")
  93. print("Press any key to exit")
  94. os.pullEvent("key")
  95. term.clear()
RAW Paste Data