nfell2009

Mojang Service Status [MSS] - V1.0

Jul 30th, 2014
1,647
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
YAML 3.37 KB | None | 0 0
  1. #Mojang_Server_Status_V2
  2. #By nfell2009
  3.  
  4. options:
  5.     P: &8[&aMSS&8]&a
  6.     Check-Time: 60 #Must be in SECONDS!
  7.  
  8. command /mojang-service-status [<text>] [<text>]:
  9.     permission: mss.usage
  10.     aliases: /mss,
  11.     trigger:
  12.         if arg 1 is not set:
  13.             message "{@P} You must provide a sub-command"
  14.         else if arg 1 is "down":
  15.             if arg 2 is "broadcast":
  16.                 if player has permission "mss.admin":
  17.                     execute console command "/mss-console-check broadcast"
  18.                 else:
  19.                     message "{@P} You don't have permission to do that"
  20.             else if arg 2 is "tell":
  21.                 execute console command "/mss-console-check tell %player%"
  22.             else:
  23.                 message "{@P} Invalid arguments"
  24.         else if arg 1 is "status":
  25.             if arg 2 is "broadcast":
  26.                 if player has permission "mss.admin":
  27.                     execute console command "/mss-console-check broadcast-status"
  28.             else if arg 2 is "tell":
  29.                 execute console command "/mss-console-check tell-status %player%"
  30.             else:
  31.                 message "{@P} Invalid arguments"
  32.         else:
  33.             message "{@P} Invalid arguments"
  34.  
  35.  
  36. command /mss-console-check <text> [<text>]:
  37.     executable by: console
  38.     trigger:
  39.         set {_check} to text from "http://status.mojang.com/check"
  40.         replace all "green" in {_check} with "online"
  41.         replace all "amber" in {_check} with "unstable"
  42.         replace all "red" in {_check} with "offline"
  43.         if arg 1 is "broadcast":
  44.             set {_split::*} to {_check} split at ","
  45.             loop {_split::*}:
  46.                 add 1 to {_num}
  47.                 replace all "[" and "]" and """" and "{", "}" in {_split::%{_num}%} with ""
  48.                 set {_line-split::*} to {_split::%{_num}%} split at ":"
  49.                 if {_line-split::2} is "offline":
  50.                     set {_mss.down} to true
  51.                     add "%{_line-split::1}%" to {_down-list::*}
  52.             if {_mss.down} is true:
  53.                 broadcast "{@P} %{_down-list::*}% are currently down! This may affect trying to connect to the server and some gameplay features"
  54.             else:
  55.                 broadcast "{@P} All Mojang services seem to be running fine"
  56.         else if arg 1 is "tell":
  57.             if arg 2 is set:
  58.                 set {_p} to arg 2 parsed as player
  59.                 set {_split::*} to {_check} split at ","
  60.                 loop {_split::*}:
  61.                     add 1 to {_num}
  62.                     replace all "[" and "]" and """" and "{", "}" in {_split::%{_num}%} with ""
  63.                     set {_line-split::*} to {_split::%{_num}%} split at ":"
  64.                     if {_line-split::2} is "offline":
  65.                         set {_mss.down} to true
  66.                         add "%{_line-split::1}%" to {_down-list::*}
  67.                 if {_mss.down} is true:
  68.                     send "{@P} %{_down-list::*}% are currently down! This may affect trying to connect to the server and some gameplay features" to {_p}
  69.                 else:
  70.                     send "{@P} All Mojang services seem to be running fine" to {_p}
  71.         else if arg 1 is "broadcast-status":
  72.             broadcast "{@P} Checking status..."
  73.             set {_split::*} to {_check} split at ","
  74.             loop {_split::*}:
  75.                 add 1 to {_num}
  76.                 replace all "[" and "]" and """" and "{", "}" in {_split::%{_num}%} with ""
  77.                 replace all ":" in {_split::%{_num}%} with " - "
  78.                 broadcast "{@P} %{_split::%{_num}%}%"
  79.         else if arg 1 is "tell-status":
  80.             set {_p} to arg 2 parsed as player
  81.             send "{@P} Checking status..." to {_p}
  82.             set {_split::*} to {_check} split at ","
  83.             loop {_split::*}:
  84.                 add 1 to {_num}
  85.                 replace all "[" and "]" and """" and "{", "}" in {_split::%{_num}%} with ""
  86.                 replace all ":" in {_split::%{_num}%} with " - "
  87.                 send "{@P} %{_split::%{_num}%}%" to {_p}
  88.            
  89.  
  90. every {@Check-Time} seconds:
  91.     execute console command "/mss-console-checks broadcast"
Advertisement
Add Comment
Please, Sign In to add comment