Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- os.loadAPI("button")
- rednet.open("back") -- side of the
- -- size of the text on screen
- msgAmount = 20 /1
- whitelist = {18} -- ids to listen for
- messages = {} -- list of messages that are going to be displayed.
- function close()
- shell.run("startup")
- end
- button.CreateButton(1,26,26,1,1,1,close,colors.red,"none","x")
- while true do
- event,y,u,b,o = os.pullEvent()
- button.DrawButton()
- button.CheckButtons(event,u,b)
- if event == "rednet_message"then
- for i = 1, #whitelist do
- if tonumber(y) == whitelist[i] then
- table.insert(messages, u)
- end
- if #messages > msgAmount then
- table.remove(messages,1)
- end
- for i = 1, #messages do
- term.setCursorPos(1,i)
- term.write(messages[i])
- end
- end
- end
- end
Add Comment
Please, Sign In to add comment