Advertisement
Gamebuster

Extreme weather notifier beta v0.0.5.4

Jun 27th, 2015
621
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.00 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 "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. add loop-value to {_type::*}
  28. if {_type::*} is not set:
  29. add "Other" to {_type::*}
  30. broadcast "<light red>YES - %{_type::*}%"
  31. else:
  32. message "<light green>NO - Warning cancelled"
  33. else:
  34. message "<light green>NO"
  35. else if {_warning} is not set:
  36. message "<red>404 Error, check URL."
  37. else:
  38. message "<light green>NO"
  39. #message "%{_comparison}%" to the console
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement