Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local modem = peripheral.wrap("bottom")
- local chest = peripheral.wrap("back")
- local SERVER_CHANNEL = 1
- local function sendItems(items)
- modem.transmit(2, 1, items)
- sleep(1)
- end
- local function main()
- while true do
- local items = chest.list()
- local event, peripheral_name, channel, reply_channel, message, distance = os.pullEvent("modem_message")
- if channel == SERVER_CHANNEL and message == "req items" then
- sendItems(items)
- end
- end
- end
- main()
Advertisement
Add Comment
Please, Sign In to add comment