Advertisement
ajthemacboy

Untitled

Jan 26th, 2016
107
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.82 KB | None | 0 0
  1. turtle.refuel() -- might as well, :P
  2.  
  3. while true do -- loop
  4. local action = math.random(1,9) -- Random movement generator
  5.  
  6. if action == 1 then -- forward
  7. for i = 1,5 do
  8. turtle.forward()
  9. end
  10. end
  11.  
  12. if action == 2 then -- forward
  13. for i = 1,5 do
  14. turtle.forward()
  15. end
  16. end
  17.  
  18. if action == 7 then -- forward
  19. for i = 1,5 do
  20. turtle.forward()
  21. end
  22. end
  23.  
  24. if action == 8 then -- forward
  25. for i = 1,5 do
  26. turtle.forward()
  27. end
  28. end
  29.  
  30. if action == 9 then -- forward
  31. for i = 1,5 do
  32. turtle.forward()
  33. end
  34. end
  35.  
  36. if action == 3 then -- up
  37. turtle.up()
  38. end
  39.  
  40. if action == 4 then -- down
  41. turtle.digDown()
  42. turtle.down()
  43. end
  44.  
  45. if action == 5 then -- left
  46. turtle.turnLeft()
  47. end
  48.  
  49. if action == 6 then -- right
  50. turtle.turnRight()
  51. end
  52. sleep(0.5)
  53. end -- end loop
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement