Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- monitor = peripheral.wrap("left")
- oldTerm = term.redirect(monitor)
- rednet.open("front")
- function clearMonitor(s)
- s = s or 0.8
- monitor.clear()
- monitor.setCursorPos(1,1)
- monitor.setTextScale(s)
- end
- function protocolList()
- clearMonitor()
- print("== RA-v Network ==")
- print("")
- textutils.slowPrint("Accessing protocols requires administrator access. Please enter the password")
- print("")
- print("Password : ")
- id,message = rednet.receive()
- while true do
- if id == 255 and message == "Tommy2002%" then
- textutils.slowPrint("Password accepted")
- sleep(2)
- break
- elseif id == 255 and message == "back" then
- else
- textutils.slowPrint("Password denied")
- end
- end
- end
- clearMonitor()
- textutils.slowPrint("Loading system diagnostics..")
- sleep(1.5)
- textutils.slowPrint("Welcome to the RA-v Network")
- sleep(1)
- while true do
- clearMonitor()
- print("== RA-v Network ==")
- print("")
- textutils.slowPrint(" = #1 S-CLASS REACTOR =")
- textutils.slowPrint(" Core Heat - ...")
- textutils.slowPrint(" Output - ...")
- textutils.slowPrint(" Status - ...")
- textutils.slowPrint("")
- textutils.slowPrint(" = #2 H-CLASS REACTOR =")
- textutils.slowPrint(" Core Heat - ...")
- textutils.slowPrint(" Output - ...")
- textutils.slowPrint(" Status - ...")
- textutils.slowPrint("")
- textutils.slowPrint(" = ME System =")
- textutils.slowPrint(" Capacity - ...")
- textutils.slowPrint(" Bandwidth - ...")
- print("")
- textutils.slowPrint("Enter a command from the terminal")
- rednet.send(35, "send.data") -- Reactor
- rID,rMessage = rednet.receive()
- rednet.send(73, "send.data") -- Reactor 2
- hID,hMessage = rednet.receive()
- rednet.send(36, "send.data") -- ME System
- aID,aMessage = rednet.receive()
- while true do
- if rID == 35 then
- rData = textutils.unserialise(rMessage)
- rHeat = rData[1]
- rOutput = rData[2]
- rStatus = rData[3]
- else
- print("Received wrong id")
- end
- if hID == 73 then
- hData = textutils.unserialise(hMessage)
- hHeat = hData[1]
- hOutput = hData[2]
- hStatus = hData[3]
- else
- print("Received wrong id")
- end
- if aID == 36 then
- aData = textutils.unserialise(aMessage)
- aCapacity = aData[1]
- aEnergy = aData[2]
- else
- print("Received wrong id")
- end
- if id == 255 and message == "protocol" then
- rednet.send("protocol.start")
- end
- if rStatus == true then
- rDStatus = "Online"
- elseif rStatus == false then
- rDStatus = "Offline"
- else
- print("Failed to getReactorStatus")
- end
- if hStatus == true then
- hDStatus = "Online"
- elseif hStatus == false then
- hDStatus = "Offline"
- else
- print("Failed to getReactorStatus")
- end
- rDHeat = tostring(math.floor((rHeat/10000)*100))
- hDHeat = tostring(math.floor((hHeat/10000)*100))
- clearMonitor()
- print("== RA-v Network ==")
- print("")
- print(" = #1 S-CLASS REACTOR =")
- print(" Core Heat - " .. rDHeat .. "%")
- print(" Output - " .. rOutput .. " EU/t")
- print(" Status - " .. rDStatus)
- print("")
- print(" = #2 H-CLASS REACTOR =")
- print(" Core Heat - " .. hDHeat .. "%")
- print(" Output - " .. hOutput .. " EU/t")
- print(" Status - " .. hDStatus)
- print("")
- print(" = ME System =")
- print(" Capacity - " .. aCapacity .. "i")
- print(" Bandwidth - " .. aEnergy .. " AE/t")
- print("")
- print("Enter a command from the terminal")
- rednet.send(35,"send.data") -- Reactor
- rID,rMessage = rednet.receive()
- rednet.send(73, "send.data") -- Reactor 2
- hID,hMessage = rednet.receive()
- rednet.send(36,"send.data") -- ME System
- aID,aMessage = rednet.receive()
- sleep(0.5)
- end
- clearMonitor()
- textutils.slowPrint("Accessed Menu")
- sleep(0.5)
- print("Commands are available")
- while true do
- id,message = rednet.receive()
- if id == 255 and message == "jebus" then
- break
- else
- textutils.slowPrint("Unknown command")
- sleep(5)
- end
- end
- clearMonitor()
- textutils.slowPrint("All hail Jewish Jebus")
- sleep(5)
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement