Advertisement
LDDestroier

Monitor Color Flash

Apr 26th, 2015
286
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.78 KB | None | 0 0
  1. colorSeq = {
  2.     colors.white,
  3.     colors.orange,
  4.     colors.magenta,
  5.     colors.lightBlue,
  6.     colors.yellow,
  7.     colors.lime,
  8.     colors.pink,
  9.     colors.gray,
  10.     colors.lightGray,
  11.     colors.cyan,
  12.     colors.purple,
  13.     colors.blue,
  14.     colors.brown,
  15.     colors.green,
  16.     colors.red,
  17.     colors.black
  18. }
  19. delay = 1
  20. periphs = peripheral.getNames()
  21. monitorList = {}
  22. for a = 1, #periphs do
  23.     if peripheral.getType(periphs[a]) == "monitor" then
  24.         table.insert(monitorList, periphs[a])
  25.     end
  26. end
  27.  
  28. while true do
  29.     for a = 1, #colorSeq do
  30.         for b = 1, #monitorList do
  31.             mon = peripheral.wrap(monitorList[b])
  32.             mon.setBackgroundColor(colorSeq[a])
  33.             monX, monY = mon.getSize()
  34.             for c = 1, monY do
  35.                 for d = 1, monX do
  36.                     mon.setCursorPos(d,c)
  37.                     write(" ")
  38.                 end
  39.             end
  40.         end
  41.         sleep(delay)
  42.     end
  43. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement