Advertisement
Guest User

Untitled

a guest
Oct 15th, 2019
125
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.94 KB | None | 0 0
  1. allowed = { 70, 126 }
  2. x,y = term.getSize()
  3. text = "shid and fard came"
  4. scrollat = 7
  5. printed = 0
  6.  
  7. rednet.open("bottom")
  8. term.setBackgroundColor(colors.lightGray)
  9. term.clear()
  10. term.setTextColor(colors.black)
  11.  
  12. term.setCursorPos(math.ceil((x / 2) - (text:len() / 2)), 2)
  13. write(text .. "\n\n")
  14.  
  15. local function has_value(tab, val)
  16. for index, value in ipairs(tab) do
  17. if value == val then
  18. return true
  19. end
  20. end
  21.  
  22. return false
  23. end
  24.  
  25. while true do
  26. id,message = rednet.receive()
  27. if has_value(allowed, id) then
  28. message = message .. " [" .. id .. "]"
  29. else
  30. message = "unallowed log attempted... kinda cringe tbh"
  31. end
  32. local x2,y2 = term.getCursorPos()
  33. if printed < scrollat then
  34. printed = printed + 1
  35. y2 = y2 + 1
  36. else
  37. term.scroll(1)
  38. end
  39. term.setCursorPos(math.ceil((x / 2) - (message:len() / 2)), y2)
  40. write(message)
  41. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement