Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local wrappedMonitors = {}
- local temp = {}
- temp.modem = peripheral.wrap('back')
- temp.order, temp.maxW, temp.maxH, temp.blitString, temp.colorString, temp.backgroundString = false, 0, 0, '', '', ''
- function initiate()
- for i, rawMonitor in ipairs(temp.modem.getNamesRemote()) do
- if ( peripheral.getType(rawMonitor) == 'monitor' ) then
- wrappedMonitors[i] = peripheral.wrap(rawMonitor)
- wrappedMonitors[i].setTextScale(0.5)
- local sizeW, sizeH = wrappedMonitors[i].getSize()
- temp.maxW, temp.maxH = math.max(temp.maxW, sizeW), math.max(temp.maxH, sizeH)
- end
- end
- for i=0, temp.maxW*2 do
- temp.blitString, temp.colorString, temp.backgroundString = temp.blitString .. (temp.order and math.random(1, 9) or math.random(1, 9)), temp.colorString .. (temp.order and math.random(1, 9) or math.random(1, 9)), temp.backgroundString .. math.random(1, 9)
- temp.order = not temp.order
- end
- loop(temp.blitString, temp.colorString, temp.backgroundString, temp.maxH, false)
- end
- function loop(blitString, colorString, backgroundString, maxH)
- temp = nil
- local order
- while ( true ) do
- for i, m in ipairs(wrappedMonitors) do
- for i=0, maxH do
- m.setCursorPos(0-math.random(i,#colorString), i)
- m.blit(blitString, (order and colorString or backgroundString), (order and backgroundString or colorString))
- end
- sleep(0.05)
- end
- order = not order
- sleep(0.3)
- end
- end
- initiate()
Advertisement
Add Comment
Please, Sign In to add comment