Advertisement
npexception

CC Milking Turtle

Jan 20th, 2018
86
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.70 KB | None | 0 0
  1. local version = 1.0
  2. if _UD and _UD.su(version, "pbsqSiPh", {...}) then return end
  3.  
  4. -- A cow in front of the turtle will be milked
  5. -- using buckets. An inventory containing only
  6. -- empty buckets needs to be available next to
  7. -- the turtle, as well as an inventory to
  8. -- drop filled buckets to. Change the following
  9. -- variables depending on your setup.
  10. -- (Script requires the BetterTurtleApi: https://pastebin.com/6XL8EYXe)
  11.  
  12. -- direction where empty buckets will be sucked from
  13. local from = "top"
  14. -- direction where items will be dropped to
  15. local to = "bottom"
  16. -- seconds the turtle will wait between phases
  17. local pauseLength = 0.5
  18.  
  19. term.clear()
  20. term.setCursorPos(2,2)
  21. if term.isColor() then
  22.   term.setTextColor(colors.orange)
  23. end
  24. local versionString = tostring(version)
  25. if version == math.floor(version) then
  26.   versionString = versionString..".0"
  27. end
  28. term.write("Euter Destroyer "..versionString)
  29.  
  30. local function note(txt, color)
  31.   term.setCursorPos(2,4)
  32.   term.clearLine()
  33.   if term.isColor() then
  34.     term.setTextColor(color or colors.white)
  35.   end
  36.   term.write(txt)
  37. end
  38.  
  39. while true do
  40.   note("Droppe Inventar...", colors.yellow)
  41.  
  42.   for i=1,16 do
  43.     turtle.select(i)
  44.     turtle.dropDirection(to)
  45.     while turtle.getItemCount() > 0 do
  46.       sleep(1)
  47.       turtle.dropDirection(to)
  48.     end
  49.   end
  50.  
  51.   sleep(pauseLength)
  52.  
  53.   note("Hole Eimer...", colors.lightBlue)
  54.  
  55.   turtle.select(1)
  56.   turtle.suckDirection(from, 16)
  57.   while turtle.getItemCount() == 0 do
  58.     sleep(1)
  59.     turtle.suckDirection(from, 16)
  60.   end
  61.  
  62.   sleep(pauseLength)
  63.  
  64.   note("Sauge Milch ab...", colors.lime)
  65.   for i=1,turtle.getItemCount() do
  66.     turtle.place()
  67.   end
  68.  
  69.   sleep(pauseLength)
  70. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement