# ------------------------------------------------------------------------------------- # # ▄████████ ▄████████ ████████▄ ▄██████▄ ███▄▄▄▄ ▄████████ ▄█ ▄█▄ # # ███ ███ ███ ███ ███ ▀███ ███ ███ ███▀▀▀██▄ ███ ███ ███ ▄███▀ # # ███ ███ ███ ███ ███ ███ ███ ███ ███ ███ ███ █▀ ███▐██▀ # # ▄███▄▄▄▄██▀ ███ ███ ███ ███ ███ ███ ███ ███ ███ ▄█████▀ # # ▀▀███▀▀▀▀▀ ▀███████████ ███ ███ ███ ███ ███ ███ ▀███████████ ▀▀█████▄ # # ▀███████████ ███ ███ ███ ███ ███ ███ ███ ███ ███ ███▐██▄ # # ███ ███ ███ ███ ███ ▄███ ███ ███ ███ ███ ▄█ ███ ███ ▀███▄ # # ███ ███ ███ █▀ ████████▀ ▀██████▀ ▀█ █▀ ▄████████▀ ███ ▀█▀ # # ███ ███ ▀ # # ------------------------------------------------------------------------------------- # # --------------------------------- [ Introduction ] ---------------------------------- # # Welcome to Radońsk, Radońsk is a vanilla Skript utility API which brings a lot of # extra functionality to skript that you couldn't previously get without addons. Weither # you are a skript aficionado or just a casual user you will find something that Radońsk # will help you with, specializing with advanced math caluclations, it also offers an # intuitive potion effects system as well as simple gamerule integration for changing # gamerules super easily, and an array of other utilities. # [ Copyrite ] # # Due to the fact that this is a skript, it means that you have full access to this # file and its contents. But I ask that you do not steal any code either in its entierty # or partially and repost it on SpigotMC or any other website or file storage location. # You may also not take any credit for this skript, or claim that you have developed this # code or part of it, unless you are bensku, then you claim the development of the platform # in which this skript was created within. Thankyou. # [ Additional Notes ] # # Here are the following noted related to this skript and its creation, this may # also be helpful for, any bug testing you may have to go through. # - Version of Skript used for development: 2.3.6 (published, March 3rd 2019) # - Version of minecraft tested: 1.13.2 (with ProtocolSupport) # - Code Editor: Visual Studio Code (version 1.33.1) # - Server File: Paper Spigot 1.13.2 (paperclip-624) # - Additional Plugins: ProtocolSupport (build 377) # [ Configuration ] # # This is SkRocket's configuration section, this includes where you can define # various settings / options for the execution and the running of the skript. Remain # careful when editing theese options. If you are unsure about any of the options, leave # them as their default to be safe. options: compatibility: 1.13 # (ℹ) - Certain aspects of this skript rely on console executed commands, type 1.13 for the 1.13 command system or 1.12 for the legacy command structure. hide effect particles: false # (ℹ) - Select wither or not you want to hide particles for Radońsk's built in potion effects system hashing meathod: SHA-256 # (ℹ) - You can choose what hashing meathod the hashString() function will use, you can use SHA-256 (reccomended) or MD5 version: 0.1 # ⚠ - Please don't change this, as it may interfere with any possible debug process(es) # ___ ___ _ _ # | \/ | | | | | # | . . | __ _| |_| |__ # | |\/| |/ _` | __| '_ \ # | | | | (_| | |_| | | | # \_| |_/\__,_|\__|_| |_| function mean(v: numbers) :: number: set {_values::*} to {_v::*} loop {_values::*}: add loop-value to {_total} return ({_total}/(size of {_values::*})) function mode(v: numbers) :: numbers: set {_values::*} to sorted {_v::*} loop {_values::*}: add 1 to {_ncount::%loop-value%} set {_max} to 0 set {_ncount::*} to sorted {_ncount::*} loop {_ncount::*}: loop-value > {_max} set {_maxv} to loop-index parsed as number set {_max} to loop-value loop {_ncount::*}: loop-value = {_max} add loop-index parsed as number to {_vs::*} return {_vs::*} function median(v: numbers) :: number: set {_values::*} to {_v::*} set {_mvar} to (size of {_values::*}/2) "%{_mvar}%" contains ".": add 0.5 to {_mvar} return {_values::%{_mvar}%} else: set {_m} to {_mvar}+1 set {_m1} to {_values::%{_m}%} set {_m2} to {_values::%{_mvar}%} return mean({_m2}, {_m1}) function range(v: numbers) :: number: set {_values::*} to sorted {_v::*} set {_size} to size of {_values::*} set {_r1} to {_values::%{_size}%} set {_r2} to {_values::1} return abs({_r1}-{_r2}) function mad(v: numbers) :: number: set {_mean} to mean({_v::*}) loop {_v::*}: add abs({_mean} - loop-value) to {_abs} return {_abs}/size of {_v::*} function inverse(n: number) :: number: return {_n}*-1 # _ _ _ _ _ _ _ # | | | | | (_) (_) | # | | | | |_ _| |_| |_ _ _ # | | | | __| | | | __| | | | # | |_| | |_| | | | |_| |_| | # \___/ \__|_|_|_|\__|\__, | # __/ | # |___/ function convertLowerCase(t: text) :: text: set {_upperc} to "A|B|C|D|E|F|G|H|I|J|K|L|M|N|O|P|Q|R|S|T|U|V|W|X|Y|Z" set {_lowerc} to "a|b|c|d|e|f|g|h|i|j|k|l|m|n|o|p|q|r|s|t|u|v|w|x|y|z" set {_upper::*} to {_upperc} split by "|" set {_lower::*} to {_lowerc} split by "|" set {_string} to {_t} loop {_lower::*}: set {_lc::%loop-value%} to loop-value loop {_upper::*}: replace all loop-value with {_lc::%loop-value%} in {_string} return {_string} function convertUpperCase(t: text) :: text: set {_upperc} to "A|B|C|D|E|F|G|H|I|J|K|L|M|N|O|P|Q|R|S|T|U|V|W|X|Y|Z" set {_lowerc} to "a|b|c|d|e|f|g|h|i|j|k|l|m|n|o|p|q|r|s|t|u|v|w|x|y|z" set {_upper::*} to {_upperc} split by "|" set {_lower::*} to {_lowerc} split by "|" set {_string} to {_t} loop {_upper::*}: set {_uc::%loop-value%} to loop-value loop {_lower::*}: replace all loop-value with {_uc::%loop-value%} in {_string} return {_string} function playerCount() :: integer: set {_count} to 0 loop all players: add 1 to {_count} return {_count} function onlinePlayers() :: players: loop all players: add loop-player to {_players::*} return {_players::*} function hashString(s: string) :: string: set {_s} to {_s} hashed with {@hashing meathod} return {_s} function skReload(t: text): console command "skript reload %{_t}%" function setWeather(w: world, a: weather type): set weather in {_w} to {_a} function str(o: object) :: text: return "%{_o}%" # _____ _ # | __ \ | | # | | \/ __ _ _ __ ___ ___ _ __ _ _| | ___ ___ # | | __ / _` | '_ ` _ \ / _ \ '__| | | | |/ _ \/ __| # | |_\ \ (_| | | | | | | __/ | | |_| | | __/\__ \ # \____/\__,_|_| |_| |_|\___|_| \__,_|_|\___||___/ function gamerule(t: text, v: object): console command "gamerule %{_t}% %{_v}%" # ______ _ _ __ __ _ # | ___ \ | | (_) / _|/ _| | | # | |_/ /__ | |_ _ ___ _ __ ___| |_| |_ ___ ___| |_ ___ # | __/ _ \| __| |/ _ \| '_ \ / _ \ _| _/ _ \/ __| __/ __| # | | | (_) | |_| | (_) | | | | | __/ | | || __/ (__| |_\__ \ # \_| \___/ \__|_|\___/|_| |_| \___|_| |_| \___|\___|\__|___/ function tempEffect(p: player, pe: potion effect, a: integer, ts: timespan): {_a} <= 255 {@hide effect particles} = true: apply {_pe} {_a} without particles to {_p} for {_ts} else: apply {_pe} {_a} to {_p} for {_ts} function permEffect(p: player, pe: potion effect, a: integer): {_a} <= 255 {@hide effect particles} = true: apply {_pe} {_a} without particles to {_p} for 1000000 seconds else: apply {_pe} {_a} to {_p} for 1000000 seconds function clearEffect(p: player, pe: potion effect): remove {_pe} from {_p} function clearAllEffects(p: player): {@compatibility} = 1.13: console command "minecraft:effect clear %{_p}%" {@compatibility} = 1.12: console command "minecraft:effect %{_p}% clear" # ______ _ _ _ _ _ # | ___ \ | (_) | | | | | | # | |_/ / |_ _ __ _ _ _ __ | |_| | ___ ___ | | _____ # | __/| | | | |/ _` | | '_ \ | _ |/ _ \ / _ \| |/ / __| # | | | | |_| | (_| | | | | | | | | | (_) | (_) | <\__ \ # \_| |_|\__,_|\__, |_|_| |_| \_| |_/\___/ \___/|_|\_\___/ # __/ | # |___/ # (ℹ) - Create your own menus (CYOM) integeration: https://dev.bukkit.org/projects/createyourownmenus function cyomOpen(m: text, p: player): console command "menu open %{_p}% %{_m}%" function cyomEdit(m: text, p: player): console command "menu edit %{_p}% %{_m}%" # (ℹ) - Mine reset lite (MRL) integeration: https://www.spigotmc.org/resources/mineresetlite.5773/ function mrlReset(mine: text): console command "mrl reset %{_mine}%"