Advertisement
visiongaming43

Untitled

Sep 23rd, 2021
54
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.44 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*2) * (width*2) * (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. for a = height, 1, -1
  24. do
  25. turtle.digDown()
  26. turtle.down()
  27. for b = length, 1, -1
  28. do
  29. turtle.dig()
  30. turtle.forward()
  31. turtle.turnRight()
  32. for c = width-1, 1, -1
  33. do
  34. turtle.dig()
  35. turtle.forward()
  36. end
  37. turtle.turnLeft()
  38. turtle.turnLeft()
  39. for d = width-1, 1, -1
  40. do
  41. turtle.forward()
  42. end
  43. turtle.turnRight()
  44. end
  45. turtle.turnRight()
  46. turtle.turnRight()
  47. for e = length, 1, -1
  48. do
  49. turtle.forward()
  50. end
  51. turtle.turnRight()
  52. turtle.turnRight()
  53. end
  54. for f = height, 1, -1
  55. do
  56. turtle.up()
  57. end
  58. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement