Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --INSERIRE QUI LA API-KEY
- emailMandata = 0
- ritardo = 120
- m = peripheral.wrap("top")
- while true do
- a, b, c, d = m.get(1)
- if d["amount"] < 6000000 then
- msg = "Alessandro Volta - Gasolio in esaurimento"
- else
- msg = null
- end
- if msg ~= null then
- msgf = string.gsub(msg, " ", "%%20")
- if emailMandata == 0 then
- emailMandata = 1
- http.get("http://172.16.20.220/luanet/servlets/ergb_diag.php?msg="..msgf)
- print("Email mandata: " .. msg)
- end
- end
- sleep(1)
- if emailMandata == 1 then
- ritardo = ritardo + 1
- end
- if ritardo == 120 then
- os.reboot()
- ritardo = 0
- emailMandata = 0
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment