Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --[[ Config File ]]--
- modem = "back" --[[ Where the modem is at?
- (front, back, top, bottom, right, left) ]]--
- --[[ End of Config ]]--
- --[[ Start of program ]]--
- rednet.open(modem)
- os.pullEvent = os.pullEventRaw
- term.clear()
- term.setCursorPos(1,1)
- serverID = os.computerID()
- print "You can't use this computer because its a server!"
- print ""
- print("Server ID: " ..serverID)
- print "-------------"
- print "Logs:"
- print ""
- while true do
- info, msg, distance = rednet.receive()
- info, to, distance2 = rednet.receive()
- info, from, distance3 = rednet.receive()
- print("Message recived from: " ..from)
- print("Sending message to: " ..to)
- if (to == "10") then
- rednet.send(info, "Message Recived")
- loop10 = true
- while (loop10 == true) do
- rednet.send(10, msg)
- rednet.send(10, from)
- event, id, text = os.pullEvent()
- if (event == "rednet_message") then
- if (text == "Recived") then
- loop10 = false
- print ""
- print "Message Sent"
- print "---------------"
- end
- end
- end
- elseif (to == "9") then
- rednet.send(info, "Message Recived")
- loop9 = true
- while (loop9 == true) do
- rednet.send(9, msg)
- rednet.send(9, from)
- event, id, text = os.pullEvent()
- if (event == "rednet_message") then
- if (text == "Recived") then
- loop9 = false
- print ""
- print "Message Sent"
- print "---------------"
- end
- end
- end
- elseif (to == "8") then
- rednet.send(info, "Message Recived")
- loop8 = true
- while (loop8 == true) do
- rednet.send(8, msg)
- rednet.send(8, from)
- event, id, text = os.pullEvent()
- if (event == "rednet_message") then
- if (text == "Recived") then
- loop8 = false
- print ""
- print "Message Sent"
- print "---------------"
- end
- end
- end
- elseif (to == "7") then
- rednet.send(info, "Message Recived")
- loop7 = true
- while (loop7 == true) do
- rednet.send(7, msg)
- rednet.send(7, from)
- event, id, text = os.pullEvent()
- if (event == "rednet_message") then
- if (text == "Recived") then
- loop7 = false
- print ""
- print "Message Sent"
- print "---------------"
- end
- end
- end
- elseif (to == "6") then
- rednet.send(info, "Message Recived")
- loop6 = true
- while (loop6 == true) do
- rednet.send(6, msg)
- rednet.send(6, from)
- event, id, text = os.pullEvent()
- if (event == "rednet_message") then
- if (text == "Recived") then
- loop6 = false
- print ""
- print "Message Sent"
- print "---------------"
- end
- end
- end
- elseif (to == "5") then
- rednet.send(info, "Message Recived")
- loop5 = true
- while (loop8 == true) do
- rednet.send(5, msg)
- rednet.send(5, from)
- event, id, text = os.pullEvent()
- if (event == "rednet_message") then
- if (text == "Recived") then
- loop5 = false
- print ""
- print "Message Sent"
- print "---------------"
- end
- end
- end
- elseif (to == "4") then
- rednet.send(info, "Message Recived")
- loop4 = true
- while (loop8 == true) do
- rednet.send(4, msg)
- rednet.send(4, from)
- event, id, text = os.pullEvent()
- if (event == "rednet_message") then
- if (text == "Recived") then
- loop4 = false
- print ""
- print "Message Sent"
- print "---------------"
- end
- end
- end
- elseif (to == "3") then
- rednet.send(info, "Message Recived")
- loop3 = true
- while (loop8 == true) do
- rednet.send(3, msg)
- rednet.send(3, from)
- event, id, text = os.pullEvent()
- if (event == "rednet_message") then
- if (text == "Recived") then
- loop3 = false
- print ""
- print "Message Sent"
- print "---------------"
- end
- end
- end
- elseif (to == "2") then
- rednet.send(info, "Message Recived")
- loop2 = true
- while (loop8 == true) do
- rednet.send(2, msg)
- rednet.send(2, from)
- event, id, text = os.pullEvent()
- if (event == "rednet_message") then
- if (text == "Recived") then
- loop2 = false
- print ""
- print "Message Sent"
- print "---------------"
- end
- end
- end
- elseif (to == "1") then
- rednet.send(info, "Message Recived")
- loop1 = true
- while (loop8 == true) do
- rednet.send(1, msg)
- rednet.send(1, from)
- event, id, text = os.pullEvent()
- if (event == "rednet_message") then
- if (text == "Recived") then
- loop1 = false
- print ""
- print "Message Sent"
- print "---------------"
- end
- end
- end
- else
- rednet.send(info, "Error")
- print ""
- print "Error"
- print "---------------"
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement