Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- id = "a1"
- last_status = true
- print("Starting RFI Protection System by FoxWorn3365\n\nChannel: "..id)
- sleep(3)
- print("System started with success!")
- while true do
- local response = http.get("https://highcalc.fcosma.it/rfiblock/api/get?content=text&id=" .. id)
- local data = response.readAll()
- response.close()
- if data == "NOT_FOUND" then
- print("[ERROR] Id not found")
- elseif data == "FALSE" then
- if last_status then
- print("[INFO] Status changed to FALSE from TRUE")
- end
- last_status = false
- rs.setOutput("top", false)
- elseif data == "TRUE" then
- if last_status == false then
- print("[INFO] Status changed to TRUE from FALSE")
- end
- last_status = true
- rs.setOutput("top", true)
- else
- print("[ERROR] Invalid response:\n" .. data)
- end
- sleep(5)
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement