Advertisement
Pdan4

Untitled

Jun 2nd, 2013
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.12 KB | None | 0 0
  1. term.clear()
  2. term.setCursorPos(1,1)
  3. write("Welcome to the Mining program.\n The Turtle will mine a prism that's to the left, forward, and below.\n GUI by Pdan4, code by David341.")
  4. write("Prism will begin after pressing enter after filling the DEPTH query.\n")
  5.  
  6.  
  7. local a
  8. local b
  9. local c
  10.  
  11.  
  12.  
  13. write("\n \nBlocks forward? ")
  14. local length = read()
  15.  
  16. write("\nBlocks left? ")
  17. local width = read()
  18.  
  19. write("\nBlocks down? ")
  20. local depth = read()
  21.  
  22.  
  23. if depth%2 == 1 then
  24. c= 1
  25. else
  26. c=0
  27. end
  28.  
  29. if length%2 == 1 then
  30. a= 0
  31. else
  32. a=1*c
  33. end
  34.  
  35. if width%2 == 1 then
  36. b= 0
  37. else
  38. b=1*c
  39. end
  40.  
  41.  
  42.  
  43.  
  44. for d=1, depth do
  45. for w=1, width do
  46. turtle.dig()
  47. turtle.digDown()
  48.  
  49. for l=2, length do
  50. turtle.dig()
  51. turtle.forward()
  52. turtle.digDown()
  53.  
  54. end
  55.  
  56. if width-w>0 then
  57. if (w+a*b*c)%2>b then
  58. turtle.turnRight()
  59. turtle.forward()
  60. turtle.turnRight()
  61. end
  62.  
  63. if (w+a*b*c)%2<=b then
  64. turtle.turnLeft()
  65. turtle.forward()
  66. turtle.turnLeft()
  67. end
  68. end
  69. end
  70. turtle.down()
  71. turtle.turnLeft()
  72. turtle.turnLeft()
  73.  
  74. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement