Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #
- #______ _ _
- #| ___ \ (_) | |
- #| |_/ /___ __ _ _ _ _ _ __ ___ _ __ ___ ___ _ __ | |_ ___
- #| // _ \/ _` | | | | | '__/ _ \ '_ ` _ \ / _ \ '_ \| __/ __|
- #| |\ \ __/ (_| | |_| | | | | __/ | | | | | __/ | | | |_\__ \
- #\_| \_\___|\__, |\__,_|_|_| \___|_| |_| |_|\___|_| |_|\__|___/
- # | |
- # |_|
- #
- #
- #REQUIRES:
- #Skript (https://github.com/SkriptLang/Skript/releases)
- #Skript TuSKe (https://skripttools.net/dl/TuSKe+1.8.3-PikachuPatch-v3.jar)
- # Tested on Paper Spigot 1.16.5
- #
- # _____ _ _ _
- #/ __ \ | (_) |
- #| / \/_ __ ___ __| |_| |_ ___
- #| | | '__/ _ \/ _` | | __/ __|
- #| \__/\ | | __/ (_| | | |_\__ \
- # \____/_| \___|\__,_|_|\__|___/
- #
- #
- #CREDITS:
- #
- #Made by CausedCornet365#0510
- #For help contact CausedCornet365#0510
- #Used part of AsuDev's pagtest gui system
- #
- #
- # ____ _ _
- # / __ \ | | (_)
- # | | | |_ __ | |_ _ ___ _ __ ___
- # | | | | '_ \| __| |/ _ \| '_ \/ __|
- # | |__| | |_) | |_| | (_) | | | \__ \
- # \____/| .__/ \__|_|\___/|_| |_|___/
- # | |
- # |_|
- options:
- #(9, 18, 27, 36, 45)
- #Example: guiSize: 9
- guiSize: 9
- #(Uses bukkit color codes [chatcodes] [https://htmlcolorcodes.com/bukkit-color-codes/])
- #(If there is no space between the text and prefix in messages add a space after the prefix)
- prefix: &b&l[MessageLogger]
- #(ONLY TOUCH THIS IF YOU RENAME THE SKRIPT)
- skriptname: ml
- #
- # _____ _ _
- # | __ \ (_) (_)
- # | |__) |__ _ __ _ __ ___ _ ___ ___ _ ___ _ __ ___
- # | ___/ _ \ '__| '_ ` _ \| / __/ __| |/ _ \| '_ \/ __|
- # | | | __/ | | | | | | | \__ \__ \ | (_) | | | \__ \
- # |_| \___|_| |_| |_| |_|_|___/___/_|\___/|_| |_|___/
- #
- #
- # "ml.*" - Allows access to all message logger commands
- # "ml.use" - Allows access to "/mlgui"
- # "ml.clear" - Allows access to "/mlclear"
- # "ml.reload" - Allows access to "/mlreload"
- #
- # _____ _
- # / ____| | |
- # | | ___ _ __ ___ _ __ ___ __ _ _ __ __| |___
- # | | / _ \| '_ ` _ \| '_ ` _ \ / _` | '_ \ / _` / __|
- # | |___| (_) | | | | | | | | | | | (_| | | | | (_| \__ \
- # \_____\___/|_| |_| |_|_| |_| |_|\__,_|_| |_|\__,_|___/
- #
- # "/mlgui (player)" - See a player's messages
- # "/mlclear (player)" - Clear a player's messages
- # "/mlreload" - Reload the skript (Any errors will appear in console)
- #
- # _____ _
- #/ __ \ | |
- #| / \/ ___ __| | ___
- #| | / _ \ / _` |/ _ \
- #| \__/\ (_) | (_| | __/
- # \____/\___/ \__,_|\___|
- #
- #
- command /mldebug <text>:
- permission: ml.use
- trigger:
- if arg-1 is set:
- add arg-1 to {messages::%player's uuid%::*}
- send "{@prefix} &bDebugged with &b""%arg-1%&b""" to player
- on chat:
- add message to {messages::%player's uuid%::*}
- # Function that returns true or false based on if the player can open a specific page
- function checkForSpecifiedPage(slot: number, guiSize: number, list: objects) :: boolean:
- set {_counter} and {_format} to 0
- loop {_list::*}:
- if {_counter}+1 is between {_slot} and {_slot}+({_guiSize}-1):
- add 1 to {_format}
- add 1 to {_counter}
- if {_format} is 0:
- return false
- else:
- return true
- #
- command /mlclear <offline player>:
- permission: ml.clear or ml.*
- permission message: {@prefix} &bYou do not have permission to do this!
- trigger:
- if arg-1 isn't set:
- send "{@prefix} &b&lplease specify a player" to player
- else:
- clear {messages::%arg-1's uuid%::*}
- send "{@prefix} &b&lcleared %arg-1%&b&l's messages" to player
- on load:
- if {reload} is true:
- set {reload} to false
- send "{@prefix} &breloaded!" to {reloader}
- send "&7(Any errors will appear in console)" to {reloader}
- delete {reloader}
- command /mlreload:
- permission: ml.reload or ml.*
- permission message: {@prefix} &bYou do not have permission to do this!
- trigger:
- if executor is not console:
- set {reload} to true
- set {reloader} to player
- execute console command "sk reload {@skriptname}.sk"
- else:
- send "{@prefix} &b&lThis cannot be executed by console!" to console
- command /mlgui <offline player> [<integer=1>]:
- permission: ml.use or ml.*
- permission message: {@prefix} &bYou do not have permission to do this!
- trigger:
- set {argg} to arg-1
- set {_a} to arg-2
- set {_pr} to {_a} - 1
- set {_next} to {_a} + 1
- # Make sure to block anhything below 0 as a page
- if arg 2 is less than or equal to 0:
- message "&c0 &7is not a valid page."
- execute player command "/mlgui %arg-1% 1"
- stop
- # Example size of the inventory / Must be divisible by 9 and up to 53
- # In the example I am using, I cannot use 53 size because I am going to
- # dedicate 1 row for the page switchers, therefore the max size in this
- # example can only be 45
- set {_guiSize} to {@guiSize}
- # List to use as an example for the GUI
- set {_c} to 0
- loop {messages::%arg-1's uuid%::*}:
- add 1 of paper named "%loop-value%" with lore "&bClick to view" to {_list::*}
- add 1 to {_c}
- # Gets the slot to start at on specified page
- set {_slot} to ((arg 2 * {_guiSize}) + 1) - {_guiSize}
- # Checks if the specified page has anything in it / Gets how many available pages there are
- if checkForSpecifiedPage({_slot}, {_guiSize}, {_list::*}) is false:
- set {_availablePages} to ceil(size of {_list::*}/{_guiSize})
- message "&7Invalid page. &7You have &c%{_availablePages}% &7available pages."
- stop
- # Open the Gui to the player / I used +1 because I want a row dedicated for the page turners
- open virtual chest inventory with size ({_guiSize}/9) + 1 named "&9&l%{argg}% &8&l| &8Page %arg 2%" to player
- # Example buttons to switch to different pages / The last row in this case is dedicated to these
- format gui slot {_guiSize}+2 of player with feather named "&c&l<- PREVIOUS PAGE&r" to close then run player command "/mlgui %{argg}% %{_pr}%"
- format gui slot {_guiSize}+6 of player with feather named "&a&lNEXT PAGE ->&r" to close then run player command "/mlgui %{argg}% %{_next}%"
- # Formats the gui
- set {_counter} and {_format} to 0
- loop {_list::*}:
- set {_text} to loop-value's name
- if {_counter}+1 is between {_slot} and {_slot}+({_guiSize}-1):
- format gui slot {_format} of player with loop-value to run:
- send "{@prefix} &b&l%{argg}% - &b""&b%{_text}%&b""" to player
- close player's inventory
- add 1 to {_format}
- add 1 to {_counter}
- # ______ ______ ______ ______ ______ ______ ______ ______ ______ ______ ______ ______ ______ ______ ______ ______
- # |______|______|______|______|______|______|______|______|______|______|______|______|______|______|______|______|
- # ______ ______ ______ ______ ______ ______ ______ ______ ______ ______ ______ ______ ______ ______ ______ ______
- # |______|______|______|______|______|______|______|______|______|______|______|______|______|______|______|______|
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement