Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- shuntA = peripheral.wrap("top")
- shuntB = peripheral.wrap("left")
- url = "http://rest.rgbcraft.com/corrente/dati.php?nome1="
- suffisso = ""
- for i=1,9 do
- sleep(0.5)
- uuid, st, nome, tabella = shuntA.get(i)
- h = i+1
- nome = string.gsub("%s", "%%20")
- suffisso = suffisso..nome.."&potenza"..i.."="..tabella.average.."&nome"..h.."="
- print("Shunt A"..i)
- end
- for i=10,14 do
- sleep(0.5)
- uuid, st, nome, tabella = shuntB.get(i-9)
- h = i+1
- suffisso = suffisso..nome.."&potenza"..i.."="..tabella.average.."&nome"..h.."="
- print("Shunt B"..i)
- end
- rest = http.get(url..suffisso)
- write(rest.readAll())
- rest.close()
- for j=5,1,-1 do
- term.setCursorPos(1, 15)
- print("CD: "..j.." ")
- sleep(1)
- end
- os.reboot()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement