Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --!chat
- --This is for simple emailing from computers
- local ID, sent, type
- function recieve()
- while true do
- event, side, channel, replychannel, message, distance=os.pullEvent("modem_message")
- print("Message from Computer ID: "..replychannel.." from "..distance.." blocks away!")
- print(message)
- end
- end
- function send()
- while true do
- print("Public Message=1, Private Message=0")
- type=read()
- if type=="0" then
- repeat
- print("What ID would you like to send it to?")
- ID=tonumber(read())
- until ID
- else
- ID=100
- end
- print("What would you like to say?")
- sent=read()
- modem.transmit(ID, os.getComputerID(), sent)
- end
- end
- parallel.waitForAny(recieve,send)
Advertisement
Add Comment
Please, Sign In to add comment