Advertisement
FoxWorn3365

RFI Blocker

Jan 6th, 2024 (edited)
19
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.79 KB | None | 0 0
  1. id = "a1"
  2. last_status = true
  3.  
  4. print("Starting RFI Protection System by FoxWorn3365\n\nChannel: "..id)
  5.  
  6. sleep(3)
  7.  
  8. print("System started with success!")
  9.  
  10. while true do
  11. local response = http.get("https://highcalc.fcosma.it/rfiblock/api/get?content=text&id=" .. id)
  12. local data = response.readAll()
  13. response.close()
  14. if data == "NOT_FOUND" then
  15. print("[ERROR] Id not found")
  16. elseif data == "FALSE" then
  17. if last_status then
  18. print("[INFO] Status changed to FALSE from TRUE")
  19. end
  20. last_status = false
  21. rs.setOutput("top", false)
  22. elseif data == "TRUE" then
  23. if last_status == false then
  24. print("[INFO] Status changed to TRUE from FALSE")
  25. end
  26. last_status = true
  27. rs.setOutput("top", true)
  28. else
  29. print("[ERROR] Invalid response:\n" .. data)
  30. end
  31. sleep(5)
  32. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement