SHOW:
|
|
- or go back to the newest paste.
1 | -- rewrite for newer bigger reactors | |
2 | local reactor = peripheral.wrap("back") | |
3 | local low = 4500000 | |
4 | local high = 8000000 | |
5 | local full = 9500000 | |
6 | ||
7 | reactor.setActive(true) | |
8 | ||
9 | while true do | |
10 | ||
11 | if reactor.battery().stored() <= low then -- .getEnergyStored() <= low then | |
12 | reactor.setAllControlRodLevels(60) | |
13 | -- if reactor.active() == false then | |
14 | reactor.setActive(true) | |
15 | -- end | |
16 | else | |
17 | if reactor.battery().stored() < high then | |
18 | reactor.setAllControlRodLevels(90) | |
19 | reactor.setActive(true) | |
20 | end | |
21 | end | |
22 | ||
23 | if reactor.battery().stored() >= full then | |
24 | reactor.setActive(false) | |
25 | end | |
26 | if reactor.active() then | |
27 | write("True:") | |
28 | else | |
29 | write("False:") | |
30 | end | |
31 | print("10 second update: ",reactor.battery().stored()) | |
32 | sleep(10) | |
33 | ||
34 | end |