Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- term.clear()
- term.setCursorPos(1, 1)
- local ClientID = ""
- local MSide = ""
- local SideM = ""
- if fs.exists("ClientIDFile") then
- ClientID = fs.open("ClientIDFile", "r")
- CID = ClientID.readLine()
- ClientID.close()
- else
- term.write("Please write the client id: ")
- CID = read()
- ClientID = fs.open("ClientIDFile", "w")
- ClientID.write(CID)
- ClientID.close()
- end
- if fs.exists("MSide") then
- MSide = fs.open("MSide", "r")
- SideM = MSide.readAll()
- MSide.close()
- else
- print("Please write the Modem Side:")
- term.write("")
- SideM = read()
- if SideM ~= "left" and SideM ~= "right" and SideM ~= "top" and SideM ~= "bottom" and SideM ~= "front" and SideM ~= "back" then
- print("The Sides Of The Modem needs to be one of these: \n Left | Right | Top | Bottom | Front | Back")
- term.write("")
- SideM = read()
- end
- MSide = fs.open("MSide", "w")
- MSide.write(SideM)
- MSide.close()
- print("The Modem Side that you entered is: "..SideM)
- end
- rednet.open(SideM)
- while true do
- os.pullEvent("redstone")
- if rs.getInput("left") or rs.getInput("right") or rs.getInput("top") or rs.getInput("bottom") or rs.getInput("front") or rs.getInput("back") then
- rednet.send(tonumber(CID), "on")
- print("|Output| Signal: On | ClientID: "..CID.." |Output|")
- end
- -- rednet.send(tonumber(CID), "off")
- -- print("|Output| Signal: Off | ClientID: "..CID.." |Output|")
- -- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement