orngix

Forward

Feb 18th, 2013
181
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.41 KB | None | 0 0
  1. fly = fly or 0
  2. dig = dig or 0
  3. arg = (...)
  4. arg = tonumber(arg) or 1
  5. x = 0
  6. while x < arg do
  7.  
  8. if tog == 1 then
  9. turtle.dig()
  10. end
  11.  
  12. if fly == 1 then
  13. turtle.forward()
  14. x = x + 1
  15. end
  16.  
  17. while fly == 0 and turtle.detect() == true do
  18. turtle.up()
  19. end
  20.  
  21. if fly == 0 then
  22. turtle.forward()
  23. x = x + 1
  24. end
  25.  
  26. while fly == 0 and turtle.detectDown() == false do
  27. turtle.down()
  28. end
  29.  
  30. end
Add Comment
Please, Sign In to add comment