Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local args = {...}
- local order = {#args>0 and tonumber(args[1]) or 1, #args>1 and tonumber(args[2]) or 2}
- local mon = {}
- for _,dev in pairs(peripheral.getNames()) do
- if peripheral.getType(dev) == "monitor" then
- mon[#mon+1] = peripheral.wrap(dev)
- end
- end
- --peripheral.find("monitor")
- print(#mon)
- local l = 1
- local col = {colors.lightGray,colors.cyan}
- local w,h = mon[order[1]].getSize()
- for _,m in pairs(mon) do m.setBackgroundColor(col[2]) m.clear() end
- while true do
- mon[order[1]].setBackgroundColor(col[2])
- mon[order[2]].setBackgroundColor(col[2])
- mon[order[1]].clearLine(l)
- mon[order[2]].clearLine(h-l+1)
- mon[order[1]].setBackgroundColor(col[1])
- mon[order[2]].setBackgroundColor(col[1])
- l=1+(l+1)%h
- mon[order[1]].setCursorPos(1,l)
- mon[order[2]].setCursorPos(1,h-l+1)
- for i=1,w do mon[1].write(" ") mon[2].write(" ") end
- sleep(0.1)
- end
Advertisement
Add Comment
Please, Sign In to add comment