Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- print ("What side is your Modem on?")
- print ("")
- print ("| Left |")
- print ("| Right |")
- print ("| Top |")
- print ("| Bottom |")
- local event XY = os.pullEvent("mouse_click")
- XY = X..","..Y
- if XY == "1, 3" --Left
- or XY == "2, 3"
- or XY == "3, 3"
- or XY == "4, 3"
- or XY == "5, 3"
- or XY == "6, 3"
- or XY == "7, 3"
- or XY == "8, 3" then
- rednet.open("Left")
- print ("ID to send to: ")
- computerId = io.read()
- if computerId ~= "" then
- print ("Message to send to" .. computerId)
- Message = io.read()
- if Message ~= "" then
- print ("Sending message...")
- sleep(1)
- rednet.send(computerId,Message)
- id,message = rednet.receive()
- if id == computerId and Message == "Message received" then
- print ("Message sent!")
- else
- print ("An error occured trying to send your message. Please make sure you have used a valid ID and that you have selected the correct side for your Modem. Also make sure you have entered a message to send")
- end
- if XY == "1, 4" --Right
- or XY == "2, 4"
- or XY == "3, 4"
- or XY == "4, 4"
- or XY == "5, 4"
- or XY == "6, 4"
- or XY == "7, 4"
- or XY == "8, 4"
- or XY == "9, 4" then
- rednet.open("Right")
- print ("ID to send to: ")
- computerId = io.read()
- if computerId ~= "" then
- print ("Message to send to" .. computerId)
- Message = io.read()
- if Message ~= "" then
- print ("Sending message...")
- sleep(1)
- rednet.send(computerId,Message)
- if id == computerId and message == "Message received" then
- print ("Message sent!")
- else
- print ("An error occured trying to send your message. Please make sure you have used a valid ID and that you have selected the correct side for your Modem. Also make sure you have entered a message to send")
- end
- if XY == "1, 5" --Top
- or XY == "2, 5"
- or XY == "3, 5"
- or XY == "4, 5"
- or XY == "5, 5"
- or XY == "6, 5"
- or XY == "7, 5" then
- rednet.open("Top")
- print ("ID to send to: ")
- computerId = io.read()
- if computerId ~= "" then
- print ("Message to send to" .. computerId)
- Message = io.read()
- if Message ~= "" then
- print ("Sending message...")
- sleep(1)
- rednet.send(id,message)
- if id == computerId and message == "Message received" then
- print ("Message sent!")
- else
- print ("An error occured trying to send your message. Please make sure you have used a valid ID and that you have selected the correct side for your Modem. Also make sure you have entered a message to send")
- end
- if XY == "1, 6" --Bottom
- or XY == "2, 6"
- or XY == "3, 6"
- or XY == "4, 6"
- or XY == "5, 6"
- or XY == "6, 6"
- or XY == "7, 6"
- or XY == "8, 6"
- or XY == "9, 6"
- or XY == "10, 6" then
- rednet.open("Bottom")
- print ("ID to send to: ")
- computerId = io.read()
- if computerId ~= "" then
- print ("Message to send to" .. computerId)
- Message = io.read()
- if Message ~= "" then
- print ("Sending message...")
- sleep(1)
- rednet.send(id,message)
- if id == computerId and message == "Message received" then
- print ("Message sent!")
- else
- print ("An error occured trying to send your message. Please make sure you have used a valid ID and that you have selected the correct side for your Modem. Also make sure you have entered a message to send")
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement