Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local component = require('component')
- local sides = require('sides')
- local term = require('term')
- --- Initialize our barrels
- redstoneBarrel = component.proxy('532c4882-8999-4a6f-8771-42dca8e36479')
- diamondBarrel = component.proxy('7ee6ccc8-1c81-4e1f-acaf-54397496ebfa')
- cobblestoneBarrel = component.proxy('15d02141-62c4-4026-9fa3-8b766b3d47fe')
- allBarrels = {}
- allBarrels[diamondBarrel.getAllStacks()[2].all().display_name] = diamondBarrel
- allBarrels[redstoneBarrel.getAllStacks()[2].all().display_name] = redstoneBarrel
- allBarrels[cobblestoneBarrel.getAllStacks()[2].all().display_name] = cobblestoneBarrel
- userChest = component.proxy('d6d5b397-6c3f-4291-9f3d-af2a67fcfd92')
- redstoneBlock = component.proxy('5f2a5daf-d4d4-42e8-8125-a0a4778a87d7')
- function printAllItems()
- for key,value in pairs(allBarrels) do print(key,value.getAllStacks()[2].all().qty) end
- end
- function pushItemToInventory(inventory_from, direction, slot_from,slot_to)
- inventory_from.pushItemIntoSlot(direction,slot_from,1,slot_to)
- end
- while true do
- term.clear()
- printAllItems()
- print("Item name:")
- requestedItem = io.read()
- if requestedItem == '' then do
- redstoneBlock.setOutput(sides.down,15)
- end
- print("Amount:")
- amount = io.read()
- allBarrels[requestedItem].pushItemIntoSlot(2,2,tonumber(amount),1)
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement