Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- allowed = { 70, 126 }
- x,y = term.getSize()
- text = "shid and fard came"
- scrollat = 7
- printed = 0
- rednet.open("bottom")
- term.setBackgroundColor(colors.lightGray)
- term.clear()
- term.setTextColor(colors.black)
- term.setCursorPos(math.ceil((x / 2) - (text:len() / 2)), 2)
- write(text .. "\n\n")
- local function has_value(tab, val)
- for index, value in ipairs(tab) do
- if value == val then
- return true
- end
- end
- return false
- end
- while true do
- id,message = rednet.receive()
- if has_value(allowed, id) then
- message = message .. " [" .. id .. "]"
- else
- message = "unallowed log attempted... kinda cringe tbh"
- end
- local x2,y2 = term.getCursorPos()
- if printed < scrollat then
- printed = printed + 1
- y2 = y2 + 1
- else
- term.scroll(1)
- end
- term.setCursorPos(math.ceil((x / 2) - (message:len() / 2)), y2)
- write(message)
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement