Advertisement
VGToolBox

Write to many monitors

Feb 16th, 2015
221
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.37 KB | None | 0 0
  1. function pack(...)
  2.     retVal = {}
  3.     for i, v in ipairs(arg) do
  4.         table.insert(retVal, v)
  5.     end
  6.     return retVal
  7. end
  8.  
  9. function writeToMonitors(monitors, word)
  10.     for i, v in ipairs(monitors) do
  11.         v.setCursorPos(1,1)
  12.         v.write(word)
  13.     end
  14. end
  15.  
  16. monitors = pack(peripheral.find("monitor"))
  17.    
  18. writeToMonitors(monitors, "Hello, World!")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement