Advertisement
npick001

Redstone_Chip_Sorting

Jun 6th, 2023 (edited)
29
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.70 KB | None | 0 0
  1. if(peripheral.isPresent("front")) then
  2.  
  3.     print("Front side exists.")
  4.     chest = peripheral.wrap("front")
  5.     print("Chest connected to front")
  6.  
  7. end
  8.  
  9. while true do
  10.     items = chest.list()
  11.    
  12.     if (#items ~= 0) then
  13.    
  14.         -- Is this the finished item?
  15.         if (items[1].name == "phonos:redstone_chip") then
  16.            
  17.             -- Get items from chest
  18.             turtle.suck()
  19.            
  20.             -- Deposit item in finished chest
  21.             turtle.dropUp()
  22.            
  23.         else
  24.            
  25.             -- Get items from chest
  26.             turtle.suck()
  27.            
  28.             -- Face the drop chest
  29.             turtle.turnRight()         
  30.            
  31.             -- Drop off items
  32.             turtle.drop()
  33.            
  34.             -- reset turtle position
  35.             turtle.turnLeft()
  36.            
  37.         end
  38.     end
  39. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement