Advertisement
CCninja86

MineFax Program

Feb 20th, 2013
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 2.94 KB | None | 0 0
  1. print ("What side is your Modem on?")
  2. print ("")
  3. print ("| Left |")
  4. print ("| Right |")
  5. print ("| Top |")
  6. print ("| Bottom |")
  7.  
  8. local event XY = os.pullEvent("mouse_click")
  9. XY = X..","..Y
  10.  
  11. if XY == "1, 3" --Left
  12. or XY == "2, 3"
  13. or XY == "3, 3"
  14. or XY == "4, 3"
  15. or XY == "5, 3"
  16. or XY == "6, 3"
  17. or XY == "7, 3"
  18. or XY == "8, 3" then
  19.  
  20. rednet.open("Left")
  21. print ("ID to send to: ")
  22. computerId = io.read()
  23. if computerId ~= "" then
  24. print ("Message to send to" .. computerId)
  25. Message = io.read()
  26. if Message ~= "" then
  27. print ("Sending message...")
  28. sleep(1)
  29. rednet.send(computerId,Message)
  30. id,message = rednet.receive()
  31. if id == computerId and Message == "Message received" then
  32. print ("Message sent!")
  33.  
  34. else
  35. 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")
  36. end
  37.  
  38. if XY == "1, 4" --Right
  39. or XY == "2, 4"
  40. or XY == "3, 4"
  41. or XY == "4, 4"
  42. or XY == "5, 4"
  43. or XY == "6, 4"
  44. or XY == "7, 4"
  45. or XY == "8, 4"
  46. or XY == "9, 4" then
  47.  
  48. rednet.open("Right")
  49. print ("ID to send to: ")
  50. computerId = io.read()
  51. if computerId ~= "" then
  52. print ("Message to send to" .. computerId)
  53. Message = io.read()
  54. if Message ~= "" then
  55. print ("Sending message...")
  56. sleep(1)
  57. rednet.send(computerId,Message)
  58. if id == computerId and message == "Message received" then
  59. print ("Message sent!")
  60.  
  61. else
  62. 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")
  63. end
  64.  
  65. if XY == "1, 5" --Top
  66. or XY == "2, 5"
  67. or XY == "3, 5"
  68. or XY == "4, 5"
  69. or XY == "5, 5"
  70. or XY == "6, 5"
  71. or XY == "7, 5" then
  72.  
  73. rednet.open("Top")
  74. print ("ID to send to: ")
  75. computerId = io.read()
  76. if computerId ~= "" then
  77. print ("Message to send to" .. computerId)
  78. Message = io.read()
  79. if Message ~= "" then
  80. print ("Sending message...")
  81. sleep(1)
  82. rednet.send(id,message)
  83. if id == computerId and message == "Message received" then
  84. print ("Message sent!")
  85.  
  86. else
  87. 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")
  88. end
  89.  
  90. if XY == "1, 6" --Bottom
  91. or XY == "2, 6"
  92. or XY == "3, 6"
  93. or XY == "4, 6"
  94. or XY == "5, 6"
  95. or XY == "6, 6"
  96. or XY == "7, 6"
  97. or XY == "8, 6"
  98. or XY == "9, 6"
  99. or XY == "10, 6" then
  100.  
  101. rednet.open("Bottom")
  102. print ("ID to send to: ")
  103. computerId = io.read()
  104. if computerId ~= "" then
  105. print ("Message to send to" .. computerId)
  106. Message = io.read()
  107. if Message ~= "" then
  108. print ("Sending message...")
  109. sleep(1)
  110. rednet.send(id,message)
  111. if id == computerId and message == "Message received" then
  112. print ("Message sent!")
  113.  
  114. else
  115. 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")
  116. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement