Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --[[
- Original source: https://www.reddit.com/r/feedthebeast/comments/4pei7y/ie_ae2_computercraft_open_peripherals/
- https://pastebin.com/J62TRZD1
- --]]
- i = peripheral.wrap("top")
- c = peripheral.wrap("left")
- stock_multiple = 64
- while true do
- sleep_time = 1
- for k, item in pairs(c.getAllStacks()) do
- item_basic = item.basic()
- ae_info = i.getItemDetail(item_basic)
- if ae_info ~= nil then
- amount = ae_info.basic().qty
- amount_to_stock = item_basic.qty * stock_multiple
- if amount < amount_to_stock then
- diff = amount_to_stock - amount
- print("requesting " .. item_basic.name)
- print("current: " .. amount .. " additional: " .. diff)
- i.requestCrafting(item.basic(), diff)
- sleep_time = 5
- else
- print(item_basic.name .. " sufficient at: " .. amount)
- end
- else
- print(item.basic().name .. " has no crafting recipe.")
- end
- end
- os.sleep(sleep_time)
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement