Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- bridge = peripheral.wrap("left")
- bridge.clear()
- function EUStorage()
- batbox1 = peripheral.wrap("batbox_0")
- batbox2 = peripheral.wrap("batbox_1")
- batbox3 = peripheral.wrap("batbox_2")
- batbox4 = peripheral.wrap("batbox_3")
- end
- function BCStorage()
- energycell1 = peripheral.wrap("redstone_energy_cell_0")
- energycell2 = peripheral.wrap("redstone_energy_cell_1")
- energycell3 = peripheral.wrap("redstone_energy_cell_2")
- energycell4 = peripheral.wrap("redstone_energy_cell_3")
- energycell5 = peripheral.wrap("redstone_energy_cell_4")
- energycell6 = peripheral.wrap("redstone_energy_cell_5")
- end
- function tanks()
- tank1 = peripheral.wrap("steel_tank_valve_2")
- tank2 = peripheral.wrap("steel_tank_valve_3")
- tank3 = peripheral.wrap("steel_tank_valve_4")
- tank4 = peripheral.wrap("steel_tank_valve_5")
- end
- function boilers()
- boiler1 = peripheral.wrap("solid_fueled_boiler_firebox_0")
- boiler2 = peripheral.wrap("liquid_fueled_boiler_firebox_0")
- end
- function rest()
- turbine1 = peripheral.wrap("steam_turbine_housing_0")
- end
- function wrapAll()
- EUStorage()
- BCStorage()
- tanks()
- boilers()
- rest()
- end
- wrapAll()
- print("Loaded Wraps!")
- sleep(0.5)
- print("Starting program")
- sleep(5)
- function debugTanksTables()
- adnTable = tank1.getTanks("unknown")
- adntank = adnTable[1]
- fuelTable = tank2.getTanks("unknown")
- fueltank = fuelTable[1]
- oilTable = tank3.getTanks("unknown")
- oiltank = oilTable[1]
- steamTable = tank4.getTanks("unknown")
- steamtank = steamTable[1]
- end
- debugTanksTables()
- print("Data Colected")
- print("Preparing Data to be shown")
- sleep(5)
- function draw()
- local xCords = 5
- local EUall = batbox1.getCapacity() + batbox2.getCapacity() + batbox3.getCapacity() + batbox4.getCapacity()
- local EUcurrent = batbox1.getStored() + batbox2.getStored() + batbox3.getStored() + batbox4.getStored()
- local BCall = energycell1.getMaxEnergyStored() + energycell2.getMaxEnergyStored() + energycell3.getMaxEnergyStored() + energycell4.getMaxEnergyStored() + energycell5.getMaxEnergyStored() + energycell5.getMaxEnergyStored()
- local BCcurrent = energycell1.getEnergyStored() + energycell2.getEnergyStored() + energycell3.getEnergyStored() + energycell4.getEnergyStored() + energycell5.getEnergyStored() + energycell5.getEnergyStored()
- ADNAll = adntank.capacity
- ADNCurrent = adntank.amount
- FuelAll = fueltank.capacity
- FuelCurrent = fueltank.amount
- OilAll = oiltank.capacity
- OilCurrent = oiltank.amount
- SteamAll = steamtank.capacity
- SteamCurrent = steamtank.amount
- solidTemp = boiler1.getTemperature()
- liquidTemp = boiler2.getTemperature()
- solidFuel = boiler1.needsFuel()
- maxEnergy = turbine1.getMaxEnergyOutput()
- maintenance = turbine1.needsMaintenance()
- local eustoragebox = bridge.addBox(4, 14, 150, 156, 0xC0C0C0, 0.5)
- sleep(0.05)
- local eustoragename = bridge.addText(xCords, 15, "MFSUs", 0x000000)
- local eustorage = bridge.addText(xCords, 25, "Energy: "..EUall.."/"..EUcurrent, 0x000000)
- local bcstoragename = bridge.addText(xCords, 35, "Energy Cells", 0x000000)
- local bcstorage = bridge.addText(xCords, 45, "Energy: "..BCall.."/"..BCcurrent, 0x000000)
- local tanksname = bridge.addText(xCords, 55, "Tanks", 0x000000)
- local adnstorage = bridge.addText(xCords, 65, "ADN: "..ADNAll.."/"..ADNCurrent, 0x000000)
- local fuelstorage = bridge.addText(xCords, 75, "Fuel: "..FuelAll.."/"..FuelCurrent, 0x000000)
- local oilstorage = bridge.addText(xCords, 85, "Oil: "..OilAll.."/"..OilCurrent, 0x000000)
- local steamstorage = bridge.addText(xCords, 95, "Steam: "..SteamAll.."/"..SteamCurrent, 0x000000)
- local bcstoragename = bridge.addText(xCords, 105, "Boilers", 0x000000)
- local solidtemp = bridge.addText(xCords, 115, "SolidTemp: "..solidTemp.."ºC", 0x000000)
- local solidtemp = bridge.addText(xCords, 125, "LiquidTemp: "..liquidTemp.."ºC", 0x000000)
- local soldineedsfuel = bridge.addText(xCords, 135, "Needs Fuel: "..solidFuel, 0x000000)
- local maxoutput = bridge.addText(xCords, 145, "Turbine output: "..maxEnergy, 0x000000)
- local needsmaintenance = bridge.addText(xCords, 155, "Needs Maintenance: "..maintenance, 0x000000)
- end
- bridge.clear()
- debugTanksTables()
- draw()
- while true do
- for i = 1, 15 do
- bridge.clear()
- debugTanksTables()
- draw()
- sleep(1)
- if i == 15 then
- i = 1
- end
- end
- sleep(0.0005)
- end
Add Comment
Please, Sign In to add comment