Posted 27 May 2015 - 03:06 AM
I am trying to make a script to actively set my control rod levels to the level of power currently in the reactor's internal buffer.
Here is what I have for now. It is currently producing an error "too long without yielding"
while true do
local reactor = peripheral.wrap("BigReactors-Reactor_0")
local power = ((reactor.getEnergyStored() / 10000000) * 100)
if reactor.getActive() == true
then
reactor.setAllControlRodLevels(power)
end
end
sleep(5)
I know this is not quite right. I had someone write a program that did the same thing once, but I cannot remember how he wrote it, and this is my first time really playing with computers myself.
Here is what I have for now. It is currently producing an error "too long without yielding"
while true do
local reactor = peripheral.wrap("BigReactors-Reactor_0")
local power = ((reactor.getEnergyStored() / 10000000) * 100)
if reactor.getActive() == true
then
reactor.setAllControlRodLevels(power)
end
end
sleep(5)
I know this is not quite right. I had someone write a program that did the same thing once, but I cannot remember how he wrote it, and this is my first time really playing with computers myself.