Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local modem = peripheral.find("modem", rednet.open)
- local printer = peripheral.find("printer")
- local px, py
- if rednet.isOpen(modem) then
- print("Modem is innitiated")
- else
- printError("Problem or something")
- end
- rednet.host("main", "router")
- -- Making 0xa an identifier for a computer that has just joined network
- rednet.broadcast("0xa-router")
- print("Listing online hosts")
- local online = rednet.lookup("main")
- print(#online .. "Computers online")
- print("Listing computers online: ")
- for _, host in pairs(online) do
- print(host)
- px, py = printer.getCurserPos()
- printer.write(host .. " ")
- printer.setCurserPos(0, py+1)
- end
Advertisement
Add Comment
Please, Sign In to add comment