Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- p = peripheral.getNames()
- for i=1,#p do
- tab[i] = peripheral.wrap(p[i])
- if p[i] == "top" then
- chest = peripheral.wrap(p[i])
- end
- end
- while true do
- sum = 0
- stored = 0
- for o=1,#tab do
- if peripheral.getType(tab[o]) ~= "ender_chest" then
- sum = sum + tab[o].getMaxEnergyStored()
- stored = stored + tab[o].getEnergyStored()
- end
- if (stored/sum)<0.5 then
- chest.pushItem("north",1,1)
- sleep(120)
- end
- sleep(5)
- end
Advertisement
Add Comment
Please, Sign In to add comment