Advertisement
s3ptum

mine3

Aug 4th, 2020
1,558
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.40 KB | None | 0 0
  1.  
  2. --varibles
  3. --local binput = tonumber( read() ) --length of cycle
  4. --local tinput = tonumber( read() )  --number of cycles
  5. --local i = 1
  6.  
  7. --Opening dialogue
  8. term.write("Welcome!")
  9. sleep(5)
  10. term.clear()
  11. sleep(3)
  12. term.write("Please place fuel in first slot and torches in second slot.")
  13. sleep(5)
  14. term.clear()
  15. sleep(5)
  16.  
  17. --Begin Input Request
  18. term.write("How many blocks between torches?")
  19. local binput = tonumber( read() )
  20. term.clear()
  21. term.write("How many cycles i.e. torches?")
  22. local tinput = tonumber( read() )
  23. term.clear()
  24. term.write("Thank You!")
  25.  
  26. --check fuel and refuel
  27. function getFuel()
  28. if turtle.getFuelLevel() < 100 then
  29.         turtle.select(1)
  30.         turtle.refuel()
  31.     else term.print("Out of Fuel!")
  32.     break
  33. end
  34.  
  35.        
  36. --dig enough space for steve to step through
  37. function mine()
  38.     turtle.dig()
  39.     turtle.digUp()
  40. end
  41.  
  42. --Check if required space for steve is available and locomotion.
  43. function moveCheck()
  44.     turtle.forward()
  45.     turtle.up()
  46.     turtle.down()
  47. end
  48.  
  49. --Place torch.
  50. function torch() --Place torch.
  51.         turtle.select(2)
  52.         turtle.place()
  53. end
  54.  
  55. --Turn around.
  56. function turnAround()
  57.     turtle.turnLeft()
  58.     turtle.turnLeft()
  59. end
  60.  
  61. --Place Torch
  62. function placeTorch()
  63.     turnAround()
  64.     torch()
  65.     turnAround()
  66. end
  67.  
  68. --Move until hit block then mine.
  69. local i = 1
  70. repeat 
  71.     moveCheck()
  72.     else mine()
  73.     i = i + 1
  74.     until i == binput
  75.     else placeTorch()
  76.    
  77.     end
  78.    
  79.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement