Advertisement
BombBloke

Squeezer Stocker (OpenPeripheral)

May 8th, 2022 (edited)
275
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.68 KB | None | 0 0
  1. -- Stocks a Forestry for Minecraft Squeezer with Phosphor and Cobblestone.
  2.  
  3. -- Cobblestone container in front of turtle.
  4. -- Phosphor container below turtle.
  5. -- Squeezer behind turtle.
  6.  
  7. local direction = "east" -- Turtle's location relative to squeezer.
  8.  
  9. local squeezer = peripheral.wrap("back")
  10.  
  11. turtle.select(1)
  12.  
  13. while true do
  14.     for i = 1, 9 do
  15.         local stack = squeezer.getStackInSlot(i)
  16.         local amount = 64 - (stack and (stack.qty) or 0)
  17.        
  18.         if amount > 0 then
  19.             turtle[i > 6 and "suck" or "suckDown"](amount - turtle.getItemCount(1))
  20.             local got = turtle.getItemCount(1)
  21.             if got > 0 then squeezer.pullItemIntoSlot(direction, 1, got, i) end
  22.         end
  23.     end
  24.    
  25.     sleep(60)
  26. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement