Guest User

stairs

a guest
Dec 25th, 2012
2,776
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.78 KB | None | 0 0
  1. --Ask the user how far to go
  2.  
  3. print("How far?")
  4.  
  5. --Take input from the user
  6. --and make dist equal to it
  7.  
  8. dist = read()
  9.  
  10. --Starting program...
  11. --Detect if something is above
  12. --if so then dig it
  13. --(to handle gravel/sand)
  14.  
  15. function dSand()
  16.  
  17. while turtle.detectUp() do
  18.   turtle.digUp()
  19.     sleep(0.50)
  20.       end
  21. end
  22.  
  23. dSand()      
  24. turtle.digDown()
  25.  
  26. --Add +1 till dist is met
  27. --As long as dist is not met do
  28. --what follows
  29.  
  30. for i = 1, dist do
  31.  
  32.  --Call function to handle sand if it
  33.  --falls on top of the turtle during operation
  34.  
  35. dSand()
  36.      
  37. turtle.dig()
  38.    
  39. --This handles sand/gravel infront
  40. --of the turtle
  41.  
  42.   while not turtle.forward() do
  43.     turtle.dig()
  44.       end
  45.      
  46. dSand()
  47.  
  48.     turtle.digDown()
  49.     turtle.down()
  50.     turtle.digDown()
  51. end
Advertisement
Add Comment
Please, Sign In to add comment