Last active
March 15, 2023 09:57
-
-
Save bookerthegeek/47cec98f9c8eb87a81aee25a3eee95f5 to your computer and use it in GitHub Desktop.
BR Temp Control
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
local reactor = peripheral.wrap("back") | |
local tempGoal = 950 | |
local n = 50 | |
local getTemp = math.ceil(reactor.getFuelTemperature()) | |
while true do | |
reactor.setActive(true) | |
print(reactor.getControlRodLevel(0)) | |
if(getTemp >= tempGoal) | |
then | |
n = reactor.getControlRodLevel(1) + 1 | |
if n >= 100 then | |
n = 100 | |
reactor.setAllControlRodLevels(n) | |
end | |
else | |
n = reactor.getControlRodLevel(1) - 1 | |
if n <= 0 then | |
n = 0 | |
reactor.setAllControlRodLevels(n) | |
end | |
end | |
sleep(5) | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment