Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local cell1 = peripheral.wrap("right")
- local cell2 = peripheral.wrap("left")
- local transmitter = peripheral.wrap("top")
- local monitor = peripheral.wrap("back")
- local charging1 = false
- local charging2 = false
- monitor.clear()
- monitor.setTextColor(512)
- monitor.setCursorPos(6,3)
- monitor.write("Power System Status")
- monitor.setTextColor(1)
- monitor.setCursorPos(5,5)
- monitor.write("Cell 1")
- monitor.setCursorPos(20,5)
- monitor.write("Cell 2")
- monitor.setCursorPos(12,8)
- monitor.write("Engines")
- transmitter.setFreq(1)
- while(true) do
- data1 = cell1.get()
- data2 = cell2.get()
- monitor.setCursorPos(1,6)
- monitor.clearLine()
- monitor.setCursorPos(1,9)
- monitor.clearLine()
- if data1["Full Energy"] then
- monitor.setCursorPos(6,6)
- monitor.setTextColor(32)
- monitor.write("Full")
- charging1 = false
- elseif data1["No Energy"] then
- monitor.setCursorPos(5,6)
- monitor.setTextColor(16384)
- monitor.write("Empty")
- charging1 = true
- elseif data1["Energy Stored"] and data1["Can Store Energy"] then
- monitor.setCursorPos(4,6)
- if charging1 then
- monitor.setTextColor(16)
- monitor.write("Charging")
- else
- monitor.setTextColor(2)
- monitor.write("Draining")
- end
- else
- monitor.setCursorPos(5,6)
- monitor.setTextColor(16384)
- monitor.write("ERROR")
- end
- if data2["Full Energy"] then
- monitor.setCursorPos(21,6)
- monitor.setTextColor(32)
- monitor.write("Full")
- charging2 = false
- elseif data2["No Energy"] then
- monitor.setCursorPos(20,6)
- monitor.setTextColor(16384)
- monitor.write("Empty")
- charging2 = true
- elseif data2["Energy Stored"] and data2["Can Store Energy"] then
- monitor.setCursorPos(19,6)
- if charging2 then
- monitor.setTextColor(16)
- monitor.write("Charging")
- else
- monitor.setTextColor(2)
- monitor.write("Draining")
- end
- else
- monitor.setCursorPos(20,6)
- monitor.setTextColor(16384)
- monitor.write("ERROR")
- end
- if charging1 and charging2 then
- redstone.setOutput("top",true)
- monitor.setCursorPos(12,9)
- monitor.setTextColor(32)
- monitor.write("Running")
- elseif not charging1 and not charging2 then
- redstone.setOutput("top",false)
- monitor.setCursorPos(14,9)
- monitor.setTextColor(16384)
- monitor.write("Off")
- end
- sleep(1)
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement