Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- rednet.open("right")
- items = {}
- amount = {}
- term.clear()
- function update()
- term.clear()
- for i=1,#items do
- term.setCursorPos(1,i)
- term.write(items[i].." - "..tostring(amount[items[i]]))
- end
- end
- function checkfor(str)
- exist = false
- for i=1,#items do
- if items[i] == str then
- exist = true
- end
- end
- if not exist then
- table.insert(items,str)
- end
- end
- while true do
- event,id,message = os.pullEvent()
- if event == "rednet_message" then
- item = textutils.unserialize(message)
- checkfor(item[1])
- amount[item[1]] = item[2]
- update()
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment