Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- Main computer program
- -- Use 6x3 monitor. 61x19 text.
- local mon = peripheral.wrap("monitor_2")
- mon.setTextColor(colors.white)
- mon.setBackgroundColor(colors.blue)
- local batt = {}
- for i = 10,19 do
- table.insert(batt, peripheral.wrap("tile_thermalexpansion_cell_basic_name_"..tostring(i)))
- end
- local maxnrg = 800000000
- local savnrg = 80000000
- local surv = {}
- for i = 1,6 do
- table.insert(surv, peripheral.wrap("generatorfurnace_"..tostring(i)))
- end
- -- Main
- while true do
- local tnrg = 0
- local nrg = {}
- for i = 1,10 do
- local a = batt[i].getEnergyStored()
- table.insert(nrg, tostring(a))
- tnrg = tnrg + a
- end
- mon.clear()
- for i = 1,9,2 do
- mon.setCursorPos(10,(i+1)/2+3)
- mon.write(nrg[i])
- end
- for i = 2,10,2 do
- mon.setCursorPos(20,i/2+3)
- mon.write(nrg[i])
- end
- mon.setCursorPos(10,10)
- mon.write(tostring(tnrg))
- mon.setCursorPos(20,10)
- mon.write(tostring(maxnrg))
- mon.setCursorPos(30,10)
- local a = math.ceil(tnrg/maxnrg * 100)
- mon.write(tostring(a).."%")
- local sum = 0
- for i = 1,6 do
- local a = surv[i].getStackInSlot(1)
- if a ~= nil then
- sum = sum + a.qty
- end
- end
- mon.setCursorPos(10,12)
- mon.write("Fuel : "..tostring(sum))
- mon.setCursorPos(10,13)
- local total = sum * 1600000
- mon.write(tostring(total))
- if total + tnrg + savnrg < maxnrg then
- redstone.setBundledOutput("bottom",colors.red)
- else
- redstone.setBundledOutput("bottom",0)
- end
- sleep(1)
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement