Advertisement
shadowkat1010

newmatrix

Apr 15th, 2014
111
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.72 KB | None | 0 0
  1. local term = require "term"
  2. local event = require "event"
  3. local component = require "component"
  4. local n = 120 --16777215
  5. local function matrix()
  6. local oldx, oldy = term.getCursor()
  7. local maxx, maxy = component.gpu.getResolution()
  8. local oldcolourf = component.gpu.getForeground()
  9. local oldcolourb = component.gpu.getBackground()
  10. component.gpu.setForeground(math.random(0,16777215))
  11. component.gpu.setBackground(math.random(0,16777215))
  12. term.setCursor(math.random(1,maxx),math.random(1,maxy))
  13. term.write(string.char(math.random(32,126)))
  14. term.setCursor(oldx,oldy)
  15. component.gpu.setForeground(oldcolourf)
  16. component.gpu.setBackground(oldcolourb)
  17. n = n / 2
  18. event.timer(n,matrix,1)
  19. end
  20. event.timer(0,matrix,1)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement