Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- programa para enviar la informacion de un almacen de energia del draconic
- -- id del receptor
- id = 9
- -- cargar perifericos
- p = peripheral.getNames()
- -- bucamos el power bank y lo guardamos
- for k = 1, table.getn(p) do
- if peripheral.getType(p[k]) == "draconic_rf_storage" then
- ec = peripheral.wrap(p[k])
- break
- end
- end
- -- conectamos el wifi
- rednet.open("back")
- -- contador de animacion
- c = 0
- while true do
- -- extraer datos
- d = {
- es = ec.getEnergyStored(), -- energy stored
- mes = ec.getMaxEnergyStored(), -- max energy stored
- tpt = ec.getTransferPerTick() -- tranfer per tick
- }
- -- manadamos la informacion
- rednet.send(id, d,"datosAlmacenamiento")
- -- escribir mensaje en pantalla para confirmar funcionamiento
- text = "Sending data"
- for k = 0, c do
- text = text .. "."
- end
- term.current().clearLine()
- x,y = term.current().getCursorPos()
- term.current().setCursorPos(1,y)
- write(text)
- c = (c+1)%3
- -- esperar para mandar mas informacion
- sleep(1)
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement