Alyssa

Tv program

Jul 30th, 2013
175
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.74 KB | None | 0 0
  1. os.loadAPI("modem")
  2. modem.open("right", 700)
  3. print("Opened TV Channel, 700")
  4. while true do
  5. modem.receive()
  6. encrypted = modem.getmsg()
  7. color, bgcolor, message=encrypted:match("(%S+) (%S+) ?(.*)")
  8. rcolor = tonumber(color)
  9. rbgcolor = tonumber(bgcolor)
  10. if rbgcolor == nil then
  11. rbgcolor = 32768
  12. end
  13. if rcolor == nil then
  14. rcolor = 1
  15. end
  16. if not rbgcolor == 1 and 2 and 4 and 8 and 16 and 32 and 64 and 128 and 256 and 512 and 1024 and 2048 and 4096 and 8192 and 16384 and 32768 then
  17. rbgcolor = 32768
  18. end
  19. if not rcolor == 1 and 2 and 4 and 8 and 16 and 32 and 64 and 128 and 256 and 512 and 1024 and 2048 and 4096 and 8192 and 16384 and 32768 then
  20. rcolor = 1
  21. end
  22. term.setBackgroundColor(rbgcolor)
  23. term.setTextColor(rcolor)
  24. print(message)
  25. end
Advertisement
Add Comment
Please, Sign In to add comment