View difference between Paste ID: XU8YTSwP and JSfPTB51
SHOW: | | - or go back to the newest paste.
1
-- credits to:
2
-- https://youtu.be/sHN-KQKUkaY
3-
-- Modified for early game non advanced computer, no turbine, 2x1 monitor...
3+
4-
-- This program will later be replaced by a late early game version when I get a enderio capacitor...
4+
5-
-- A previous version had color and a 2x2 monitor, this version currently replaces that version.
5+
6
-- http://ftbwiki.org/Turbine_Computer_Port
7-
-- when you connect the periphrials, check the log, these values should match what's in the code, if not
7+
8-
-- you need to change it...
8+
9-
-- [19:07:21] [Client thread/INFO]: [CHAT] Peripheral "computer_12" connected to network
9+
local reactor1 = peripheral.wrap("BigReactors-Reactor_0")
10-
-- [19:07:24] [Client thread/INFO]: [CHAT] Peripheral "monitor_4" connected to network
10+
local mon = peripheral.wrap("monitor_0")
11-
-- [19:07:27] [Client thread/INFO]: [CHAT] Peripheral "BigReactors-Reactor_6" connected to network
11+
local turbine1 = peripheral.wrap("BigReactors-Turbine_0")
12
local capacitor1 = peripheral.wrap("tile_blockcapacitorbank_name_0")
13-
-- basic setup for this...
13+
local tspeed = 0
14-
-- reactor has a computer port
14+
15
-- basic capacitor low, 10k of 100k capacity
16-
-- This isn't complex, but that's what I like about it.  It doesn't auto configure or do anything fancy, it just monitors
16+
local low = 10000
17-
-- what you tell it, and turns the reactor on and off to conserve fuel...
17+
-- turbine high 800k 1000000 capacity
18
local high = 800000
19
-- turbine full at 1M
20
local full = 1000000
21
22-
-- I've further decided to stop treating the reactor like a reactor, instead of messing with the control rods the
22+
reactor1.setAllControlRodLevels(99)
23-
-- turbine works best with the rods set to 20%, so I'll just leave it at 20%, and shut it off when it's full.
23+
24
while true do
25-
  local reactor1 = peripheral.wrap("BigReactors-Reactor_6")
25+
-- note the rod percentage is dependant upon blades, rotor material, and number of turbines
26-
  local mon = peripheral.wrap("monitor_4")
26+
-- this number is for 1 80 blade turbine with electrum rotors (37 blocks)
27
28
  if capacitor1.getEnergyStored() <= low then
29-
  -- basic capacitor low, 10k of 100k capacity
29+
    reactor1.setAllControlRodLevels(85)
30-
  local low = 10000
30+
31-
  -- turbine high 800k 1000000 capacity
31+
32-
  local high = 800000
32+
33-
  -- reactor full at 10M
33+
34-
  local full = 10000000
34+
35
  if reactor1.getEnergyStored() == full then
36-
  if reactor1.getEnergyStored() <= low then
36+
37-
    reactor1.setAllControlRodLevels(20)
37+
38
    if reactor1.getEnergyStored() >= high then
39
      reactor1.setAllControlRodLevels(95)
40
      reactor1.setActive(true)
41
    end
42
  end
43
44
  mon.clear()
45
 
46
  mon.setTextScale(1)
47-
      reactor1.setAllControlRodLevels(90)
47+
  mon.setCursorPos(15,20)
48
  mon.setTextColor(colors.blue)
49
  mon.write("pooter stat(os)")
50
51
  mon.setCursorPos(1,1)
52
  mon.setTextColor(colors.white)
53
  mon.write("Active: ")
54
  mon.setTextColor(colors.green)
55
  mon.write(reactor1.getActive())
56
   
57
  mon.setCursorPos(1,2)
58
  mon.setTextColor(colors.white)
59
  mon.write("Casing Heat: ")
60
  mon.setTextColor(colors.green)
61
  mon.write(math.floor(reactor1.getCasingTemperature()))
62
 
63
  mon.setCursorPos(1,3)
64
  mon.setTextColor(colors.white)
65
  mon.write("Fuel Heat: ")
66
  mon.setTextColor(colors.green)
67-
  mon.write("RF: ")  
67+
68-
  mon.write(math.floor(reactor1.getEnergyStored()))
68+
69
  mon.setCursorPos(1,4)
70
  mon.setTextColor(colors.white)
71
  mon.write("T-RF: ")  
72
  mon.setTextColor(colors.green)
73
  mon.write(math.floor(turbine1.getEnergyStored()))
74
75
  mon.setCursorPos(1,5)
76
  mon.setTextColor(colors.white)
77
  mon.write("C-RF: ")  
78
  mon.setTextColor(colors.green)
79
  mon.write(math.floor(capacitor1.getEnergyStored()))
80
81
  tspeed = math.floor(turbine1.getRotorSpeed())
82
  mon.setCursorPos(1,6)
83
  if tspeed>2000 then
84
    turbine1.setActive(false)
85
    mon.setTextColor(colors.red)
86
    sleep(120)
87
  else
88
    mon.setTextColor(colors.white)
89
    turbine1.setActive(true)
90
  end
91
  mon.write("T-RPM: ")  
92
  mon.setTextColor(colors.green)
93
  mon.write(tspeed)
94
95
  mon.setCursorPos(1,7)
96
  mon.setTextColor(colors.white)
97
  mon.write("T-Fin: ")  
98
  mon.setTextColor(colors.green)
99
  mon.write(math.floor(turbine1.getInputAmount()))
100
101
  mon.setCursorPos(1,8)
102
  mon.setTextColor(colors.white)
103
  mon.write("T-Fout: ")  
104
  mon.setTextColor(colors.green)
105
  mon.write(math.floor(turbine1.getOutputAmount()))
106
107
  sleep(10)
108
end