Skip to content

Instantly share code, notes, and snippets.

@bookerthegeek
Last active March 15, 2023 09:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bookerthegeek/47cec98f9c8eb87a81aee25a3eee95f5 to your computer and use it in GitHub Desktop.
Save bookerthegeek/47cec98f9c8eb87a81aee25a3eee95f5 to your computer and use it in GitHub Desktop.
BR Temp Control
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