Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local function openRednet()
- local listOfSides = rs.getSides()
- for i = 1,6 do
- if peripheral.isPresent(listOfSides[i]) and peripheral.getType(listOfSides[i]) == "modem" then
- rednet.open(listOfSides[i])
- return listOfSides[i]
- end
- end
- end
- modemOn = openRednet()
- if not modemOn then
- print("No WIFI ModemnPress any key to return to exit")
- os.pullEvent("key")
- return
- else
- print("Opened wifi on "..modemOn.." side")
- end
- local iSendingComp = 144 -- this is the ID of the sending PC
- local sSide = "left"
- local monitor = peripheral.wrap(sSide)
- term.redirect(monitor)
- term.clear()
- term.setCursorPos(1,1)
- while true do
- local e,e1,e2,e3,e4,e5 = os.pullEvent()
- if e == "rednet_message" and e1 == iSendingComp then
- print(e2)
- elseif e == "key" and e1 == 14 then -- when you press backSpace it ends the program
- break
- end
- end
- term.clear()
- term.setCursorPos(1,1)
- term.restore()
Add Comment
Please, Sign In to add comment