Advertisement
visiongaming43

Untitled

Sep 23rd, 2021
49
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.46 KB | None | 0 0
  1. -- Get fuel level for turtle
  2.  
  3. local fuelLevel = turtle.getFuelLevel()
  4.  
  5. -- Ask user for length, width, and height of quarry ( rectangle )
  6.  
  7. print("Please enter the length of your quarry")
  8. local length = io.read()
  9.  
  10. print("Please enter the width of your quarry")
  11. local width = io.read()
  12.  
  13. print("Please enter how far you would like the quarry to go down")
  14. local height = io.read()
  15.  
  16. if(fuelLevel < (((length) * (width) * (height)) + 2 )) then
  17. print("You don't have enough fuel to run this code! Sorry!")
  18. else
  19. print("Success! You have enough fuel! Starting program now!")
  20.  
  21. local x1, y1, z1 = gps.locate()
  22.  
  23. turtle.forward()
  24.  
  25. for a = height, 1, -1
  26. do
  27. turtle.digDown()
  28. turtle.down()
  29. for b = length, 1, -1
  30. do
  31. turtle.dig()
  32. turtle.forward()
  33. turtle.turnRight()
  34. for c = width-1, 1, -1
  35. do
  36. turtle.dig()
  37. turtle.forward()
  38. end
  39. turtle.turnLeft()
  40. turtle.turnLeft()
  41. for d = width-1, 1, -1
  42. do
  43. turtle.forward()
  44. end
  45. turtle.turnRight()
  46. end
  47. turtle.turnRight()
  48. turtle.turnRight()
  49. for e = length, 1, -1
  50. do
  51. turtle.forward()
  52. end
  53. turtle.turnRight()
  54. turtle.turnRight()
  55. end
  56. for f = height, 1, -1
  57. do
  58. turtle.up()
  59. end
  60. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement