Advertisement
Guest User

Untitled

a guest
Oct 15th, 2019
122
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. while true do
  16. id,message = rednet.receive()
  17. if has_value(allowed, id) then
  18. message = message .. " [" .. id .. "]"
  19. else
  20. message = "unallowed log attempted... kinda cringe tbh"
  21. end
  22. local x2,y2 = term.getCursorPos()
  23. if printed < scrollat then
  24. printed = printed + 1
  25. y2 = y2 + 1
  26. else
  27. term.scroll(1)
  28. end
  29. term.setCursorPos(math.ceil((x / 2) - (message:len() / 2)), y2)
  30. write(message)
  31. end
  32.  
  33. local function has_value(tab, val)
  34. for index, value in ipairs(tab) do
  35. if value == val then
  36. return true
  37. end
  38. end
  39.  
  40. return false
  41. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement