TeddyJ

Alveary Frames

Apr 18th, 2013
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.56 KB | None | 0 0
  1. function doFrame()
  2.     if not(turtle.suck()) then
  3.         findNextFrame()
  4.     end
  5.     turtle.drop()
  6. end
  7.  
  8. function findNextFrame()
  9.     for i=1,16 do
  10.         if turtle.getItemCount(i)>0 then
  11.             turtle.select(i)
  12.             return
  13.         end
  14.     end
  15. end
  16.  
  17. function restock()
  18.     for _=1,8 do
  19.         turtle.suckUp()
  20.     end
  21.     turtle.select(1)
  22. end
  23.  
  24. if turtle.detect() then
  25.     turtle.turnRight()
  26. end
  27.  
  28. while true do
  29.     if turtle.detectUp() then
  30.         restock()
  31.     end
  32.     turtle.turnLeft()
  33.     if (turtle.detect()) then
  34.         doFrame()
  35.         turtle.turnRight()
  36.         turtle.forward()
  37.     else
  38.         turtle.forward()
  39.     end
  40. end
Advertisement
Add Comment
Please, Sign In to add comment