- ComputerCraft | Programmable Computers for Minecraft
- → couchpatatochip1's Content
couchpatatochip1's Content
There have been 2 items by couchpatatochip1 (Search limited from 10-February 22)
#276554 IC2 Reactor Control Help (OpenPeripherals)
Posted by
couchpatatochip1
on 31 March 2018 - 08:48 PM
in
Ask a Pro
Thank you! I had a feeling that it was only checking the heat once but I had no idea how to go about handling it.
#276546 IC2 Reactor Control Help (OpenPeripherals)
Posted by
couchpatatochip1
on 31 March 2018 - 05:08 PM
in
Ask a Pro
Hi. I've been working on this bare-bones reactor control that shuts off the reactor when the heat value exceeds 7000. I'm very new to programming and I am only familiar with the basics and I can't seem to get my code to work. My setup is an advanced computer with a wired modem in the back connecting it to a nuclear reactor with a wired modem.
The sleep(0) was added to remove a "too long without yielding" error; however, even though there isn't an error the code does not seem to function properly. For example, when I begin the program and the reactor heat is 0 and then run it until the heat is at 7000, the computer will still output a redstone signal. Similarly, if I start the program when the reactor heat is above 7000 and I cool the reactor to a heat level below 7000, then the redstone signal will not change and there will be no output. I believe this has something to do with the "too long without yielding" error, but I do not know how to fix the error without using the sleep command. Thank you for your patience!
nuke = peripheral.wrap("back")
heat = nuke.callRemote("nuclear_reactor_0","getHeat")
while true do
while heat < 7000 do
rs.setOutput("right",true)
sleep(0)
end
end
The sleep(0) was added to remove a "too long without yielding" error; however, even though there isn't an error the code does not seem to function properly. For example, when I begin the program and the reactor heat is 0 and then run it until the heat is at 7000, the computer will still output a redstone signal. Similarly, if I start the program when the reactor heat is above 7000 and I cool the reactor to a heat level below 7000, then the redstone signal will not change and there will be no output. I believe this has something to do with the "too long without yielding" error, but I do not know how to fix the error without using the sleep command. Thank you for your patience!
- ComputerCraft | Programmable Computers for Minecraft
- → couchpatatochip1's Content


