Advertisement
kunyuu

ComputerCraft Powah Automation

Feb 16th, 2021
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.66 KB | None | 0 0
  1. --This program does not automate Nitro Crystals at this time
  2.  
  3. local orb = peripheral.wrap("top")
  4. local inChest = peripheral.wrap("left")
  5. local outChest = peripheral.wrap("right")
  6. local size = inChest.size()
  7.  
  8. while true do
  9.     local orbSlot = orb.getItemDetail(2)
  10.     local finishSlot = orb.getItemDetail(1)
  11.    
  12.     if (orbSlot == nil and finishSlot == nil) then
  13.         for i=1, size do
  14.             local contents = inChest.getItemDetail(i)
  15.             if (contents ~= nil) then
  16.                 if (contents.name == "minecraft:diamond" or contents.name == "minecraft:emerald" or contents.name == "minecraft:blaze_rod" or contents.name == "minecraft:iron_ingot") then
  17.                     inChest.pushItems("top", i, 1)
  18.                     break
  19.                 end
  20.             end
  21.         end
  22.     elseif (orbSlot ~= nil and orbSlot.name == "minecraft:iron_ingot") then
  23.        
  24.         local goldSlot = orb.getItemDetail(3)
  25.        
  26.         if (goldSlot == nil) then
  27.             for i=1, size do
  28.                 local contents = inChest.getItemDetail(i)
  29.                
  30.                 if (contents ~= nil) then    
  31.                     if (contents.name == "minecraft:gold_ingot") then
  32.                         inChest.pushItems("top", i, 1)
  33.                         break
  34.                     end
  35.                 end
  36.             end
  37.         end
  38.     elseif (finishSlot ~= nil) then
  39.         if (finishSlot.name == "powah:steel_energized" or finishSlot.name == "powah:crystal_spirited" or finishSlot.name == "powah:crystal_niotic" or finishSlot.name == "powah:crystal_blazing") then
  40.             orb.pushItems("right", 1)
  41.         end
  42.     end
  43. end
  44.            
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement