Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- term.clear()
- term.getCursorPos(1, 1)
- rednet.open("back")
- local host_id = os.computerID()
- rednet.broadcast(host_id.." dolaczyl do czatu")
- print(host_id.." dolaczyl do czatu, napisz 'exit' aby wyjsc")
- while true do
- sender_id, mess_in = rednet.receive("", 1)
- if mess_in ~= nil then
- textutils.slowPrint(sender_id.."- "..mess_in)
- end
- local event, key, isHeld = os.pullEvent("key")
- if keys.getName(key) ~= nil then
- write("Wyslij swoja wiadomosc: ")
- local mesydz = read()
- if mesydz == "exit" then
- rednet.broadcast(host_id.." opuscil czat")
- textutils.slowPrint(host_id.." opuscil czat")
- rednet.close("back")
- break
- end
- rednet.broadcast(host_id.."- "..mesydz)
- print(host_id.."- "..mesydz)
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement