Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- term.clear()
- term.setCursorPos(1,1)
- print("What Side Is Your Modem On?")
- term.write("Side: ")
- input = read()
- rednet.open(tostring(input))
- term.clear()
- term.setCursorPos(1,1)
- term.write("Connect To Which Computer?: ")
- connection = read()
- term.clear()
- term.setCursorPos(1,1)
- term.write("Whats Your UserName?: ")
- user = read()
- tostring(user)
- term.clear()
- term.setCursorPos(1,1)
- print("Youre Connected To Computer: "..connection)
- print("Type 's' To Send A Msg, And 'e' To Exit The Program!")
- while true do
- local ev, param, msg, dist = os.pullEvent()
- if ev == "rednet_message" then
- if param ~= connection then
- print("This Msg Comes From Computer "..param)
- end
- print(msg)
- end
- if ev == "key" then
- if param == 31 then
- term.write("Msg: ")
- text = read()
- tostring(text)
- if text == "clear" or text == "Clear" then
- shell.run("clear")
- elseif text ~= "clear" or text ~= "Clear" then
- rednet.send(tonumber(connection), user..": "..text)
- end
- elseif param == 18 then
- print("Exiting . . .")
- sleep(0.5)
- term.clear()
- term.setCursorPos(1,1)
- print("Exited")
- break
- end
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment