Guest User

essentia

a guest
Jul 22nd, 2015
270
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.83 KB | None | 0 0
  1. perilist=peripheral.getNames()
  2. a=peripheral.wrap("front")
  3. cw=peripheral.find("gold")
  4. c="top"
  5. t="back"
  6. aspects=nil
  7. slots=nil
  8. local function scan()
  9.     for i = 2, #perilist do
  10.         if string.find(peripheral.getType(perilist[i]),"tt_aspectContainer") then
  11.             aspects[peripheral.call(perilist[i], "getAspects")[1]]=peripheral.call(perilist[i], "getAspectCount")
  12.         end
  13.     end
  14. end
  15. local function sort()
  16.     for i=1,50 do
  17.   if cw.getStackInSlot(i)~=nil then
  18.         a.pullItem(c,i)
  19.    slots[a.getAspects()[1]]=i
  20.      end
  21.  end
  22. end
  23. local function push(aspect, amount)
  24.     amount=amount-(amount%2)
  25.     give=amount%2
  26.     cw.pushItem(t,slots[aspect],give)
  27. end
  28. sort()
  29. while true do
  30.     scan()
  31.     for aspect, amount in ipairs(aspects) do
  32.         if amount<63 then
  33.             push(aspect, 64-amount)
  34.             sleep(((64-amount)*3)+2)
  35.         end
  36.     end
  37.     sleep(25)
  38. end
Advertisement
Add Comment
Please, Sign In to add comment