Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --Test
- function findModem()
- local periList = peripheral.getNames()
- for i = 1, #periList do
- if peripheral.getType(periList[i]) == "modem" then
- return periList[i]
- end
- end
- return nil
- end
- local side = findModem()
- if rednet.isOpen(side) then
- rednet.host("modems", "modem" .. os.getComputerID())
- else
- rednet.open(side)
- rednet.host("modems", "modem" .. os.getComputerID())
- end
- local modemIds = {rednet.lookup("modems")}
- for i=1,#modemIds do
- print("Found a server on channel "..modemIds[i].."!")
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement