craniumkid22

screensaver

Apr 30th, 2014
276
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 2.85 KB | None | 0 0
  1. --totally a harmless screensaver, i swear
  2. math.randomseed(os.time())
  3. --if adding additional lines, the string cannot be longer than the monitor size
  4. local displayStringTab = {
  5. "You're so dumb, you think socialism means partying!",
  6. "You're so dumb, you think Johnny Cash is a pay toilet!",
  7. "You're so dumb, it takes you an hour and a half to watch '60 Minutes'!",
  8. "You're so stupid, that you went to a Clippers game to get a hair cut.",
  9. "You're so stupid, that you went to a Whalers game to see Shamu.",
  10. "You're so stupid, it takes you an hour to cook minute rice.",
  11. "You're so ugly, you'd make a train take a dirt road!",
  12. "You're so ugly, when you walk into a bank, they turn the cameras off!",
  13. "You're so ugly, you could be the poster child for birth control!",
  14. "You're so ugly, when you were born the doctor slapped your mother!",
  15. "You're face is so ugly, when you cry the tears run up your face.",
  16. "You're so ugly, your mother had to feed you with a sling shot.",
  17. "You're so fat, when you sit around the house, you sit AROUND the HOUSE!",
  18. "You're so fat, a picture of you would fall off the wall!",
  19. "You're so fat, if you weighed five more pounds, you could get group insurance!",
  20. "Well I'll see you in my dreams - if I eat too much.",
  21. "You're the best at all you do - and all you do is make people hate you.",
  22. "When you get run over by a car it shouldn't be listed under 'accidents'.",
  23. "Ever since I saw you in your family tree I've wanted to cut it down.",
  24. "You're a habit I'd like to kick; with both feet.",
  25. "I hear the only place you're ever invited is outside.",
  26. "If you ever tax your brain, don't charge more than a penny.",
  27. "Don't you have a terribly empty feeling - in your skull?",
  28. "I don't consider you a vulture. I consider you something a vulture would eat.",
  29. "You have a face only a mother could love - and she hates it!"
  30. }
  31. local timeout = .05
  32. --wrap all connected monitors
  33. local sides = peripheral.getNames()
  34. local t = { }
  35. for _,side in pairs(sides) do
  36.   if peripheral.getType(side) == "monitor" then
  37.     table.insert(t, peripheral.wrap(side))
  38.   end
  39. end
  40. --clear the screens
  41. for _,mon in pairs(t) do
  42.   mon.clear()
  43. end
  44. --color picker. insert key (1-16) receive binary color
  45. local function returnCol(key)
  46.   return 2 ^ (key - 1)
  47. end
  48. --start screensaver
  49. while true do
  50.   for _,mon in pairs(t) do
  51.     mon.setTextScale(0.5)
  52.     --get size of monitor currently being written to
  53.     local x,y = mon.getSize()
  54.     --choose random phrase from above table
  55.     local displayString = displayStringTab[math.random(1,#displayStringTab)]
  56.     --set a random starting position
  57.     local posX = math.random(1, math.floor(x-string.len(displayString)))
  58.     local posY = math.random(1,y)
  59.     mon.setCursorPos(posX,posY)
  60.     --ranomize the text color
  61.     mon.setTextColor(returnCol(math.random(1,16)))
  62.     mon.write(displayString)
  63.     sleep(timeout)
  64.   end
  65. end
Advertisement
Add Comment
Please, Sign In to add comment