Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local version = 1.1
- local filename = "react"
- local paste = "MMYCYF4U"
- local function update()
- local url = "http://pastebin.com/raw.php?i="..paste
- local temp = http.get(url)
- local ver = temp.readLine()
- if tonumber(string.sub(ver, 17)) ~= version then
- fs.delete(filename)
- shell.run("pastebin get "..paste.." "..filename)
- shell.run(filename)
- return true
- end
- return false
- end
- local test = update()
- if test == true then
- error()
- end
- rednet.open("left")
- os.loadAPI("ocs/apis/sensor")
- mon = peripheral.wrap("right")
- mon.setTextScale(1)
- local sens = sensor.wrap("top")
- while true do
- sleep(1)
- local taken = false
- local targ = sens.getTargets()
- for name, det in pairs(targ) do
- local details = sens.getTargetDetails(name)
- if details.Name == "Reactor Chamber" and taken == false then
- taken = true
- shell.run("clear")
- print("~Reactor Status~")
- print("Active: "..tostring(details.Active))
- print("Output: "..details.Output.." EU")
- print("% of max Heat: "..details.HeatPercentage)
- if details.HeatPercentage >= 75 then
- rednet.broadcast("reactor_off")
- print("")
- print("*Reactor has reached 75% heat and is being shutdown")
- elseif details.HeatPercentage < 75 then
- if details.HeatPercentage <= 50 then
- print("")
- print("*reactor heat is stable")
- rednet.broadcast("reactor_on")
- elseif details.Active == false then
- print("")
- print("*reactor will turn back on at 50% heat")
- end
- end
- end
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement