Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- options:
- debug: false
- codes: 0|1|2|3|4|5|6|7|8|9|a|b|c|d|e|f|k|l|m|n|o|r
- function mcrremoveColor(msg: text) :: text:
- set {_m::*} to {_msg} split at ""
- set {_color-codes} to "{@codes}"
- set {_colors::*} to {_color-codes} split at "|"
- set {_new} to ""
- loop {_m::*}:
- set {_char} to loop-value
- set {_prev} to the last character of {_new}
- if {_prev} is "&":
- loop {_colors::*}:
- if loop-value-2 is {_char}:
- set {_skip} to true
- if {_skip} is set:
- delete {_skip}
- else:
- set {_new} to "%{_new}%%{_char}%"
- return {_new}
- function mcrjsonColorize(msg: text, default-color: text = "&r") :: text:
- set {_m::*} to {_msg} split at ""
- set {_color-codes} to "{@codes}"
- set {_colors::*} to {_color-codes} split at "|"
- set {_color} to colored {_default-color}
- set {_code} to the first character of {_color}
- set {_new} to ""
- set {_skip} to 0
- loop amount of {_m::*} times:
- if {_skip} is more than or equal to 1:
- subtract 1 from {_skip}
- else:
- set {_char} to {_m::%loop-number%}
- set {_next} to {_m::%loop-number + 1%}
- if {@debug} is true:
- broadcast "&a[Character Check] &r%loop-number%: &7%{_char}% &r&onext: &8%{_next}% &r[%{_color}%color&r]"
- if {_char} is "&" or {_code}:
- if {@debug} is true:
- broadcast "&a[Color Check] &rFOUND: &o%{_char}%%{_next}% &7&m<--&7&o is it valid?"
- loop {_colors::*}:
- if loop-value-2 is {_next}:
- set {_color} to "%{_color}%%{_code}%%{_next}%"
- if {_next} is "r":
- set {_color} to {_default-color}
- set {_new} to "%{_new}%%{_color}%"
- set {_skip} to 1
- if {_skip} is less than or equal to 0:
- set {_new} to "%{_new}%%{_char}%"
- else if {_char} is " ":
- set {_new} to "%{_new}% %{_color}%"
- else:
- set {_new} to "%{_new}%%{_char}%"
- return {_new}
- function mcrjsonSanitize(msg: text) :: text:
- if {@debug} is true:
- broadcast "&a[Sanitize] &7&oSanitizing input..."
- set {_m::*} to {_msg} split at ""
- loop {_m::*}:
- if loop-value is """":
- set {_m::%loop-index%} to "\""" # """
- else if loop-value is "\":
- set {_m::%loop-index%} to "\\"
- set {_new} to join {_m::*} with ""
- return {_new}
- function mcrjsonFormat(msg: text, color: boolean = true) :: text:
- set {_m::*} to {_msg} split at "||"
- set {_current} to 1
- loop {_m::*}:
- if {_clusters::%{_current}%} is not set:
- set {_clusters::%{_current}%} to ""
- if {_clusters::%{_current}%::text} is not set:
- set {_clusters::%{_current}%::text} to mcrjsonSanitize(loop-value)
- else:
- set {_tag} to the first 4 characters of loop-value
- set {_value} to subtext of loop-value from characters 5 to the length of loop-value
- if {_tag} is "ttp:":
- set {_clusters::%{_current}%::tooltip} to mcrjsonSanitize({_value})
- else if {_tag} is "cmd:":
- set {_clusters::%{_current}%::command} to mcrjsonSanitize({_value})
- else if {_tag} is "sgt:":
- set {_clusters::%{_current}%::suggest} to mcrjsonSanitize({_value})
- else if {_tag} is "url:":
- if {_value} doesn't contain "http://" or "https://":
- set {_value} to "http://%{_value}%"
- set {_clusters::%{_current}%::url} to mcrjsonSanitize({_value})
- else if {_tag} is "ins:":
- set {_clusters::%{_current}%::insertion} to mcrjsonSanitize({_value})
- else:
- add 1 to {_current}
- set {_clusters::%{_current}%::text} to mcrjsonSanitize(loop-value)
- set {_clusters::%{_current}%} to ""
- if {@debug} is true:
- broadcast "&a[Tag Check] &3cluster:&b%{_current}% &8(&f&o%{_tag}%&8)"
- loop {_clusters::*}:
- if {@debug} is true:
- broadcast "&a[Cluster Check] &7&oCluster ##%loop-index% exists."
- set {_i} to loop-index
- set {_text} to {_clusters::%{_i}%::text}
- if {_color} is true:
- set {_text} to mcrjsonColorize({_text})
- if {_json} is not set:
- set {_json} to "{""text"":""%{_text}%"""
- else:
- set {_json} to "%{_json}%,{""text"":""%{_text}%"""
- if {_clusters::%{_i}%::tooltip} is set:
- if {_color} is true:
- set {_tooltip} to mcrjsonColorize({_clusters::%{_i}%::tooltip})
- else:
- set {_tooltip} to {_clusters::%{_i}%::tooltip}
- set {_json} to "%{_json}%,""hoverEvent"":{""action"": ""show_text"",""value"": ""%{_tooltip}%""}"
- if {_clusters::%{_i}%::insertion} is set:
- set {_json} to "%{_json}%,""insertion"":""%{_clusters::%{_i}%::insertion}%"",""obfuscated"":false"
- if {_clusters::%{_i}%::command} is set:
- set {_clickable} to "%{_json}%,""clickEvent"":{""action"":""run_command"",""value"":""%{_clusters::%{_i}%::command}%""}"
- if {_clusters::%{_i}%::suggest} is set:
- set {_clickable} to "%{_json}%,""clickEvent"":{""action"": ""suggest_command"",""value"": ""%{_clusters::%{_i}%::suggest}%""}"
- if {_clusters::%{_i}%::url} is set:
- set {_clickable} to "%{_json}%,""clickEvent"":{""action"": ""open_url"",""value"": ""%{_clusters::%{_i}%::url}%""}"
- if {_clickable} is set:
- set {_json} to "%{_clickable}%}"
- delete {_clickable}
- else:
- set {_json} to "%{_json}%}"
- return "{""text"":"""", ""extra"":[%{_json}%]}"
- function mcrjson(to: text, msg: text, color: boolean = true):
- set {_msg} to mcrjsonFormat({_msg}, {_color})
- execute console command "/tellraw %{_to}% %{_msg}%"
- if {@debug} is true:
- set {_player} to {_to} parsed as offline player
- if {_player} is online:
- send uncolored {_msg} to {_player}
- function mcrjsonBroadcast(msg: text, color: boolean = true):
- mcrjson("@a", {_msg}, {_color})
- function rawreport(arg1: player , arg2: player , arg3: text , arg4: text , arg5: text) :: string:
- if {_arg3} is "Hacking":
- set {daybloom.report.player.%{daybloom.report.id}%} to {_arg1}
- set {daybloom.report.reporter.%{daybloom.report.id}%} to {_arg2}
- set {daybloom.report.type.%{daybloom.report.id}%} to {_arg3}
- set {daybloom.report.server.%{daybloom.report.id}%} to {_arg4}
- set {daybloom.report.reason.%{daybloom.report.id}%} to {_arg5}
- set {daybloom.report.open.%{daybloom.report.id}%} to true
- send "&2Report ##%{daybloom.report.id}%> &aSuccessfully created report." to {_arg2}
- else if {_arg3} is "Chat-Abuse":
- set {daybloom.report.player.%{daybloom.report.id}%} to {_arg1}
- set {daybloom.report.reporter.%{daybloom.report.id}%} to {_arg2}
- set {daybloom.report.type.%{daybloom.report.id}%} to {_arg3}
- set {daybloom.report.server.%{daybloom.report.id}%} to {_arg4}
- set {daybloom.report.reason.%{daybloom.report.id}%} to {_arg5}
- set {daybloom.report.open.%{daybloom.report.id}%} to true
- send "&2Report ##%{daybloom.report.id}%> &aSuccessfully created report." to {_arg2}
- else if {_arg3} is "Gameplay":
- set {daybloom.report.player.%{daybloom.report.id}%} to {_arg1}
- set {daybloom.report.reporter.%{daybloom.report.id}%} to {_arg2}
- set {daybloom.report.type.%{daybloom.report.id}%} to {_arg3}
- set {daybloom.report.server.%{daybloom.report.id}%} to {_arg4}
- set {daybloom.report.reason.%{daybloom.report.id}%} to {_arg5}
- set {daybloom.report.open.%{daybloom.report.id}%} to true
- send "&2Report ##%{daybloom.report.id}%> &aSuccessfully created report." to {_arg2}
- else:
- stop
- loop all players:
- if loop-player has permission "Rank.Helper":
- if {daybloom.pref.report.%loop-player%} is true:
- send "&2[Report ##%{daybloom.report.id}%] &7%{_arg2}% has reported %{_arg1}% for a &e%{_arg3}% &7offence with reason &e%{_arg5}%&7!" to loop-player
- add 1 to {daybloom.report.id}
- command /report [<offline player>] [<text>]:
- permission: Rank.default
- permission message: &2Report: &cThe report feature is currently in a trial phase for ALL any bugs report to server admins
- trigger:
- if arg-2 is set:
- if arg-1 is player:
- send "&2Report: &cYou cannot report yourself."
- stop
- open chest with 3 rows named "Report %arg-1%" to player
- format slot 11 of player with red dye named "&c&lHacking" with lore "&7X-ray, Forcefield, Speed, Fly etc" to close then run [send "&2Report ##%{daybloom.report.id}%> &aSuccessfully created report." to player]->[rawreport(arg-1, player, "Hacking", "%player's world%", arg-2)]
- format slot 13 of player with yellow dye named "&e&lChat Abuse" with lore "&7Verbal Abuse, Spam, Harassment, Trolling, etc" to close then run [send "&2Report ##%{daybloom.report.id}%> &aSuccessfully created report." to player]->[rawreport(arg-1, player, "Chat-Abuse", "%player's world%", arg-2)]
- format slot 15 of player with green dye named "&a&lGameplay" with lore "&7Map and Bug Exploits" to close then run [send "&2Report ##%{daybloom.report.id}%> &aSuccessfully created report." to player]->[rawreport(arg-1, player, "Gameplay", "%player's world%", arg-2)]
- else:
- send "&2Report: &cInvalid Usage: &e/report <player> <reason>"
- command /reporthandle [<string>] [<string>]:
- aliases: /rh
- permission: Rank.Mod
- permission message: &aDaybloom: &eYou do not have the correct rank to use this command.
- trigger:
- if arg 1 is not set:
- send "&2Report: &7Corect Usage: &e/reporthandle <report id>"
- else:
- set {_id} to arg-1 parsed as a number
- if {_id} is a number:
- if {daybloom.report.open.%{_id}%} is true:
- if {daybloom.report.hand.%{_id}%} is not set:
- set {daybloom.report.hand.%{_id}%} to player
- set {_sus} to {daybloom.report.player.%{_id}%} parsed as an offline player
- set {_ip} to ip address of {_sus}
- loop {daybloom.totalaccounts.%{_ip}%::*}:
- add 1 to {_accounts}
- if {_accounts} is not set:
- set {_accounts} to 1
- send ""
- send "&2Report ##%{_id}%> &2Report Overview"
- send "&2Report ##%{_id}%> &2Suspect - &6%{daybloom.report.player.%{_id}%}%"
- send "&2Report ##%{_id}%> &2Type - &6%{daybloom.report.type.%{_id}%}%"
- send "&2Report ##%{_id}%> &2Team - &6None"
- send "&2Report ##%{_id}%>"
- send "&2Report ##%{_id}%>"
- send "&2Report ##%{_id}%> &7(1) &6%{daybloom.report.reporter.%{_id}%}% ##1 &7- ""&b%{daybloom.report.reason.%{_id}%}%&7"""
- send "&2Report ##%{_id}%>"
- send "&2Report ##%{_id}%> &bView chat log"
- mcrjson("%player%", "&2Report ##%{_id}%> ||&bClose this report||ttp:&bClick to close this report||cmd:/reportclose %{_id}% undetermined")
- loop all players:
- if loop-player has permission "Rank.Helper":
- if {daybloom.pref.report.%loop-player%} is true:
- send "&2[Report %{_id}%] &e%player% &7is handling this report." to loop-player
- else:
- send "&2Report: &7This report is already being handling!"
- else:
- send "&2Report: &7This report has already been closed or does not exsit!"
- else:
- send "&2Report: &cYour arguments are inappropriate for this command!"
- send "&2Report: &e/reporthandle (id)"
- command /reportclose [<string>] [<string>] [<string>]:
- aliases: /rc
- permission: Rank.Mod
- permission message: &aDaybloom: &eYou do not have the correct rank to use this command.
- trigger:
- if arg 1 is not set:
- send "&2Report: &7Corect Usage: &e/reportclose (report id)"
- send "&2Report: &7Reasons: &eUNDETERMINED MUTED BANNED ABUSE"
- stop
- if arg 2 is not set:
- send "&2Report: &7Corect Usage: &e/reportclose (report id)"
- send "&2Report: &7Reasons: &eUNDETERMINED MUTED BANNED ABUSE"
- stop
- else:
- set {_id} to arg-1 parsed as a number
- if {daybloom.report.hand.%{_id}%} is not player:
- send "&2Report: &cYou can only close your own report!"
- stop
- if {_id} is a number:
- if {daybloom.report.open.%{_id}%} is true:
- if arg 2 is "UNDETERMINED":
- set {_r} to "&f&lCould not determine"
- set {daybloom.report.open.%{_id}%} to false
- loop all players:
- if loop-player has permission "Rank.Helper":
- if {daybloom.pref.report.%loop-player%} is true:
- send "&2[Report %{_id}%] &e%player% &7closed this report. (%{_r}%&7)." to loop-player
- else if arg 2 is "MUTED":
- set {_r} to "&e&lMuted"
- set {daybloom.report.open.%{_id}%} to false
- loop all players:
- if loop-player has permission "Rank.Helper":
- if {daybloom.pref.report.%loop-player%} is true:
- send "&2[Report %{_id}%] &e%player% &7closed this report. (%{_r}%&7)." to loop-player
- else if arg 2 is "BANNED":
- set {_r} to "&c&lBanned"
- set {daybloom.report.open.%{_id}%} to false
- loop all players:
- if loop-player has permission "Rank.Helper":
- if {daybloom.pref.report.%loop-player%} is true:
- send "&2[Report %{_id}%] &e%player% &7closed this report. (%{_r}%&7)." to loop-player
- else if arg 2 is "ABUSE":
- set {_r} to "&4&lAbuse of report system"
- set {daybloom.report.open.%{_id}%} to false
- loop all players:
- if loop-player has permission "Rank.Helper":
- if {daybloom.pref.report.%loop-player%} is true:
- send "&2[Report %{_id}%] &e%player% &7closed this report. (%{_r}%&7)." to loop-player
- else:
- send "&2Report: &cInvalid report reason!"
- else:
- send "&2Report: &7This report has already been closed or does not exsit!"
- else:
- send "&2Report: &cYour arguments are inappropriate for this command!"
- send "&2Report: &e/reportclose (report id) (reason)"
- send "&2Report: &7Reasons: &eUNDETERMINED, MUTED, BANNED. ABUSE"
- #WIP PREFS
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement