Advertisement
s3ptum

mine turtle exp

Aug 2nd, 2020 (edited)
1,663
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.96 KB | None | 0 0
  1. term.write("how many blocks between torches?")
  2. local binput = tonumber( read() )
  3. term.clear()
  4.  
  5. --i wanted a multiplier for how many torches to put down time how many spaces between torches.
  6. --term.write("How many cycles?")
  7. --local tinput = tonumber( read() )
  8. --term.clear()
  9. term.write("Thank You!")
  10.  
  11.  
  12. --dig enough space for steve to step through
  13. function mine()
  14.     turtle.dig()
  15.     turtle.digUp()
  16. end
  17.  
  18. --Check if required space for steve is available.
  19. function moveCheck()
  20.     turtle.forward()
  21.     turtle.up()
  22.     turtle.down()
  23. end
  24.  
  25. --Place torch.
  26. function torch() --Place torch.
  27.         turtle.select(16)
  28.         turtle.place()
  29. end
  30.  
  31. --Turn around.
  32. function turnAround()
  33.     turtle.turnLeft()
  34.     turtle.turnLeft()
  35. end
  36.  
  37. function placeTorch()
  38.     turnAround()
  39.     torch()
  40.     turnAround()
  41. end
  42.  
  43. --Move until hit block then mine.
  44.     for n = 1, binput + 1 do
  45.         while not moveCheck() do
  46.             mine()
  47.         end  
  48.     end  
  49. end    
  50.    
  51.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement