Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- pim = peripheral.wrap("front")
- while true do
- event = os.pullEvent()
- if event == "player_on" then
- rs.setOutput("top",true)
- for slot, contents in pairs(pim.getAllStacks()) do
- for k,v in pairs(pim.getStackInSlot(slot)) do
- if k == "maxEnergyStored" then
- maxEng = v
- elseif k == "energyStored" then
- eng = v
- isElectric = true
- end
- end
- if isElectric == true and eng < maxEng then
- pim.pushItem("down",slot)
- event = os.pullEvent()
- if event == "redstone" then
- pim.pullItem("down",1,1,slot)
- end
- end
- isElectric = false
- end
- rs.setOutput("top",false)
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement