Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- Anfang der Config --
- screen = peripheral.wrap("monitor_0")
- cell1 = peripheral.wrap("tile_thermalexpansion_cell_basic_name_0")
- cell2 = peripheral.wrap("tile_thermalexpansion_cell_basic_name_1")
- cell3 = peripheral.wrap("tile_thermalexpansion_cell_basic_name_2")
- cell4 = peripheral.wrap("tile_thermalexpansion_cell_basic_name_3")
- cell5 = peripheral.wrap("tile_thermalexpansion_cell_basic_name_4")
- cell6 = peripheral.wrap("tile_thermalexpansion_cell_basic_name_5")
- -- Ende der Config --
- screen.setBackgroundColor(8)
- screen.clear()
- screen.setTextColor(2)
- screen.setTextScale(2)
- screen.setCursorPos(8,4)
- screen.write("Zonga")
- screen.setTextColor(1)
- screen.write("LP")
- screen.setCursorPos(14,8)
- screen.write("Loading")
- while true do
- max1 = cell1.getMaxEnergyStored()
- max2 = cell2.getMaxEnergyStored()
- max3 = cell3.getMaxEnergyStored()
- max4 = cell4.getMaxEnergyStored()
- max5 = cell5.getMaxEnergyStored()
- max6 = cell6.getMaxEnergyStored()
- energy1 = cell1.getEnergyStored()
- energy2 = cell2.getEnergyStored()
- energy3 = cell3.getEnergyStored()
- energy4 = cell4.getEnergyStored()
- energy5 = cell5.getEnergyStored()
- energy6 = cell6.getEnergyStored()
- fill1 = energy1 / max1 * 100
- fill2 = energy2 / max2 * 100
- fill3 = energy3 / max3 * 100
- fill4 = energy4 / max4 * 100
- fill5 = energy5 / max5 * 100
- fill6 = energy6 / max6 * 100
- fill1 = math.floor(fill1)
- fill2 = math.floor(fill2)
- fill3 = math.floor(fill3)
- fill4 = math.floor(fill4)
- fill5 = math.floor(fill5)
- fill6 = math.floor(fill6)
- local oldetc1 = cell1.getEnergyStored()
- local oldetc2 = cell2.getEnergyStored()
- local oldetc3 = cell3.getEnergyStored()
- local oldetc4 = cell4.getEnergyStored()
- local oldetc5 = cell5.getEnergyStored()
- local oldetc6 = cell6.getEnergyStored()
- sleep(1)
- local etc1 = cell1.getEnergyStored()
- local etc2 = cell2.getEnergyStored()
- local etc3 = cell3.getEnergyStored()
- local etc4 = cell4.getEnergyStored()
- local etc5 = cell5.getEnergyStored()
- local etc6 = cell6.getEnergyStored()
- local max1etc = cell1.getMaxEnergyStored()
- local max2etc = cell2.getMaxEnergyStored()
- local max3etc = cell3.getMaxEnergyStored()
- local max4etc = cell4.getMaxEnergyStored()
- local max5etc = cell5.getMaxEnergyStored()
- local max6etc = cell6.getMaxEnergyStored()
- local energyinsec1 = etc1 - oldetc1
- local energyinsec2 = etc2 - oldetc2
- local energyinsec3 = etc3 - oldetc3
- local energyinsec4 = etc4 - oldetc4
- local energyinsec5 = etc5 - oldetc5
- local energyinsec6 = etc6 - oldetc6
- time1 = 0
- time2 = 0
- time3 = 0
- time4 = 0
- time5 = 0
- time6 = 0
- if energyinsec1 == 0 then
- until1 = 2
- end
- if energyinsec1 > 0 then
- until1 = 3
- end
- if energyinsec1 < 0 then
- energyinsec1 = energyinsec1 - energyinsec1 - energyinsec1
- until1 = 1
- end
- if energyinsec2 == 0 then
- until2 = 2
- end
- if energyinsec2 > 0 then
- until2 = 3
- end
- if energyinsec2 < 0 then
- energyinsec2 = energyinsec2 - energyinsec2 - energyinsec2
- until2 = 1
- end
- if energyinsec3 == 0 then
- until3 = 2
- end
- if energyinsec3 > 0 then
- until3 = 3
- end
- if energyinsec3 < 0 then
- energyinsec3 = energyinsec3 - energyinsec3 - energyinsec3
- until3 = 1
- end
- if energyinsec4 == 0 then
- until4 = 2
- end
- if energyinsec4 > 0 then
- until4 = 3
- end
- if energyinsec4 < 0 then
- energyinsec4 = energyinsec4 - energyinsec4 - energyinsec4
- until4 = 1
- end
- if energyinsec5 == 0 then
- until5 = 2
- end
- if energyinsec5 > 0 then
- until5 = 3
- end
- if energyinsec5 < 0 then
- energyinsec5 = energyinsec5 - energyinsec5 - energyinsec5
- until5 = 1
- end
- if energyinsec6 == 0 then
- until6 = 2
- end
- if energyinsec6 > 0 then
- until6 = 3
- end
- if energyinsec6 < 0 then
- energyinsec6 = energyinsec6 - energyinsec6 - energyinsec6
- until6 = 1
- end
- if until1 == 3 then
- difference1 = max1etc
- difference1 = difference1 - etc1
- time1 = difference1 / energyinsec1
- end
- if until1 == 1 then
- time1 = etc1 / energyinsec1
- end
- hour1 = 0
- minute1 = 0
- second1 = time1
- if until1 == 2 then
- else
- while second1 > 59 do
- second1 = second1 - 60
- minute1 = minute1 + 1
- end
- while minute1 > 59 do
- minute1 = minute1 - 60
- hour1 = hour1 + 1
- end
- end
- second1 = math.floor(second1)
- if until2 == 3 then
- difference2 = max2etc
- difference2 = difference2 - etc2
- time2 = difference2 / energyinsec2
- end
- if until2 == 1 then
- time2 = etc2 / energyinsec2
- end
- hour2 = 0
- minute2 = 0
- second2 = time2
- if until2 == 2 then
- else
- while second2 > 59 do
- second2 = second2 - 60
- minute2 = minute2 + 1
- end
- while minute2 > 59 do
- minute2 = minute2 - 60
- hour2 = hour2 + 1
- end
- end
- second2 = math.floor(second2)
- if until3 == 3 then
- difference3 = max3etc
- difference3 = difference3 - etc3
- time3 = difference3 / energyinsec3
- end
- if until3 == 1 then
- time3 = etc3 / energyinsec3
- end
- hour3 = 0
- minute3 = 0
- second3 = time3
- if until3 == 2 then
- else
- while second3 > 59 do
- second3 = second3 - 60
- minute3 = minute3 + 1
- end
- while minute3 > 59 do
- minute3 = minute3 - 60
- hour3 = hour3 + 1
- end
- end
- second3 = math.floor(second3)
- if until4 == 3 then
- difference4 = max4etc
- difference4 = difference4 - etc4
- time4 = difference4 / energyinsec4
- end
- if until4 == 1 then
- time4 = etc4 / energyinsec4
- end
- hour4 = 0
- minute4 = 0
- second4 = time4
- if until4 == 2 then
- else
- while second4 > 59 do
- second4 = second4 - 60
- minute4 = minute4 + 1
- end
- while minute4 > 59 do
- minute4 = minute4 - 60
- hour4 = hour4 + 1
- end
- end
- second4 = math.floor(second4)
- if until5 == 3 then
- difference5 = max5etc
- difference5 = difference5 - etc5
- time5 = difference5 / energyinsec5
- end
- if until5 == 1 then
- time5 = etc5 / energyinsec5
- end
- hour5 = 0
- minute5 = 0
- second5 = time5
- if until5 == 2 then
- else
- while second5 > 59 do
- second5 = second5 - 60
- minute5 = minute5 + 1
- end
- while minute5 > 59 do
- minute5 = minute5 - 60
- hour5 = hour5 + 1
- end
- end
- second5 = math.floor(second5)
- if until6 == 3 then
- difference6 = max6etc
- difference6 = difference6 - etc6
- time6 = difference6 / energyinsec6
- end
- if until6 == 1 then
- time6 = etc6 / energyinsec6
- end
- hour6 = 0
- minute6 = 0
- second6 = time6
- if until6 == 2 then
- else
- while second6 > 59 do
- second6 = second6 - 60
- minute6 = minute6 + 1
- end
- while minute6 > 59 do
- minute6 = minute6 - 60
- hour6 = hour6 + 1
- end
- end
- second6 = math.floor(second6)
- screen.setTextScale(1)
- screen.setBackgroundColor(32768)
- screen.clear()
- screen.setBackgroundColor(1)
- screen.setTextColor(1)
- screen.setCursorPos(1,6)
- screen.clearLine()
- screen.setCursorPos(1,12)
- screen.clearLine()
- screen.setCursorPos(1,18)
- screen.clearLine()
- screen.setCursorPos(20,1)
- screen.write(" ")
- screen.setCursorPos(20,2)
- screen.write(" ")
- screen.setCursorPos(20,3)
- screen.write(" ")
- screen.setCursorPos(20,4)
- screen.write(" ")
- screen.setCursorPos(20,5)
- screen.write(" ")
- screen.setCursorPos(20,6)
- screen.write(" ")
- screen.setCursorPos(20,7)
- screen.write(" ")
- screen.setCursorPos(20,8)
- screen.write(" ")
- screen.setCursorPos(20,9)
- screen.write(" ")
- screen.setCursorPos(20,10)
- screen.write(" ")
- screen.setCursorPos(20,11)
- screen.write(" ")
- screen.setCursorPos(20,12)
- screen.write(" ")
- screen.setCursorPos(20,13)
- screen.write(" ")
- screen.setCursorPos(20,14)
- screen.write(" ")
- screen.setCursorPos(20,15)
- screen.write(" ")
- screen.setCursorPos(20,16)
- screen.write(" ")
- screen.setCursorPos(20,17)
- screen.write(" ")
- screen.setCursorPos(20,18)
- screen.write(" ")
- if until5 == 1 then
- screen.setBackgroundColor(16)
- end
- if until5 == 2 then
- screen.setBackgroundColor(8)
- end
- if until5 == 3 then
- screen.setBackgroundColor(32)
- end
- if energy5 == 0 then
- screen.setBackgroundColor(16384)
- end
- screen.setCursorPos(1,13)
- screen.write(" ")
- screen.setCursorPos(1,14)
- screen.write(" ")
- screen.setCursorPos(1,15)
- screen.write(" ")
- screen.setCursorPos(1,16)
- screen.write(" ")
- screen.setCursorPos(1,17)
- screen.write(" ")
- screen.setCursorPos(1,13)
- screen.write("Energy Cell 5")
- screen.setCursorPos(1,15)
- if max5 > 999999 then
- local max5m = max5 / 1000000
- screen.write("Capacity:"..max5m.."M RF")
- else
- screen.write("Capacity:"..max5.." RF")
- end
- screen.setCursorPos(1,16)
- if energy5 > 999999 then
- local energy5m = energy5 / 1000000
- local energy5m = math.floor(energy5m)
- screen.write("Fill: "..energy5m.."M RF")
- else
- screen.write("Fill: "..energy5.." RF")
- end
- screen.setCursorPos(1,17)
- if until5 == 2 then
- screen.write("ETC: --:--:--")
- else
- screen.write("ETC: "..hour5..":"..minute5..":"..second5)
- end
- screen.setCursorPos(16,13)
- if fill5 < 10 then
- screen.write(" "..fill5.."%")
- else
- if fill5 < 100 then
- screen.write(" "..fill5.."%")
- else
- screen.write(fill5.."%")
- end
- end
- if until3 == 1 then
- screen.setBackgroundColor(16)
- end
- if until3 == 2 then
- screen.setBackgroundColor(8)
- end
- if until3 == 3 then
- screen.setBackgroundColor(32)
- end
- if energy3 == 0 then
- screen.setBackgroundColor(16384)
- end
- screen.setCursorPos(1,7)
- screen.write(" ")
- screen.setCursorPos(1,8)
- screen.write(" ")
- screen.setCursorPos(1,9)
- screen.write(" ")
- screen.setCursorPos(1,10)
- screen.write(" ")
- screen.setCursorPos(1,11)
- screen.write(" ")
- screen.setCursorPos(1,7)
- screen.write("Energy Cell 3")
- screen.setCursorPos(1,9)
- if max3 > 999999 then
- local max3m = max3 / 1000000
- screen.write("Capacity:"..max3m.."M RF")
- else
- screen.write("Capacity:"..max3.." RF")
- end
- screen.setCursorPos(1,10)
- if energy3 > 999999 then
- local energy3m = energy3 / 1000000
- local energy3m = math.floor(energy3m)
- screen.write("Fill: "..energy3m.."M RF")
- else
- screen.write("Fill: "..energy3.." RF")
- end
- screen.setCursorPos(1,11)
- if until3 == 2 then
- screen.write("ETC: --:--:--")
- else
- screen.write("ETC: "..hour3..":"..minute3..":"..second3)
- end
- screen.setCursorPos(16,7)
- if fill3 < 10 then
- screen.write(" "..fill3.."%")
- else
- if fill3 < 100 then
- screen.write(" "..fill3.."%")
- else
- screen.write(fill3.."%")
- end
- end
- if until1 == 1 then
- screen.setBackgroundColor(16)
- end
- if until1 == 2 then
- screen.setBackgroundColor(8)
- end
- if until1 == 3 then
- screen.setBackgroundColor(32)
- end
- if energy1 == 0 then
- screen.setBackgroundColor(16384)
- end
- screen.setCursorPos(1,1)
- screen.write(" ")
- screen.setCursorPos(1,2)
- screen.write(" ")
- screen.setCursorPos(1,3)
- screen.write(" ")
- screen.setCursorPos(1,4)
- screen.write(" ")
- screen.setCursorPos(1,5)
- screen.write(" ")
- screen.setCursorPos(1,1)
- screen.write("Energy Cell 1")
- screen.setCursorPos(1,3)
- if max1 > 999999 then
- local max1m = max1 / 1000000
- screen.write("Capacity:"..max1m.."M RF")
- else
- screen.write("Capacity:"..max1.." RF")
- end
- screen.setCursorPos(1,4)
- if energy1 > 999999 then
- local energy1m = energy1 / 1000000
- local energy1m = math.floor(energy1m)
- screen.write("Fill: "..energy1m.."M RF")
- else
- screen.write("Fill: "..energy1.." RF")
- end
- screen.setCursorPos(1,5)
- if until1 == 2 then
- screen.write("ETC: --:--:--")
- else
- screen.write("ETC: "..hour1..":"..minute1..":"..second1)
- end
- screen.setCursorPos(16,1)
- if fill1 < 10 then
- screen.write(" "..fill1.."%")
- else
- if fill1 < 100 then
- screen.write(" "..fill1.."%")
- else
- screen.write(fill1.."%")
- end
- end
- if until6 == 1 then
- screen.setBackgroundColor(16)
- end
- if until6 == 2 then
- screen.setBackgroundColor(8)
- end
- if until6 == 3 then
- screen.setBackgroundColor(32)
- end
- if energy6 == 0 then
- screen.setBackgroundColor(16384)
- end
- screen.setCursorPos(21,13)
- screen.write(" ")
- screen.setCursorPos(21,14)
- screen.write(" ")
- screen.setCursorPos(21,15)
- screen.write(" ")
- screen.setCursorPos(21,16)
- screen.write(" ")
- screen.setCursorPos(21,17)
- screen.write(" ")
- screen.setCursorPos(21,13)
- screen.write("Energy Cell 6")
- screen.setCursorPos(21,15)
- if max6 > 999999 then
- local max6m = max6 / 1000000
- screen.write("Capacity:"..max6m.."M RF")
- else
- screen.write("Capacity:"..max6.." RF")
- end
- screen.setCursorPos(21,16)
- if energy6 > 999999 then
- local energy6m = energy6 / 1000000
- local energy6m = math.floor(energy6m)
- screen.write("Fill: "..energy6m.."M RF")
- else
- screen.write("Fill: "..energy6.." RF")
- end
- screen.setCursorPos(21,17)
- if until6 == 2 then
- screen.write("ETC: --:--:--")
- else
- screen.write("ETC: "..hour6..":"..minute6..":"..second6)
- end
- screen.setCursorPos(36,13)
- if fill6 < 10 then
- screen.write(" "..fill6.."%")
- else
- if fill6 < 100 then
- screen.write(" "..fill6.."%")
- else
- screen.write(fill6.."%")
- end
- end
- if until4 == 1 then
- screen.setBackgroundColor(16)
- end
- if until4 == 2 then
- screen.setBackgroundColor(8)
- end
- if until4 == 3 then
- screen.setBackgroundColor(32)
- end
- if energy4 == 0 then
- screen.setBackgroundColor(16384)
- end
- screen.setCursorPos(21,7)
- screen.write(" ")
- screen.setCursorPos(21,8)
- screen.write(" ")
- screen.setCursorPos(21,9)
- screen.write(" ")
- screen.setCursorPos(21,10)
- screen.write(" ")
- screen.setCursorPos(21,11)
- screen.write(" ")
- screen.setCursorPos(21,7)
- screen.write("Energy Cell 4")
- screen.setCursorPos(21,9)
- if max4 > 999999 then
- local max4m = max4 / 1000000
- screen.write("Capacity:"..max4m.."M RF")
- else
- screen.write("Capacity:"..max4.." RF")
- end
- screen.setCursorPos(21,10)
- if energy4 > 999999 then
- local energy4m = energy4 / 1000000
- local energy4m = math.floor(energy4m)
- screen.write("Fill: "..energy4m.."M RF")
- else
- screen.write("Fill: "..energy4.." RF")
- end
- screen.setCursorPos(21,11)
- if until4 == 2 then
- screen.write("ETC: --:--:--")
- else
- screen.write("ETC: "..hour4..":"..minute4..":"..second4)
- end
- screen.setCursorPos(36,7)
- if fill4 < 10 then
- screen.write(" "..fill4.."%")
- else
- if fill4 < 100 then
- screen.write(" "..fill4.."%")
- else
- screen.write(fill4.."%")
- end
- end
- if until2 == 1 then
- screen.setBackgroundColor(16)
- end
- if until2 == 2 then
- screen.setBackgroundColor(8)
- end
- if until2 == 3 then
- screen.setBackgroundColor(32)
- end
- if energy2 == 0 then
- screen.setBackgroundColor(16384)
- end
- screen.setCursorPos(21,1)
- screen.write(" ")
- screen.setCursorPos(21,2)
- screen.write(" ")
- screen.setCursorPos(21,3)
- screen.write(" ")
- screen.setCursorPos(21,4)
- screen.write(" ")
- screen.setCursorPos(21,5)
- screen.write(" ")
- screen.setCursorPos(21,1)
- screen.write("Energy Cell 2")
- screen.setCursorPos(21,3)
- if max2 > 999999 then
- local max2m = max2 / 1000000
- screen.write("Capacity:"..max2m.."M RF")
- else
- screen.write("Capacity:"..max2.." RF")
- end
- screen.setCursorPos(21,4)
- if energy2 > 999999 then
- local energy2m = energy2 / 1000000
- local energy2m = math.floor(energy2m)
- screen.write("Fill: "..energy2m.."M RF")
- else
- screen.write("Fill: "..energy2.." RF")
- end
- screen.setCursorPos(21,5)
- if until2 == 2 then
- screen.write("ETC: --:--:--")
- else
- screen.write("ETC: "..hour2..":"..minute2..":"..second2)
- end
- screen.setCursorPos(36,1)
- if fill2 < 10 then
- screen.write(" "..fill2.."%")
- else
- if fill2 < 100 then
- screen.write(" "..fill2.."%")
- else
- screen.write(fill2.."%")
- end
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement