Advertisement
petethepossum

Report sk

Jul 10th, 2019
165
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 13.29 KB | None | 0 0
  1. options:
  2. debug: false
  3. codes: 0|1|2|3|4|5|6|7|8|9|a|b|c|d|e|f|k|l|m|n|o|r
  4.  
  5. function mcrremoveColor(msg: text) :: text:
  6. set {_m::*} to {_msg} split at ""
  7.  
  8. set {_color-codes} to "{@codes}"
  9. set {_colors::*} to {_color-codes} split at "|"
  10.  
  11. set {_new} to ""
  12.  
  13. loop {_m::*}:
  14. set {_char} to loop-value
  15. set {_prev} to the last character of {_new}
  16.  
  17. if {_prev} is "&":
  18.  
  19. loop {_colors::*}:
  20.  
  21. if loop-value-2 is {_char}:
  22. set {_skip} to true
  23.  
  24. if {_skip} is set:
  25. delete {_skip}
  26.  
  27. else:
  28. set {_new} to "%{_new}%%{_char}%"
  29.  
  30. return {_new}
  31.  
  32. function mcrjsonColorize(msg: text, default-color: text = "&r") :: text:
  33. set {_m::*} to {_msg} split at ""
  34.  
  35. set {_color-codes} to "{@codes}"
  36. set {_colors::*} to {_color-codes} split at "|"
  37.  
  38. set {_color} to colored {_default-color}
  39. set {_code} to the first character of {_color}
  40.  
  41. set {_new} to ""
  42. set {_skip} to 0
  43.  
  44. loop amount of {_m::*} times:
  45.  
  46. if {_skip} is more than or equal to 1:
  47. subtract 1 from {_skip}
  48.  
  49. else:
  50. set {_char} to {_m::%loop-number%}
  51. set {_next} to {_m::%loop-number + 1%}
  52.  
  53. if {@debug} is true:
  54. broadcast "&a[Character Check] &r%loop-number%: &7%{_char}% &r&onext: &8%{_next}% &r[%{_color}%color&r]"
  55.  
  56. if {_char} is "&" or {_code}:
  57.  
  58. if {@debug} is true:
  59. broadcast "&a[Color Check] &rFOUND: &o%{_char}%%{_next}% &7&m<--&7&o is it valid?"
  60.  
  61. loop {_colors::*}:
  62.  
  63. if loop-value-2 is {_next}:
  64. set {_color} to "%{_color}%%{_code}%%{_next}%"
  65.  
  66. if {_next} is "r":
  67. set {_color} to {_default-color}
  68.  
  69. set {_new} to "%{_new}%%{_color}%"
  70. set {_skip} to 1
  71.  
  72. if {_skip} is less than or equal to 0:
  73. set {_new} to "%{_new}%%{_char}%"
  74.  
  75. else if {_char} is " ":
  76. set {_new} to "%{_new}% %{_color}%"
  77.  
  78. else:
  79. set {_new} to "%{_new}%%{_char}%"
  80.  
  81. return {_new}
  82.  
  83. function mcrjsonSanitize(msg: text) :: text:
  84. if {@debug} is true:
  85. broadcast "&a[Sanitize] &7&oSanitizing input..."
  86.  
  87. set {_m::*} to {_msg} split at ""
  88.  
  89. loop {_m::*}:
  90.  
  91. if loop-value is """":
  92. set {_m::%loop-index%} to "\""" # """
  93.  
  94. else if loop-value is "\":
  95. set {_m::%loop-index%} to "\\"
  96.  
  97. set {_new} to join {_m::*} with ""
  98. return {_new}
  99.  
  100. function mcrjsonFormat(msg: text, color: boolean = true) :: text:
  101. set {_m::*} to {_msg} split at "||"
  102.  
  103. set {_current} to 1
  104.  
  105. loop {_m::*}:
  106. if {_clusters::%{_current}%} is not set:
  107. set {_clusters::%{_current}%} to ""
  108.  
  109. if {_clusters::%{_current}%::text} is not set:
  110. set {_clusters::%{_current}%::text} to mcrjsonSanitize(loop-value)
  111.  
  112. else:
  113. set {_tag} to the first 4 characters of loop-value
  114. set {_value} to subtext of loop-value from characters 5 to the length of loop-value
  115.  
  116. if {_tag} is "ttp:":
  117. set {_clusters::%{_current}%::tooltip} to mcrjsonSanitize({_value})
  118.  
  119. else if {_tag} is "cmd:":
  120. set {_clusters::%{_current}%::command} to mcrjsonSanitize({_value})
  121.  
  122. else if {_tag} is "sgt:":
  123. set {_clusters::%{_current}%::suggest} to mcrjsonSanitize({_value})
  124.  
  125. else if {_tag} is "url:":
  126.  
  127. if {_value} doesn't contain "http://" or "https://":
  128. set {_value} to "http://%{_value}%"
  129.  
  130. set {_clusters::%{_current}%::url} to mcrjsonSanitize({_value})
  131.  
  132. else if {_tag} is "ins:":
  133. set {_clusters::%{_current}%::insertion} to mcrjsonSanitize({_value})
  134.  
  135. else:
  136. add 1 to {_current}
  137. set {_clusters::%{_current}%::text} to mcrjsonSanitize(loop-value)
  138. set {_clusters::%{_current}%} to ""
  139.  
  140. if {@debug} is true:
  141. broadcast "&a[Tag Check] &3cluster:&b%{_current}% &8(&f&o%{_tag}%&8)"
  142.  
  143. loop {_clusters::*}:
  144.  
  145. if {@debug} is true:
  146. broadcast "&a[Cluster Check] &7&oCluster ##%loop-index% exists."
  147.  
  148. set {_i} to loop-index
  149.  
  150. set {_text} to {_clusters::%{_i}%::text}
  151.  
  152. if {_color} is true:
  153. set {_text} to mcrjsonColorize({_text})
  154.  
  155. if {_json} is not set:
  156. set {_json} to "{""text"":""%{_text}%"""
  157. else:
  158. set {_json} to "%{_json}%,{""text"":""%{_text}%"""
  159.  
  160. if {_clusters::%{_i}%::tooltip} is set:
  161.  
  162. if {_color} is true:
  163. set {_tooltip} to mcrjsonColorize({_clusters::%{_i}%::tooltip})
  164.  
  165. else:
  166. set {_tooltip} to {_clusters::%{_i}%::tooltip}
  167.  
  168. set {_json} to "%{_json}%,""hoverEvent"":{""action"": ""show_text"",""value"": ""%{_tooltip}%""}"
  169.  
  170. if {_clusters::%{_i}%::insertion} is set:
  171. set {_json} to "%{_json}%,""insertion"":""%{_clusters::%{_i}%::insertion}%"",""obfuscated"":false"
  172.  
  173. if {_clusters::%{_i}%::command} is set:
  174. set {_clickable} to "%{_json}%,""clickEvent"":{""action"":""run_command"",""value"":""%{_clusters::%{_i}%::command}%""}"
  175.  
  176. if {_clusters::%{_i}%::suggest} is set:
  177. set {_clickable} to "%{_json}%,""clickEvent"":{""action"": ""suggest_command"",""value"": ""%{_clusters::%{_i}%::suggest}%""}"
  178.  
  179. if {_clusters::%{_i}%::url} is set:
  180. set {_clickable} to "%{_json}%,""clickEvent"":{""action"": ""open_url"",""value"": ""%{_clusters::%{_i}%::url}%""}"
  181.  
  182. if {_clickable} is set:
  183. set {_json} to "%{_clickable}%}"
  184. delete {_clickable}
  185.  
  186. else:
  187. set {_json} to "%{_json}%}"
  188.  
  189. return "{""text"":"""", ""extra"":[%{_json}%]}"
  190.  
  191. function mcrjson(to: text, msg: text, color: boolean = true):
  192. set {_msg} to mcrjsonFormat({_msg}, {_color})
  193. execute console command "/tellraw %{_to}% %{_msg}%"
  194.  
  195. if {@debug} is true:
  196. set {_player} to {_to} parsed as offline player
  197. if {_player} is online:
  198. send uncolored {_msg} to {_player}
  199.  
  200. function mcrjsonBroadcast(msg: text, color: boolean = true):
  201. mcrjson("@a", {_msg}, {_color})
  202.  
  203.  
  204. function rawreport(arg1: player , arg2: player , arg3: text , arg4: text , arg5: text) :: string:
  205. if {_arg3} is "Hacking":
  206. set {daybloom.report.player.%{daybloom.report.id}%} to {_arg1}
  207. set {daybloom.report.reporter.%{daybloom.report.id}%} to {_arg2}
  208. set {daybloom.report.type.%{daybloom.report.id}%} to {_arg3}
  209. set {daybloom.report.server.%{daybloom.report.id}%} to {_arg4}
  210. set {daybloom.report.reason.%{daybloom.report.id}%} to {_arg5}
  211. set {daybloom.report.open.%{daybloom.report.id}%} to true
  212. send "&2Report ##%{daybloom.report.id}%> &aSuccessfully created report." to {_arg2}
  213. else if {_arg3} is "Chat-Abuse":
  214. set {daybloom.report.player.%{daybloom.report.id}%} to {_arg1}
  215. set {daybloom.report.reporter.%{daybloom.report.id}%} to {_arg2}
  216. set {daybloom.report.type.%{daybloom.report.id}%} to {_arg3}
  217. set {daybloom.report.server.%{daybloom.report.id}%} to {_arg4}
  218. set {daybloom.report.reason.%{daybloom.report.id}%} to {_arg5}
  219. set {daybloom.report.open.%{daybloom.report.id}%} to true
  220. send "&2Report ##%{daybloom.report.id}%> &aSuccessfully created report." to {_arg2}
  221. else if {_arg3} is "Gameplay":
  222. set {daybloom.report.player.%{daybloom.report.id}%} to {_arg1}
  223. set {daybloom.report.reporter.%{daybloom.report.id}%} to {_arg2}
  224. set {daybloom.report.type.%{daybloom.report.id}%} to {_arg3}
  225. set {daybloom.report.server.%{daybloom.report.id}%} to {_arg4}
  226. set {daybloom.report.reason.%{daybloom.report.id}%} to {_arg5}
  227. set {daybloom.report.open.%{daybloom.report.id}%} to true
  228. send "&2Report ##%{daybloom.report.id}%> &aSuccessfully created report." to {_arg2}
  229. else:
  230. stop
  231. loop all players:
  232. if loop-player has permission "Rank.Helper":
  233. if {daybloom.pref.report.%loop-player%} is true:
  234. send "&2[Report ##%{daybloom.report.id}%] &7%{_arg2}% has reported %{_arg1}% for a &e%{_arg3}% &7offence with reason &e%{_arg5}%&7!" to loop-player
  235. add 1 to {daybloom.report.id}
  236.  
  237. command /report [<offline player>] [<text>]:
  238. permission: Rank.default
  239. permission message: &2Report: &cThe report feature is currently in a trial phase for ALL any bugs report to server admins
  240. trigger:
  241. if arg-2 is set:
  242. if arg-1 is player:
  243. send "&2Report: &cYou cannot report yourself."
  244. stop
  245. open chest with 3 rows named "Report %arg-1%" to player
  246. 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)]
  247. 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)]
  248. 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)]
  249. else:
  250. send "&2Report: &cInvalid Usage: &e/report <player> <reason>"
  251.  
  252. command /reporthandle [<string>] [<string>]:
  253. aliases: /rh
  254. permission: Rank.Mod
  255. permission message: &aDaybloom: &eYou do not have the correct rank to use this command.
  256. trigger:
  257. if arg 1 is not set:
  258. send "&2Report: &7Corect Usage: &e/reporthandle <report id>"
  259. else:
  260. set {_id} to arg-1 parsed as a number
  261. if {_id} is a number:
  262. if {daybloom.report.open.%{_id}%} is true:
  263. if {daybloom.report.hand.%{_id}%} is not set:
  264. set {daybloom.report.hand.%{_id}%} to player
  265. set {_sus} to {daybloom.report.player.%{_id}%} parsed as an offline player
  266. set {_ip} to ip address of {_sus}
  267. loop {daybloom.totalaccounts.%{_ip}%::*}:
  268. add 1 to {_accounts}
  269. if {_accounts} is not set:
  270. set {_accounts} to 1
  271. send ""
  272. send "&2Report ##%{_id}%> &2Report Overview"
  273. send "&2Report ##%{_id}%> &2Suspect - &6%{daybloom.report.player.%{_id}%}%"
  274. send "&2Report ##%{_id}%> &2Type - &6%{daybloom.report.type.%{_id}%}%"
  275. send "&2Report ##%{_id}%> &2Team - &6None"
  276. send "&2Report ##%{_id}%>"
  277. send "&2Report ##%{_id}%>"
  278. send "&2Report ##%{_id}%> &7(1) &6%{daybloom.report.reporter.%{_id}%}% ##1 &7- ""&b%{daybloom.report.reason.%{_id}%}%&7"""
  279. send "&2Report ##%{_id}%>"
  280. send "&2Report ##%{_id}%> &bView chat log"
  281. mcrjson("%player%", "&2Report ##%{_id}%> ||&bClose this report||ttp:&bClick to close this report||cmd:/reportclose %{_id}% undetermined")
  282. loop all players:
  283. if loop-player has permission "Rank.Helper":
  284. if {daybloom.pref.report.%loop-player%} is true:
  285. send "&2[Report %{_id}%] &e%player% &7is handling this report." to loop-player
  286. else:
  287. send "&2Report: &7This report is already being handling!"
  288. else:
  289. send "&2Report: &7This report has already been closed or does not exsit!"
  290. else:
  291. send "&2Report: &cYour arguments are inappropriate for this command!"
  292. send "&2Report: &e/reporthandle (id)"
  293.  
  294. command /reportclose [<string>] [<string>] [<string>]:
  295. aliases: /rc
  296. permission: Rank.Mod
  297. permission message: &aDaybloom: &eYou do not have the correct rank to use this command.
  298. trigger:
  299. if arg 1 is not set:
  300. send "&2Report: &7Corect Usage: &e/reportclose (report id)"
  301. send "&2Report: &7Reasons: &eUNDETERMINED MUTED BANNED ABUSE"
  302. stop
  303. if arg 2 is not set:
  304. send "&2Report: &7Corect Usage: &e/reportclose (report id)"
  305. send "&2Report: &7Reasons: &eUNDETERMINED MUTED BANNED ABUSE"
  306. stop
  307. else:
  308. set {_id} to arg-1 parsed as a number
  309. if {daybloom.report.hand.%{_id}%} is not player:
  310. send "&2Report: &cYou can only close your own report!"
  311. stop
  312. if {_id} is a number:
  313. if {daybloom.report.open.%{_id}%} is true:
  314. if arg 2 is "UNDETERMINED":
  315. set {_r} to "&f&lCould not determine"
  316. set {daybloom.report.open.%{_id}%} to false
  317. loop all players:
  318. if loop-player has permission "Rank.Helper":
  319. if {daybloom.pref.report.%loop-player%} is true:
  320. send "&2[Report %{_id}%] &e%player% &7closed this report. (%{_r}%&7)." to loop-player
  321. else if arg 2 is "MUTED":
  322. set {_r} to "&e&lMuted"
  323. set {daybloom.report.open.%{_id}%} to false
  324. loop all players:
  325. if loop-player has permission "Rank.Helper":
  326. if {daybloom.pref.report.%loop-player%} is true:
  327. send "&2[Report %{_id}%] &e%player% &7closed this report. (%{_r}%&7)." to loop-player
  328. else if arg 2 is "BANNED":
  329. set {_r} to "&c&lBanned"
  330. set {daybloom.report.open.%{_id}%} to false
  331. loop all players:
  332. if loop-player has permission "Rank.Helper":
  333. if {daybloom.pref.report.%loop-player%} is true:
  334. send "&2[Report %{_id}%] &e%player% &7closed this report. (%{_r}%&7)." to loop-player
  335. else if arg 2 is "ABUSE":
  336. set {_r} to "&4&lAbuse of report system"
  337. set {daybloom.report.open.%{_id}%} to false
  338. loop all players:
  339. if loop-player has permission "Rank.Helper":
  340. if {daybloom.pref.report.%loop-player%} is true:
  341. send "&2[Report %{_id}%] &e%player% &7closed this report. (%{_r}%&7)." to loop-player
  342. else:
  343. send "&2Report: &cInvalid report reason!"
  344. else:
  345. send "&2Report: &7This report has already been closed or does not exsit!"
  346. else:
  347. send "&2Report: &cYour arguments are inappropriate for this command!"
  348. send "&2Report: &e/reportclose (report id) (reason)"
  349. send "&2Report: &7Reasons: &eUNDETERMINED, MUTED, BANNED. ABUSE"
  350.  
  351.  
  352. #WIP PREFS
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement