Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- term.clear()
- term.setCursorPos(1, 1)
- local ServerID = ""
- local RB = ""
- local SideRB = ""
- if fs.exists("ServerIDFile") then
- ServerID = fs.open("ServerIDFile", "r")
- SID = ServerID.readLine()
- ServerID.close()
- else
- term.write("Please write the Server id: ")
- SID = read()
- ServerID = fs.open("ServerIDFile", "w")
- ServerID.write(SID)
- ServerID.close()
- end
- if fs.exists("RB") then
- RB = fs.open("RB", "r")
- SideRB = RB.readAll()
- RB.close()
- else
- print("Please write the Rednet Block Side:")
- term.write("")
- SideRB = read()
- if SideRB ~= "left" and SideRB ~= "right" and SideRB ~= "top" and SideRB ~= "bottom" and SideRB ~= "front" and SideRB ~= "back" then
- print("The Sides Of The Rednet Block needs to be one of these: \n Left | Right | Top | Bottom | Front | Back")
- term.write("")
- SideRB = read()
- end
- RB = fs.open("RB", "w")
- RB.write(SideRB)
- RB.close()
- print("The Rednet Block Side that you entered is: "..SideRB)
- end
- rednet.open(SideRB)
- while true do
- id, message = rednet.receive()
- if id == tonumber(SID) and message == "on" then
- disk.playAudio("top")
- print("|Input| Signal: On | ServerID: "..SID.." |Input|")
- elseif id == tonumber(SID) and message == "off" then
- disk.stopAudio("top")
- print("|Input| Signal: Off | ServerID: "..SID.." |Input|")
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement