Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #Mojang_Server_Status_V2
- #By nfell2009
- options:
- P: &8[&aMSS&8]&a
- Check-Time: 60 #Must be in SECONDS!
- command /mojang-service-status [<text>] [<text>]:
- permission: mss.usage
- aliases: /mss,
- trigger:
- if arg 1 is not set:
- message "{@P} You must provide a sub-command"
- else if arg 1 is "down":
- if arg 2 is "broadcast":
- if player has permission "mss.admin":
- execute console command "/mss-console-check broadcast"
- else:
- message "{@P} You don't have permission to do that"
- else if arg 2 is "tell":
- execute console command "/mss-console-check tell %player%"
- else:
- message "{@P} Invalid arguments"
- else if arg 1 is "status":
- if arg 2 is "broadcast":
- if player has permission "mss.admin":
- execute console command "/mss-console-check broadcast-status"
- else if arg 2 is "tell":
- execute console command "/mss-console-check tell-status %player%"
- else:
- message "{@P} Invalid arguments"
- else:
- message "{@P} Invalid arguments"
- command /mss-console-check <text> [<text>]:
- executable by: console
- trigger:
- set {_check} to text from "http://status.mojang.com/check"
- replace all "green" in {_check} with "online"
- replace all "amber" in {_check} with "unstable"
- replace all "red" in {_check} with "offline"
- if arg 1 is "broadcast":
- set {_split::*} to {_check} split at ","
- loop {_split::*}:
- add 1 to {_num}
- replace all "[" and "]" and """" and "{", "}" in {_split::%{_num}%} with ""
- set {_line-split::*} to {_split::%{_num}%} split at ":"
- if {_line-split::2} is "offline":
- set {_mss.down} to true
- add "%{_line-split::1}%" to {_down-list::*}
- if {_mss.down} is true:
- broadcast "{@P} %{_down-list::*}% are currently down! This may affect trying to connect to the server and some gameplay features"
- else:
- broadcast "{@P} All Mojang services seem to be running fine"
- else if arg 1 is "tell":
- if arg 2 is set:
- set {_p} to arg 2 parsed as player
- set {_split::*} to {_check} split at ","
- loop {_split::*}:
- add 1 to {_num}
- replace all "[" and "]" and """" and "{", "}" in {_split::%{_num}%} with ""
- set {_line-split::*} to {_split::%{_num}%} split at ":"
- if {_line-split::2} is "offline":
- set {_mss.down} to true
- add "%{_line-split::1}%" to {_down-list::*}
- if {_mss.down} is true:
- send "{@P} %{_down-list::*}% are currently down! This may affect trying to connect to the server and some gameplay features" to {_p}
- else:
- send "{@P} All Mojang services seem to be running fine" to {_p}
- else if arg 1 is "broadcast-status":
- broadcast "{@P} Checking status..."
- set {_split::*} to {_check} split at ","
- loop {_split::*}:
- add 1 to {_num}
- replace all "[" and "]" and """" and "{", "}" in {_split::%{_num}%} with ""
- replace all ":" in {_split::%{_num}%} with " - "
- broadcast "{@P} %{_split::%{_num}%}%"
- else if arg 1 is "tell-status":
- set {_p} to arg 2 parsed as player
- send "{@P} Checking status..." to {_p}
- set {_split::*} to {_check} split at ","
- loop {_split::*}:
- add 1 to {_num}
- replace all "[" and "]" and """" and "{", "}" in {_split::%{_num}%} with ""
- replace all ":" in {_split::%{_num}%} with " - "
- send "{@P} %{_split::%{_num}%}%" to {_p}
- every {@Check-Time} seconds:
- execute console command "/mss-console-checks broadcast"
Advertisement
Add Comment
Please, Sign In to add comment