Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local reactor
- function reactorSearch()
- local names = peripheral.getNames()
- local i, name
- for i, name in pairs(names) do
- if peripheral.getType(name) == "fissionReactorLogicAdapter" then
- return peripheral.wrap(name)
- end
- end
- end
- reactor = reactorSearch()
- if reactor ~= nil then
- local currentWastePercentage = math.floor(reactor.getWasteFilledPercentage() * 100)
- print(currentWastePercentage)
- local coolantFilled = reactor.getCoolantFilledPercentage()
- print(coolantFilled .. '-',coolantFilled >= minPercentageToStart)
- local fuelFilled = reactor.getFuelFilledPercentage()
- print(fuelFilled .. '-', fuelFilled >= minPercentageToStart)
- local currentTemp = math.floor(reactor.getTemperature())
- print(currentTemp .. '-', currentTemp < 800)
- local minPercentageToStart = 20
- print(minPercentageToStart)
- local canOperate = coolantFilled >= minPercentageToStart and fuelFilled >= minPercentageToStart and currentWastePercentage <= 90 and currentTemp < 800
- print(canOperate)
- end
- local alarmPos = "back"
- redstone.setOutput(alarmPos, true)
- redstone.setOutput(alarmPos, false)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement