Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- test
- 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 minPercentageToStart = 20 -- 20% minimum
- local currentWastePercentage = math.floor(reactor.getWasteFilledPercentage() * 100)
- local a = currentWastePercentage <= 90
- print('currentWastePercentage',currentWastePercentage, a)
- local coolantFilled = math.floor(reactor.getCoolantFilledPercentage()* 100)
- local b = coolantFilled >= minPercentageToStart
- print('coolantFilled',coolantFilled, b);
- local fuelFilled = math.floor(reactor.getFuelFilledPercentage()* 100)
- local c = fuelFilled >= minPercentageToStart
- print('fuelFilled',fuelFilled, c);
- local currentTemp = math.floor(reactor.getTemperature())
- local d = currentTemp < 800
- print('currentTemp',currentTemp, d);
- local canOperate = a and b and c and d
- print('can operate',canOperate)
- end
- local alarmPos = "back"
- redstone.setOutput(alarmPos, true)
- redstone.setOutput(alarmPos, false)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement