Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local capacitor = peripheral.wrap("top")
- local wifi = peripheral.wrap("back")
- local nbSlot = 740
- redstone.setOutput("bottom", false )
- while true do
- capacitorEnergy = capacitor.getEnergyStored() * nbSlot
- capacitorEnergyMax = capacitor.getMaxEnergyStored() * nbSlot
- percentcelule = math.floor(100 * capacitorEnergy / capacitorEnergyMax )
- term.clear()
- term.setCursorPos(1,1)
- print("Remplissage: "..percentcelule.."%")
- if percentcelule < 30 then
- redstone.setOutput("bottom",true)
- end
- if percentcelule > 60 then
- redstone.setOutput("bottom",false)
- end
- local tableau = { energy = capacitorEnergy, energyMax = capacitorEnergyMax , celpercent = percentcelule }
- local sendmsg = textutils.serialize(tableau)
- wifi.transmit(2,0,sendmsg)
- sleep(2)
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement