Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- rednet.open("back")
- print("LUAPhone 1.0")
- function listenToCalls(time)
- id, mess = rednet.receive(tonumber(time))
- if mess == "call" then
- print("Someone is calling you!")
- print(id.." is trying to call you!")
- print("Answer? y/n")
- callans = read()
- end
- if callans == "y" then
- while not msg == "endcall" do
- write("You: ")
- msg = read()
- rednet.send(id, msg)
- id2, mess2 = rednet.receive()
- print(id..": "..mess2)
- end
- end
- while true do
- print("1 Check for calls")
- print("2 Call someone")
- input = read()
- if input == "1" then
- print("Listening for 10 seconds.")
- listenToCalls(10)
- term.clear()
- term.setCursorPos(1,1)
- elseif input == "2" then
- print("What ID are you trying to call?")
- idtocall = read()
- rednet.send(tonumber(idtocall), "call")
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement