Advertisement
ricktap

AE2 Stocker

Sep 25th, 2016
65
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.80 KB | None | 0 0
  1. function main()
  2.     local attachSide = "left"
  3.     local ae2 = attachToAe2(attachSide)
  4.     local items = getAllItems(ae2)
  5.     for i=1, #items do
  6.         item = items[i]
  7.         print("List:")
  8.         for i,v in ipairs(item) do
  9.             print(i .. ": " .. v)
  10.         end
  11.     end
  12. end
  13.  
  14.  
  15. function attachToAe2(attachSide)
  16.     assert(peripheral.getType(attachSide) == "tileinterface", "The computer must be attached to a full block " ..
  17.         "ME Inteface on the specified side.")
  18.     return peripheral.wrap(attachSide)
  19. end
  20.  
  21. function getAllItems(ae2)
  22.     local outputAllItems = ae2.getAvailableItems()
  23.     assert(outputAllItems ~= nil, "No craftable items found in this AE2 network.")
  24.     assert(#outputAllItems > 0, "No craftable items found in this AE2 network.")
  25.     return outputAllItems
  26. end
  27.  
  28. main()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement