Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- print("NetWork Swzitzer 1.0")
- print("Press any key to exit")
- local modem = peripheral.wrap("top") -- Whopper
- local h = fs.open("nslog", fs.exists("nslog") and "a" or "w")
- modem.open(65533)
- modem.open(65535)
- local weider = true
- while weider do
- local event, keyside, sender, reply, packet, dist = os.pullEvent()
- if event == "modem_message" then
- str=textutils.serialize(packet).." DIST "..tostring(dist)
- print(str)
- h.writeLine(str)
- elseif event == "key" then
- print("Pressed key "..tostring(keyside))
- h.close()
- modem.closeAll()
- weider=false
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement