Here's the main program:
http://pastebin.com/a24R68B8
local reactor=peripheral.wrap("top")
local isRunning="Undefined"
while true do
term.clear() --// Clering the screen and setting Pos\\--
term.setCursorPos(1,1)
print("[//////////////////Reactor Status/////////////////]")
print()
print("Reactor: ") -- Will enter status here--
if reactor.getActive()==true --If the reactor is on...
then
isRunning="ON"
term.setCursorPos(10,3) write(isRunning)
elseif reactor.getActive()==false
then
isRunning="OFF"
term.setCursorPos(10,3) write(isRunning)
else write("Error")
end
term.setCursorPos(1,5)
--// Figure out how to check fuel\\--
local fuelLev= reactor.getFuelAmount()
local fuelMax= reactor.getFuelAmountMax()
local percentFuel = ((fuelLev / fuelMax) * 100)
print("Fuel: ") -- Trying to print the fuel w/o errors
print(percentFuel)
term.setCursorPos(5,6) print(" % ")
if percentFuel <= 10 and reactor.getActive()==true then
reactor.setActive(false)
end
print() print("Press <spacebar> to toggle the reactor!")
os.sleep(0.5)
if os.pullEvent("key")==57 then shell.run("rmenu") break end
end --Repeat until spacebar is pressed--
and here is the menu it launches http://pastebin.com/LSegr1Gv












