CloudyPSP

monitortest

Mar 14th, 2012
10,859
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.68 KB | None | 0 0
  1. args = { ... }
  2. side = args[1]
  3.  
  4. if not peripheral.isPresent(side) or peripheral.getType(side) ~= "monitor" then print("Monitor is not attached at "..side.." side!") return end
  5. local mon = peripheral.wrap(side)
  6. local monWidth, monHeight, termWidth, termHeight, mx, my, tx, ty
  7.  
  8. while true do
  9.     termWidth, termHeight = term.getSize()
  10.     monWidth, monHeight = mon.getSize()
  11.     mx = math.floor(math.random(1,monWidth))
  12.     my = math.floor(math.random(1,monHeight))
  13.     tx = math.floor(math.random(1,termWidth))
  14.     ty = math.floor(math.random(1,termHeight))
  15.     mon.setCursorPos(mx, my)
  16.     term.setCursorPos(tx, ty)
  17.     mon.write("LOL")
  18.     term.write("HAX")
  19.     sleep(0.1)
  20. end
Advertisement
Add Comment
Please, Sign In to add comment