Posted 17 May 2015 - 12:24 AM
i have a problem with my monitor displaying the correct number
i have a small program that reads my enderIO capacitor and gets the number and maks some calculations and displays it in my monitor but i get not the correct number but somthing like
http://prntscr.com/761b3v
and i dont know how i can fix it
i have a small program that reads my enderIO capacitor and gets the number and maks some calculations and displays it in my monitor but i get not the correct number but somthing like
http://prntscr.com/761b3v
and i dont know how i can fix it
m = peripheral.wrap("monitor_0")
c = peripheral.wrap("back")
big = peripheral.wrap("BigReactors-Reactor_0")
--numer of capasitors
cap = 7
reactor = false
function energyR()
energystoredF = c.getEnergyStored("unknown")
energystoredT = energystoredF * cap
end
function getACtive()
if big.getActive() == true then
reactor = true
else
reactor = false
end
end
function displayenergy()
m.clear()
m.setCursorPos(1, 1)
m.write("energy = ")
m.write(energystoredT,"")
m.write(" RF")
end
function warning()
if energystoredT < 1000000 then
m.setBackgroundColour(colors.red)
else
end
end
function debug()
write("energy = ")
write(energystoredT)
write(" RF")
end
function reactorActive()
if energystoredT < 1000000 then
big.setActive(true)
m.setCursorPos(1,2)
m.write("reactor is on ")
else
big.setActive(false)
m.setCursorPos(1,2)
m.write("reactor is off")
end
end
m.setTextColor(colors.white)
while true do
getACtive() --looks if the reactor is on
energyR()-- calculates the energy
displayenergy()-- shows the energy on the monitor
reactorActive()-- looks if the reactor needs to turn on
sleep(1)
term.clear()
term.setCursorPos(1,1)
m.setCursorPos(1,1)
m.setBackgroundColour(colors.black)
end