Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Reactor = {
- direction = "south"
- }
- Chest = {
- chest = peripheral.wrap("gold_chest_2")
- }
- EnergyCell = {
- }
- EnergyCell_mt = {__index = EnergyCell}
- function EnergyCell:create()--{{{
- local newEnergyCell = {}
- setmetatable(newEnergyCell, EnergyCell_mt)
- return newEnergyCell
- end--}}}
- energyCells = {}
- energyCells[1] = EnergyCell:create()
- energyCells[1].cell = peripheral.wrap("redstone_energy_cell_2")
- energyCells[2] = EnergyCell:create()
- energyCells[2].cell = peripheral.wrap("redstone_energy_cell_3")
- energyCells[3] = EnergyCell:create()
- energyCells[3].cell = peripheral.wrap("redstone_energy_cell_4")
- energyCells[4] = EnergyCell:create()
- energyCells[4].cell = peripheral.wrap("redstone_energy_cell_5")
- energyCells[5] = EnergyCell:create()
- energyCells[5].cell = peripheral.wrap("redstone_energy_cell_6")
- energyCells[6] = EnergyCell:create()
- energyCells[6].cell = peripheral.wrap("redstone_energy_cell_7")
- energyCells[7] = EnergyCell:create()
- energyCells[7].cell = peripheral.wrap("redstone_energy_cell_8")
- function Chest:findFuel(name)--{{{
- for slot=0,self.chest.getSizeInventory() do
- local slotContents = self.chest.getStackInSlot(slot)
- if name == slotContents.name then
- return slotContents
- end
- end
- end--}}}
- function getTotalStoredEnergy(energyCells)
- local total = 0
- for key, energyCell in pairs(energyCells) do
- total = total + energyCell.cell.getEnergyStored()
- end
- return total
- end
- function Chest:insertIntoReactor(fuelType, quantity)
- end
- function refuelReactor(chest, reactor)
- chest.chest.condense()
- for slot=0,chest.chest.getSizeInventory()-1 do
- end
- end
- reactor = Reactor
- chest = Chest
- cell = EnergyCell
- while true do
- os.startTimer(60)
- event, param1, param2, param3 = os.pullEvent("timer")
- if event == 'timer' then
- print(total)
- total = getTotalStoredEnergy(energyCells)
- if total < 600000 then
- end
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement