Advertisement
Guest User

Untitled

a guest
Jun 19th, 2019
96
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.79 KB | None | 0 0
  1.  
  2. function main()
  3. collect()
  4. clearInventory()
  5. goBack()
  6. end
  7.  
  8. function collect()
  9. turtle.turnRight()
  10. turtle.turnRight()
  11. for i=0,14 do
  12. turtle.placeDown()
  13. while not turtle.forward() do
  14. os.queueEvent("randomEvent")
  15. os.pullEvent()
  16. end
  17. end
  18. end
  19.  
  20. function goBack()
  21. turtle.turnRight()
  22. turtle.turnRight()
  23. for i=0,14 do
  24. while not turtle.forward() do
  25. os.queueEvent("randomEvent")
  26. os.pullEvent()
  27. end
  28. end
  29. end
  30.  
  31. function clearInventory()
  32. local tmp = false
  33. if turtle.getFuelLevel()<500 then
  34. tmp = true
  35. end
  36. for i=1,16 do
  37. turtle.select(i)
  38. if tmp then
  39. -- turtle.refuel()
  40. end
  41.  
  42. while not turtle.drop() do
  43. os.queueEvent("randomEvent")
  44. os.pullEvent()
  45. end
  46.  
  47. end
  48. end
  49.  
  50. function refillInventory()
  51. turtle.suck(16)
  52. end
  53.  
  54. main()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement