Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- Initialize all the cubes and the monitor
- cube0 = peripheral.wrap("mekanism:elite_energy_cube_26")
- cube1 = peripheral.wrap("mekanism:elite_energy_cube_27")
- cube2 = peripheral.wrap("mekanism:elite_energy_cube_28")
- cube3 = peripheral.wrap("mekanism:elite_energy_cube_29")
- cube4 = peripheral.wrap("mekanism:elite_energy_cube_30")
- cube5 = peripheral.wrap("mekanism:elite_energy_cube_31")
- cube6 = peripheral.wrap("mekanism:elite_energy_cube_32")
- cube7 = peripheral.wrap("mekanism:elite_energy_cube_33")
- cube8 = peripheral.wrap("mekanism:elite_energy_cube_34")
- cube9 = peripheral.wrap("mekanism:elite_energy_cube_35")
- cube10 = peripheral.wrap("mekanism:elite_energy_cube_36")
- cube11 = peripheral.wrap("mekanism:elite_energy_cube_37")
- mon = peripheral.wrap("top")
- -- Initialize current Energy variables
- currentE0 = -1
- currentE1 = -1
- currentE2 = -1
- currentE3 = -1
- currentE4 = -1
- currentE5 = -1
- currentE6 = -1
- currentE7 = -1
- currentE8 = -1
- currentE9 = -1
- currentE10 = -1
- currentE11 = -1
- mon.setTextScale(0.8)
- -- main loop
- while true do
- -- cube 0
- cube0E = cube0.getEnergy()
- if cube0E > currentE0 then
- mon.setCursorPos(1,1)
- mon.setTextColor(colors.white)
- mon.write("CUBE 0: ")
- mon.setTextColor(colors.green)
- mon.write(string.format("%.2f",cube0E/1000000))
- mon.setTextColor(colors.white)
- mon.write(" MFE")
- currentE0 = cube0E
- elseif cube0E < currentE0 then
- mon.setCursorPos(1,1)
- mon.setTextColor(colors.white)
- mon.write("CUBE 0: ")
- mon.setTextColor(colors.green)
- mon.write(string.format("%.2f",cube0E/1000000))
- mon.setTextColor(colors.white)
- mon.write(" MFE")
- currentE0 = cube0E
- end
- -- CUBE 1
- cube1E = cube1.getEnergy()
- if cube1E > currentE1 then
- mon.setCursorPos(1,2)
- mon.setTextColor(colors.white)
- mon.write("CUBE 1: ")
- mon.setTextColor(colors.green)
- mon.write(string.format("%.2f",cube1E/1000000))
- mon.setTextColor(colors.white)
- mon.write(" MFE")
- currentE1 = cube1E
- elseif cube1E < currentE1 then
- mon.setCursorPos(1,2)
- mon.setTextColor(colors.white)
- mon.write("CUBE 1: ")
- mon.setTextColor(colors.green)
- mon.write(string.format("%.2f",cube1E/1000000))
- mon.setTextColor(colors.white)
- mon.write(" MFE")
- currentE1 = cube0E
- end
- -- CUBE 2
- cube2E = cube2.getEnergy()
- if cube2E > currentE2 then
- mon.setCursorPos(1,3)
- mon.setTextColor(colors.white)
- mon.write("CUBE 2: ")
- mon.setTextColor(colors.green)
- mon.write(string.format("%.2f",cube2E/1000000))
- mon.setTextColor(colors.white)
- mon.write(" MFE")
- currentE2 = cube2E
- elseif cube2E < currentE0 then
- mon.setCursorPos(1,3)
- mon.setTextColor(colors.white)
- mon.write("CUBE 2: ")
- mon.setTextColor(colors.green)
- mon.write(string.format("%.2f",cube2E/1000000))
- mon.setTextColor(colors.white)
- mon.write(" MFE")
- currentE2 = cube2E
- end
- -- CUBE 3
- cube3E = cube3.getEnergy()
- if cube3E > currentE3 then
- mon.setCursorPos(1,4)
- mon.setTextColor(colors.white)
- mon.write("CUBE 3: ")
- mon.setTextColor(colors.green)
- mon.write(string.format("%.2f",cube3E/1000000))
- mon.setTextColor(colors.white)
- mon.write(" MFE")
- currentE3 = cube3E
- elseif cube3E < currentE3 then
- mon.setCursorPos(1,4)
- mon.setTextColor(colors.white)
- mon.write("CUBE 3: ")
- mon.setTextColor(colors.green)
- mon.write(string.format("%.2f",cube3E/1000000))
- mon.setTextColor(colors.white)
- mon.write(" MFE")
- currentE3 = cube3E
- end
- -- CUBE 4
- cube4E = cube0.getEnergy()
- if cube4E > currentE4 then
- mon.setCursorPos(1,5)
- mon.setTextColor(colors.white)
- mon.write("CUBE 4: ")
- mon.setTextColor(colors.green)
- mon.write(string.format("%.2f",cube4E/1000000))
- mon.setTextColor(colors.white)
- mon.write(" MFE")
- currentE4 = cube4E
- elseif cube4E < currentE4 then
- mon.setCursorPos(1,5)
- mon.setTextColor(colors.white)
- mon.write("CUBE 4: ")
- mon.setTextColor(colors.green)
- mon.write(string.format("%.2f",cube4E/1000000))
- mon.setTextColor(colors.white)
- mon.write(" MFE")
- currentE4 = cube4E
- end
- -- CUBE 5
- cube5E = cube5.getEnergy()
- if cube5E > currentE5 then
- mon.setCursorPos(1,6)
- mon.setTextColor(colors.white)
- mon.write("CUBE 5: ")
- mon.setTextColor(colors.green)
- mon.write(string.format("%.2f",cube5E/1000000))
- mon.setTextColor(colors.white)
- mon.write(" MFE")
- currentE5 = cube5E
- elseif cube5E < currentE5 then
- mon.setCursorPos(1,6)
- mon.setTextColor(colors.white)
- mon.write("CUBE 5: ")
- mon.setTextColor(colors.green)
- mon.write(string.format("%.2f",cube5E/1000000))
- mon.setTextColor(colors.white)
- mon.write(" MFE")
- currentE5 = cube5E
- end
- -- cube 6
- cube6E = cube6.getEnergy()
- if cube6E > currentE6 then
- mon.setCursorPos(1,7)
- mon.setTextColor(colors.white)
- mon.write("CUBE 6: ")
- mon.setTextColor(colors.green)
- mon.write(string.format("%.2f",cube6E/1000000))
- mon.setTextColor(colors.white)
- mon.write(" MFE")
- currentE6 = cube6E
- elseif cube6E < currentE6 then
- mon.setCursorPos(1,7)
- mon.setTextColor(colors.white)
- mon.write("CUBE 6: ")
- mon.setTextColor(colors.green)
- mon.write(string.format("%.2f",cube6E/1000000))
- mon.setTextColor(colors.white)
- mon.write(" MFE")
- currentE6 = cube6E
- end
- -- CUBE 7
- cube7E = cube7.getEnergy()
- if cube7E > currentE7 then
- mon.setCursorPos(1,8)
- mon.setTextColor(colors.white)
- mon.write("CUBE 7: ")
- mon.setTextColor(colors.green)
- mon.write(string.format("%.2f",cube7E/1000000))
- mon.setTextColor(colors.white)
- mon.write(" MFE")
- currentE7 = cube7E
- elseif cube7E < currentE7 then
- mon.setCursorPos(1,8)
- mon.setTextColor(colors.white)
- mon.write("CUBE 7: ")
- mon.setTextColor(colors.green)
- mon.write(string.format("%.2",cube7E/1000000))
- mon.setTextColor(colors.white)
- mon.write(" MFE")
- currentE7 = cube7E
- end
- -- CUBE 8
- cube8E = cube8.getEnergy()
- if cube8E > currentE8 then
- mon.setCursorPos(1,9)
- mon.setTextColor(colors.white)
- mon.write("CUBE 8: ")
- mon.setTextColor(colors.green)
- mon.write(string.format("%.2f",cube8E/1000000))
- mon.setTextColor(colors.white)
- mon.write(" MFE")
- currentE8 = cube8E
- elseif cube8E < currentE8 then
- mon.setCursorPos(1,9)
- mon.setTextColor(colors.white)
- mon.write("CUBE 8: ")
- mon.setTextColor(colors.green)
- mon.write(string.format("%.2f",cube8E/1000000))
- mon.setTextColor(colors.white)
- mon.write(" MFE")
- currentE8 = cube8E
- end
- -- CUBE 9
- cube9E = cube9.getEnergy()
- if cube9E > currentE9 then
- mon.setCursorPos(1,10)
- mon.setTextColor(colors.white)
- mon.write("CUBE 9: ")
- mon.setTextColor(colors.green)
- mon.write(string.format("%.2f",cube9E/1000000))
- mon.setTextColor(colors.white)
- mon.write(" MFE")
- currentE9 = cube9E
- elseif cube9E < currentE9 then
- mon.setCursorPos(1,10)
- mon.setTextColor(colors.white)
- mon.write("CUBE 9: ")
- mon.setTextColor(colors.green)
- mon.write(string.format("%.2f",cube9E/1000000))
- mon.setTextColor(colors.white)
- mon.write(" MFE")
- currentE9 = cube9E
- end
- -- CUBE 10
- cube10E = cube10.getEnergy()
- if cube10E > currentE10 then
- mon.setCursorPos(1,11)
- mon.setTextColor(colors.white)
- mon.write("CUBE 10: ")
- mon.setTextColor(colors.green)
- mon.write(string.format("%.2f",cube10E/1000000))
- mon.setTextColor(colors.white)
- mon.write(" MFE")
- currentE10 = cube10E
- elseif cube10E < currentE10 then
- mon.setCursorPos(1,11)
- mon.setTextColor(colors.white)
- mon.write("CUBE 10: ")
- mon.setTextColor(colors.green)
- mon.write(string.format("%.2f",cube10E/1000000))
- mon.setTextColor(colors.white)
- mon.write(" MFE")
- currentE10 = cube10E
- end
- -- CUBE 11
- cube11E = cube11.getEnergy()
- if cube11E > currentE11 then
- mon.setCursorPos(1,12)
- mon.setTextColor(colors.white)
- mon.write("CUBE 11: ")
- mon.setTextColor(colors.green)
- mon.write(string.format("%.2f",cube11E/1000000))
- mon.setTextColor(colors.white)
- mon.write(" MFE")
- currentE11 = cube11E
- elseif cube11E < currentE11 then
- mon.setCursorPos(1,12)
- mon.setTextColor(colors.white)
- mon.write("CUBE 11: ")
- mon.setTextColor(colors.green)
- mon.write(string.format("%.2f",cube11E/1000000))
- mon.setTextColor(colors.white)
- mon.write(" MFE")
- currentE11 = cube11E
- end
- sleep(5)
- end
RAW Paste Data