Guest User

startup

a guest
Jul 5th, 2020
113
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.66 KB | None | 0 0
  1. shuntA = peripheral.wrap("top")
  2. shuntB = peripheral.wrap("left")
  3. url = "http://rest.rgbcraft.com/corrente/dati.php?nome1="
  4. suffisso = ""
  5. for i=1,9 do
  6. sleep(0.5)
  7. uuid, st, nome, tabella = shuntA.get(i)
  8. h = i+1
  9. suffisso = suffisso..nome.."&potenza"..i.."="..tabella.average.."&nome"..h.."="
  10. print("Shunt A"..i)
  11. end
  12. for i=10,14 do
  13. sleep(0.5)
  14. uuid, st, nome, tabella = shuntB.get(i-9)
  15. h = i+1
  16. suffisso = suffisso..nome.."&potenza"..i.."="..tabella.average.."&nome"..h.."="
  17. print("Shunt B"..i)
  18. end
  19.  
  20. rest = http.get(url..suffisso)
  21. write(rest.readAll())
  22. rest.close()
  23. for j=5,1,-1 do
  24. term.setCursorPos(1, 15)
  25. print("CD: "..j.."   ")
  26. sleep(1)
  27. end
  28. os.reboot()
Advertisement
Add Comment
Please, Sign In to add comment