DasLoki

cc/powah_craft_handling

Nov 19th, 2022 (edited)
1,764
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 2.27 KB | None | 0 0
  1. inputChest = peripheral.wrap("top")
  2. outputChest = peripheral.wrap("right")
  3. orb = peripheral.wrap("left")
  4.  
  5. while(true)
  6. do
  7.     starterItem = inputChest.getItemDetail(1)
  8.     orbOutput = orb.getItemDetail(1)
  9.     size = inputChest.size()
  10.  
  11.     if(orbOutput ~= nil)
  12.     then
  13.         outputChest.pullItems(peripheral.getName(orb), 1)
  14.     elseif(orb.getItemDetail(2) ~= nil)
  15.     then
  16.     elseif(starterItem == nil)
  17.     then
  18.         for i = 1, size, 1
  19.         do
  20.             slot = inputChest.getItemDetail(i)
  21.             if slot ~= nil
  22.             then
  23.                 inputChest.pushItems(peripheral.getName(inputChest), i,slot.count,1)
  24.                 break
  25.             end
  26.         end
  27.     elseif(starterItem ~= nil)
  28.     then
  29.         if(starterItem.displayName == "Iron Ingot" or starterItem.displayName == "Gold Ingot")
  30.         then
  31.             if(orb.getItemDetail(2) == nil or (orb.getItemDetail(2).count < 1 and orb.getItemDetail(3).count < 1))
  32.             then
  33.                 secondSlot = inputChest.getItemDetail(2)
  34.                 if(secondSlot ~= nil)
  35.                 then
  36.                     orb.pullItems(peripheral.getName(inputChest), 1, 1)
  37.                     orb.pullItems(peripheral.getName(inputChest), 2, 1)
  38.                 end
  39.             end
  40.         elseif(starterItem.displayName == "Diamond")
  41.         then
  42.             if(orb.getItemDetail(2) == nil or orb.getItemDetail(2).count < 1)
  43.             then
  44.                 orb.pullItems(peripheral.getName(inputChest), 1, 1)
  45.             end
  46.         elseif(starterItem.displayName == "Diamond")
  47.         then
  48.             if(orb.getItemDetail(2) == nil or orb.getItemDetail(2).count < 1)
  49.             then
  50.                 orb.pullItems(peripheral.getName(inputChest), 1, 1)
  51.             end
  52.         elseif(starterItem.displayName == "Emerald")
  53.         then
  54.             if(orb.getItemDetail(2) == nil or orb.getItemDetail(2).count < 1)
  55.             then
  56.                 orb.pullItems(peripheral.getName(inputChest), 1, 1)
  57.             end
  58.         elseif(starterItem.displayName == "Blaze Rod")
  59.         then
  60.             if(orb.getItemDetail(2) == nil or orb.getItemDetail(2).count < 1)
  61.             then
  62.                 orb.pullItems(peripheral.getName(inputChest), 1, 1)
  63.             end
  64.         end
  65.     end
  66. end
Advertisement
Add Comment
Please, Sign In to add comment