Advertisement
osmarks

Printron Omega

Aug 15th, 2018
552
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.70 KB | None | 0 0
  1. local chest = peripheral.wrap "minecraft:dropper_172"
  2. local printer_side = "down"
  3.  
  4. --[[
  5. printer slots:
  6. slot 1 = dye
  7. slots 2-7 = paper
  8. slots 8-14 = output
  9. ]]
  10.  
  11. while true do
  12.     for i = 8, 13 do -- extract printed output
  13.         local moved = chest.pullItems(printer_side, i)
  14.         if moved > 0 then print "Extracted a page!" end
  15.     end
  16.  
  17.     for slot, item in pairs(chest.list()) do
  18.         if item.name == "minecraft:paper" then
  19.             local moved = chest.pushItems(printer_side, slot, 64, 2)
  20.             if moved > 0 then print("Inserted paper!") end
  21.         elseif item.name == "minecraft:dye" then
  22.             local moved = chest.pushItems(printer_side, slot, 64, 1)
  23.             if moved > 0 then print("Inserted dye!") end
  24.         end
  25.     end
  26.  
  27.     sleep(2)
  28. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement