SHOW:
|
|
- or go back to the newest paste.
1 | -- test | |
2 | local reactor | |
3 | ||
4 | function reactorSearch() | |
5 | local names = peripheral.getNames() | |
6 | local i, name | |
7 | for i, name in pairs(names) do | |
8 | if peripheral.getType(name) == "fissionReactorLogicAdapter" then | |
9 | return peripheral.wrap(name) | |
10 | end | |
11 | end | |
12 | end | |
13 | ||
14 | reactor = reactorSearch() | |
15 | ||
16 | if reactor ~= nil then | |
17 | - | print(currentWastePercentage) |
17 | + | local minPercentageToStart = 20 -- 20% minimum |
18 | - | local coolantFilled = reactor.getCoolantFilledPercentage() |
18 | + | |
19 | - | print(coolantFilled .. '-',coolantFilled >= minPercentageToStart) |
19 | + | local a = currentWastePercentage <= 90 |
20 | - | local fuelFilled = reactor.getFuelFilledPercentage() |
20 | + | print('currentWastePercentage',currentWastePercentage, a) |
21 | - | print(fuelFilled .. '-', fuelFilled >= minPercentageToStart) |
21 | + | local coolantFilled = math.floor(reactor.getCoolantFilledPercentage()* 100) |
22 | local b = coolantFilled >= minPercentageToStart | |
23 | - | print(currentTemp .. '-', currentTemp < 800) |
23 | + | print('coolantFilled',coolantFilled, b); |
24 | - | local minPercentageToStart = 20 |
24 | + | local fuelFilled = math.floor(reactor.getFuelFilledPercentage()* 100) |
25 | - | print(minPercentageToStart) |
25 | + | local c = fuelFilled >= minPercentageToStart |
26 | print('fuelFilled',fuelFilled, c); | |
27 | local currentTemp = math.floor(reactor.getTemperature()) | |
28 | - | local canOperate = coolantFilled >= minPercentageToStart and fuelFilled >= minPercentageToStart and currentWastePercentage <= 90 and currentTemp < 800 |
28 | + | local d = currentTemp < 800 |
29 | print('currentTemp',currentTemp, d); | |
30 | - | print(canOperate) |
30 | + | |
31 | ||
32 | - | |
32 | + | local canOperate = a and b and c and d |
33 | ||
34 | print('can operate',canOperate) | |
35 | ||
36 | end | |
37 | ||
38 | local alarmPos = "back" | |
39 | ||
40 | redstone.setOutput(alarmPos, true) | |
41 | redstone.setOutput(alarmPos, false) | |
42 | ||
43 |