Advertisement
Guest User

Untitled

a guest
Oct 12th, 2017
86
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.78 KB | None | 0 0
  1. local sslot = 1
  2. while true do
  3.  
  4. if turtle.getFuelLevel() > 0 then -- check fuel level
  5. turtle.select(sslot) -- if it has fuel it proceeds
  6. print ("todo bien")
  7. if turtle.getItemCount() > 0 then -- checks if current slot has items
  8. local details = turtle.getItemDetail() -- check if item is a rail
  9. if details.name = "Railcraft:track" then-- check if item is a rail
  10. turtle.forward() then -- moves forward
  11. turtle.digDown()
  12. turtle.placeDown()
  13. print ("todo bien")
  14. if turtle.getItemCount(15) > 1 then
  15. turtle.drop(1)
  16. print ("todo bien")
  17. end
  18. else
  19. sslot = (sslot%16)+1
  20. turtle.select(sslot)
  21. print ("todo bien")
  22. end
  23. else
  24. sslot = (sslot%16)+1
  25. turtle.select(sslot)
  26. print ("todo bien")
  27. end
  28. else
  29. turtle.select(16)
  30. turtle.refuel(1)
  31. print ("todo bien")
  32. end
  33. sleep(1)
  34. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement