Advertisement
Gamebuster

Extreme weather notifier beta v0.0.6.1

Jun 28th, 2015
570
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.28 KB | None | 0 0
  1. options:
  2. state : OR
  3. county : Baker Valley
  4. #state is the initials of your state
  5. #county is the name of your county or city. Use common sense when setting this option. If you put "New York" instead of "New York County", it would trigger for any extreme weather in the state
  6.  
  7. on load:
  8. set {WarningTypes::*} to "Blizzard" and "Coastal Flood" and "Dust Storm" and "Flood" and "Winds" and "Hurricane" and "Thunderstorm" and "Severe Thunderstorm" and "Special Marine" and "Tropical Storm" and "Winter Storm" and "Avalanche" and "Civil Danger" and "Earthquake" and "Fire" and "Extreme Heat" and "Hazardous Materials" and "Nuclear Power Plant" and "Radiological Hazard" and "Shelter in Place" and "Volcano" and "Test" and "Red Flag"
  9. message "Registering the following warning types: %{WarningTypes::*}%" to the console
  10.  
  11. command /print:
  12. trigger:
  13. $ thread
  14. set {_warning} to text from url "http://www.nws.noaa.gov/view/prodsByState.php?state={@state}&prodtype=warnings##SVRCAE"
  15. set {_comparison} to {_warning}
  16. set {_irreleventText.beginning} to first index of "<pre>" in {_warning}
  17. set {_first} to the first {_irreleventText.beginning} characters of {_warning}
  18. replace all {_first} in {_comparison} with ""
  19. set {_irreleventText.end} to first index of "</pre>" in {_comparison}
  20. set {_comparison} to the first {_irreleventText.end} characters of {_comparison}
  21. replace all {_last} in {_comparison} with ""
  22. if {_comparison} contains "Warning":
  23. if {_comparison} contains "{@county}":
  24. if {_comparison} does not contain "cancelled":
  25. loop {WarningTypes::*}:
  26. if {_comparison} contains "%loop-value%":
  27. set {_type::%loop-value%} to "%loop-value%"
  28. if {_type::*} is not set:
  29. add "Other" to {_type::Other}
  30. if {_type::Fire} is set:
  31. if {_type::Red Flag} is set:
  32. remove {_type::Fire} from {_type::*}
  33. if {_type::thunderstorm} is set:
  34. if {_type::severe thunderstorm} is set:
  35. remove {_type::thunderstorm} from {_type::*}
  36. broadcast "<light red>YES - %{_type::*}%"
  37. else:
  38. message "<light green>NO - Warning cancelled"
  39. else:
  40. message "<light green>NO"
  41. else if {_warning} is not set:
  42. message "<red>404 Error, check URL."
  43. else:
  44. message "<light green>NO"
  45. #message "%{_comparison}%" to the console
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement