Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function menu()
- term.setCursorPos(1,1)
- term.clear()
- x = os.computerID()
- print("Your computer ID is "..x..".")
- print("1 = send")
- print("2 = recieve")
- input = read()
- if input == "1" then
- print("type your message")
- m = read()
- print("now type the receipients ID number")
- i = read()
- rednet.open("top")
- a,b = rednet.send(120,""..i.."")rednet.send(120,""..m.."")
- if a == "true" and b == "true" then
- print("Message sent!")
- sleep(2)
- menu()
- elseif rednet.send(121,"..id..") == "true" and rednet.send(121,"..m..") == "true" then
- print("Message sent!")
- sleep(2)
- menu()
- else
- print("Servers Full!")
- sleep(2)
- menu()
- end
- else
- if input == "2" then
- print("how long would you like to receive?")
- t = read()
- print("receiving...")
- idr,mr,tr = rednet.receive(t)
- print(mr)
- repeat
- local event, key = os.pullEvent()
- until event == "key"
- menu()
- else
- print("not an option")
- menu()
- end
- end
- end
- menu()
Add Comment
Please, Sign In to add comment