View difference between Paste ID: kcweqDxq and fQg6xgy6
SHOW: | | - or go back to the newest paste.
1
local t1 = peripheral.wrap("BigReactors-Turbine_0")
2
local t2 = peripheral.wrap("BigReactors-Turbine_1")
3
local m = peripheral.wrap("monitor_0")
4
local status1 = ""
5
local status2 = ""
6
local engaged1 = ""
7
local engaged2 = ""
8
local rpm1 = 0
9
local rpm2 = 0
10
local energy1 = 0
11
local energy2 = 0
12
local energyProd1 = 0
13
local energyProd2 = 0
14
15-
  energyProd = t.getEnergyProducedLastTick()
15+
16-
  energy = t.getEnergyStored()
16+
	-- Getting and setting status vars.--
17-
  rpm = t.getRotorSpeed()
17+
	local status1 = "Offline"
18-
  if t.getInductorEngaged() then engaged = "Engaged" end
18+
	local status2 = "Offline"
19-
  if t.getActive() then status = "Online" end
19+
	local engaged1 = "Not Engaged"
20-
  
20+
	local engaged2 = "Not Engaged"
21-
  m.clear()
21+
	energyProd1 = t1.getEnergyProducedLastTick()
22-
  m.setCursorPos(1,1)
22+
	energyProd2 = t2.getEnergyProducedLastTick()
23-
  m.setTextColor(colors.white)
23+
	energy1 = t1.getEnergyStored()
24-
  m.write("Turbine Status: ")
24+
	energy2 = t1.getEnergyStored()
25-
  m.setCursorPos(20,1)
25+
	rpm1 = t1.getRotorSpeed()
26-
  m.setTextColor(colors.red)
26+
	rpm2 = t1.getRotorSpeed()
27-
  m.write(status)
27+
	if t1.getInductorEngaged() then engaged1 = "Engaged" end
28-
  
28+
	if t2.getInductorEngaged() then engaged2 = "Engaged" end
29-
  m.setCursorPos(1,2)
29+
	if t1.getActive() then status1 = "Online" end
30-
  m.setTextColor(colors.white)
30+
	if t2.getActive() then status2 = "Online" end
31-
  m.write("Induction Coils: ")
31+
32-
  m.setCursorPos(20,2)
32+
	--Displaying status vars.--
33-
  m.setTextColor(colors.red)
33+
	m.clear()
34-
  m.write(engaged)
34+
35-
  
35+
	--Turbine 1--
36-
  m.setCursorPos(1,3)
36+
	m.setCursorPos(1,1)
37-
  m.setTextColor(colors.white)
37+
	m.setTextColor(colors.cyan)
38-
  m.write("RF/T: ")
38+
	m.write("Turbine 1")
39-
  m.setCursorPos(20,3)
39+
40-
  m.setTextColor(colors.red)
40+
	m.setCursorPos(1,2)
41-
  m.write(energyProd)
41+
	m.setTextColor(colors.white)
42-
  
42+
	m.write("Turbine Status: ")
43-
  m.setCursorPos(1,4)
43+
	m.setCursorPos(20,2)
44-
  m.setTextColor(colors.white)
44+
	m.setTextColor(colors.red)
45-
  m.write("RF Stored: ")
45+
	m.write(status1)
46-
  m.setCursorPos(20,4)
46+
47-
  m.setTextColor(colors.red)
47+
	m.setCursorPos(1,3)
48-
  m.write(energy)
48+
	m.setTextColor(colors.white)
49-
  
49+
	m.write("Induction Coils: ")
50-
  m.setCursorPos(1,5)
50+
	m.setCursorPos(20,3)
51-
  m.setTextColor(colors.white)
51+
	m.setTextColor(colors.red)
52-
  m.write("RPM: ")
52+
	m.write(engaged1)
53-
  m.setCursorPos(20,5)
53+
54-
  m.setTextColor(colors.red)
54+
	m.setCursorPos(1,4)
55-
  m.write(rpm)
55+
	m.setTextColor(colors.white)
56-
  
56+
	m.write("RF/T: ")
57-
  
57+
	m.setCursorPos(20,4)
58-
  os.sleep(0.1)
58+
	m.setTextColor(colors.red)
59-
end
59+
	m.write(energyProd1)
60
61
	m.setCursorPos(1,5)
62
	m.setTextColor(colors.white)
63
	m.write("RF Stored: ")
64
	m.setCursorPos(20,5)
65
	m.setTextColor(colors.red)
66
	m.write(energy1)
67
68
	m.setCursorPos(1,6)
69
	m.setTextColor(colors.white)
70
	m.write("RPM: ")
71
	m.setCursorPos(20,6)
72
	m.setTextColor(colors.red)
73
	m.write(rpm1)
74
75
	--Turbine 2--
76
	m.setCursorPos(1,7)
77
	m.setTextColor(colors.cyan)
78
	m.write("Turbine 2")
79
80
	m.setCursorPos(1,8)
81
	m.setTextColor(colors.white)
82
	m.write("Turbine Status: ")
83
	m.setCursorPos(20,8)
84
	m.setTextColor(colors.red)
85
	m.write(status2)
86
87
	m.setCursorPos(1,9)
88
	m.setTextColor(colors.white)
89
	m.write("Induction Coils: ")
90
	m.setCursorPos(20,9)
91
	m.setTextColor(colors.red)
92
	m.write(engaged2)
93
94
	m.setCursorPos(1,10)
95
	m.setTextColor(colors.white)
96
	m.write("RF/T: ")
97
	m.setCursorPos(20,10)
98
	m.setTextColor(colors.red)
99
	m.write(energyProd2)
100
101
	m.setCursorPos(1,11)
102
	m.setTextColor(colors.white)
103
	m.write("RF Stored: ")
104
	m.setCursorPos(20,11)
105
	m.setTextColor(colors.red)
106
	m.write(energy2)
107
108
	m.setCursorPos(1,12)
109
	m.setTextColor(colors.white)
110
	m.write("RPM: ")
111
	m.setCursorPos(20,12)
112
	m.setTextColor(colors.red)
113
	m.write(rpm2)
114
115
	--Redo every 0.1 sec.--
116
	os.sleep(0.1)
117
	end