Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local function proxy(componentType)
- local address = component.list(componentType)()
- return address and component.proxy(address) or error("No component " .. componentType)
- end
- local modem, gpu = proxy("modem"), proxy("gpu")
- local x, y = 1, 1
- local function sleep(timeout)
- local deadline = computer.uptime() + timeout
- repeat
- computer.pullSignal(deadline - computer.uptime())
- until computer.uptime() >= deadline
- end
- function start()
- modem.open(2807)
- modem.open(6791)
- modem.open(7000)
- modem.setWakeMessage('')
- modem.setStrength(50000)
- end
- function wakeup()
- modem.broadcast(2807, '')
- modem.broadcast(6791, '')
- end
- function clear()
- gpu.fill(1,1, 160, 50, ' ')
- end
- start()
- clear()
- while true do
- wakeup()
- e, _, _, port, _, msg = computer.pullSignal("modem_message")
- if msg ~= '' and port == 7000 then
- if y == 50 then
- clear()
- y = 1
- gpu.set(x, y, msg)
- else
- gpu.set(x, y, msg)
- y = y+1
- end
- end
- sleep(.5)
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement