Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --ComputerCraft Draconic Energy Core Serveur by Teki
- local energyCore = peripheral.wrap("back")
- rednet.open("left")
- local reponse = ""
- while true do
- id, msg = rednet.receive("CCDECClient")
- if (msg == "getAll") then -- Is the computer connected ?
- reponse = {energyCore.getEnergyStored(), energyCore.getMaxEnergyStored()}
- elseif (msg == "getEnergyStored") then -- Is the computer connected ?
- reponse = energyCore.getEnergyStored()
- elseif (msg == "getMaxEnergyStored") then -- Is the generator active ?
- reponse = energyCore.getMaxEnergyStored()
- end
- rednet.send(id, reponse, "CCDECServeur")
- print("recv: '" .. msg .. "' from " .. id)
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement