Notepad.sk

Created by FusionCore

Other available versions. Ordered by newest to oldest versions:

Just so you know, we don't know the file format for every file. If it's just a bunch of random characters, it's probably a .zip or .jar.

options:
	developer-key: "3x0SPZm7q5vMe6gtBXLJYzCeoiozTolE" # Set this to give players access to the pastebin features!
	line-limit: 100 # Set the line limit for notes.

on join:
	if {Notepad::Users::%player's uuid%::color-1} is not set:
		# THEME
		set {Notepad::Users::%player's uuid%::color-1} to "&a"
		set {Notepad::Users::%player's uuid%::color-2} to "&7"
		set {Notepad::Users::%player's uuid%::color-3} to "&f"

		# Files

		set {_file-id} to createFile(player, "Note")
		set {Notepad::Users::%player's uuid%::file} to {_file-id}

		# Notepad

	set {Notepad::Users::%player's uuid%::toggle} to false

on quit:
	set {Notepad::Users::%player's uuid%::toggle} to false

on load:
	set {Cherry::Blank} to newline
	loop 100 times:
		set {Cherry::blank} to "%{Cherry::Blank}%%newline%"

command /notepad [<text>]:
	aliases: /notes
	permission: skript.notepad.use
	permission message: &cYou do not have the required permission.
	trigger:
		set {_color-1} to {Notepad::Users::%player's uuid%::color-1}
		set {_color-2} to {Notepad::Users::%player's uuid%::color-2}
		set {_color-3} to {Notepad::Users::%player's uuid%::color-3}
		if sender is console:
			if arg-1 is set:
				set {_arg::*} to arg-1 split at " "
				if size of {_arg::*} is more than 3:
					if "%{_arg::1}% %{_arg::2}%" is "Skript add":
						if {_arg::3} parsed as an offline player is an offline player:
							set {_p} to {_arg::3} parsed as an offline player
							if {_p} is online:
								delete {_arg::1}, {_arg::2} and {_arg::3}
								set {_dir} to join {_arg::*} with " "
								if file path {_dir} is not missing:
									if file path {_dir} is a file:
										set {_ext} to extension of file path {_dir}
										if {_ext} is "sk" or "txt":
											set {_id} to createFile({_p}, file name of file path {_dir})
											set {Notepad::Files::%{_id}%::type} to "Skript"
											set {Notepad::Files::%{_id}%::dir} to {_dir}
											set {Notepad::Files::%{_id}%::lines::*} to all lines of file path {_dir}
											send "&aNotepad &fAdded %file name of file path {_dir}% to %{_p}%%newline%ID: %{_id}%" to sender
										else:
											send "&aNotepad &fYou can only add files that are .sk or .txt." to sender
									else:
										send "&aNotepad &fYou can only add files to a player's notes." to sender
								else:
									send "&aNotepad &fThe file you entered is missing:%newline%%{_dir}%" to sender
							else:
								send "&aNotepad &fThe player you entered is not online:%newline%%{_p}%"
						else:
							send "&aNotepad &fThe player you entered is not a player%newline%%{_p}%" to sender
					else:
						send "&aNotepad &fUsage: /notepad (skript add) (player) [directory]" to sender
				else:
					send "&aNotepad &fUsage: /notepad (skript add) (player) [directory]" to sender
			else:
				send "&aNotepad &fUsage: /notepad (skript add) (player) [directory]" to sender
		else:
			if {Notepad::Users::%player's uuid%::toggle} is true:
				set {Notepad::Users::%player's uuid%::toggle} to false
				send formatted "%{Cherry::blank}%%{_color-1}%Notepad %{_color-3}%The notepad is now off."
			else:
				set {_file} to {Notepad::Users::%player's uuid%::file}
				if {Notepad::Files::%{_file}%::type} is "Skript":
					set {_dir} to {Notepad::Files::%{_file}%::dir}
					set {Notepad::Files::%{_file}%::lines::*} to all lines of file path {_dir}
				set {Notepad::Users::%player's uuid%::home} to "editor"
				set {Notepad::Users::%player's uuid%::scroll} to 1
				delete {Notepad::Users::%player's uuid%::prompt}
				set {Notepad::Users::%player's uuid%::toggle} to true
				notepadUpdate(player, ("%{_color-1}%Notepad %{_color-2}%Editor", "", "%{_color-3}%Leave a review if you like the notepad!", "%{_color-3}%Notice any bugs? Contact TrueFusion##7600"))

on chat:
	if message starts with "!":
		player is a op
		cancel event
		send "&6Evaluation &7- &f%subtext of message from characters 2 to length of message%"
		evaluate subtext of message from characters 2 to length of message
		stop trigger
	if {Notepad::Users::%player's uuid%::toggle} is true:
		cancel event
		set {_file} to {Notepad::Users::%player's uuid%::file}
		set {_color-1} to {Notepad::Users::%player's uuid%::color-1}
		set {_color-2} to {Notepad::Users::%player's uuid%::color-2}
		set {_color-3} to {Notepad::Users::%player's uuid%::color-3}
		if {Notepad::Users::%player's uuid%::prompt} is set:
			if message is not "(cancel)":
				if {Notepad::Users::%player's uuid%::prompt} is "scroll-set":
					set {_int} to message parsed as an integer
					{_int} is set
					{_int} is more than 0
					{_int} is less than (size of {Notepad::Files::%{_file}%::lines::*} - 11)
					set {Notepad::Users::%player's uuid%::scroll} to {_int}
					delete {Notepad::Users::%player's uuid%::prompt}
					delete {Notepad::Users::%player's uuid%::info::*}
					delete {Notepad::Users::%player's uuid%::infoNow}
				else if {Notepad::Users::%player's uuid%::prompt} ends with "|rename":
					set {_id::*} to split {Notepad::Users::%player's uuid%::prompt} at "|"
					set {_id} to {_id::1}
					if length of message is more than 20:
						notepadUpdate(player, ("%{_color-1}%Notepad %{_color-2}%Rename", "", "%{_color-3}%This name has more than 20 characters."))
						delete {Notepad::Users::%player's uuid%::prompt}
						stop trigger
					set {_name} to {Notepad::Files::%{_id}%::name}
					set {Notepad::Files::%{_id}%::name} to message
					notepadUpdate(player, ("%{_color-1}%Notepad %{_color-2}%Rename", "", "%{_color-3}%Renamed the note ""%{_name}%"" to ""%message%""."))
				else if {Notepad::Users::%player's uuid%::prompt} ends with "|share":
					set {_id::*} to split {Notepad::Users::%player's uuid%::prompt} at "|"
					set {_id} to {_id::1}
					if length of message is more than 20:
						notepadUpdate(player, ("%{_color-1}%Notepad %{_color-2}%Share", "", "%{_color-3}%This name has more than 20 characters."))
						delete {Notepad::Users::%player's uuid%::prompt}
						stop trigger
					set {_p} to message parsed as a player
					if {Notepad::Files::%{_id}%::shared::*} contains {_p}'s uuid:
						notepadUpdate(player, ("%{_color-1}%Notepad %{_color-2}%Share", "", "%{_color-3}%You've already shared this note with this player."))
						delete {Notepad::Users::%player's uuid%::prompt}
						stop trigger
					else:
						if {_p} is player:
							notepadUpdate(player, ("%{_color-1}%Notepad %{_color-2}%Share", "", "%{_color-3}%You cannot share the note to yourself."))
							delete {Notepad::Users::%player's uuid%::prompt}
							stop trigger
						else:
							if {_p} is online:
								delete {Notepad::Users::%player's uuid%::prompt}
								delete {Notepad::Users::%player's uuid%::info::*}
								delete {Notepad::Users::%player's uuid%::infoNow}
								set {Notepad::Users::%{_p}'s uuid%::request} to {_id}
								notepadUpdate({_p}, ("%{_color-1}%Notepad %{_color-2}%Share", "%{_color-3}%You've received a share request from %player%.", "", "<tooltip:%{_color-2}%Accept %{_color-3}%Click to accept the share request.><command:/notepad3-request-accept %{_id}%>%{_color-2}%Accept", "<tooltip:%{_color-2}%Deny %{_color-3}%Click to deny the share request.><command:/notepad3-request-deny %{_id}%>%{_color-2}%Deny"))
							else:
								notepadUpdate(player, ("%{_color-1}%Notepad %{_color-2}%Share", "", "%{_color-3}%This player is not online."))
								delete {Notepad::Users::%player's uuid%::prompt}
								stop trigger
				else if {Notepad::Users::%player's uuid%::prompt} ends with "|delete":
					set {_id::*} to split {Notepad::Users::%player's uuid%::prompt} at "|"
					set {_id} to {_id::1}
					if message is "yes":
						notepadUpdate(player, ("%{_color-1}%Notepad %{_color-2}%Delete", "", "%{_color-3}%Deleted the note ""%{Notepad::Files::%{_id}%::name}%""."))
						delete {Notepad::Files::%{_id}%::*}
					set {Notepad::Users::%player's uuid%::home} to "editor"
				else if {Notepad::Users::%player's uuid%::prompt} is "create":
					if length of message is more than 20:
						notepadUpdate(player, ("%{_color-1}%Notepad %{_color-2}%Create", "", "%{_color-3}%This name has more than 20 characters."))
						delete {Notepad::Users::%player's uuid%::prompt}
						stop trigger
					set {_id} to createFile(player, message)
					set {Notepad::Users::%player's uuid%::file} to {_id}
					notepadUpdate(player, ("%{_color-1}%Notepad %{_color-2}%Create", "", "%{_color-3}%Created the note ""%message%""."))
				else if {Notepad::Users::%player's uuid%::prompt} is "download-pastebin":
					if {@developer-key} is "":
						notepadUpdate(player, ("%{_color-1}%Notepad %{_color-2}%Download Pastebin", "", "%{_color-3}%This action requires adminstrators to fill out ", "%{_color-3}%the developer key in notepad settings."))
						delete {Notepad::Users::%player's uuid%::prompt}
						stop trigger
					set {_parse::*} to message parsed as "https\://pastebin.com/%string%"
					if {_parse::*} is not set:
						notepadUpdate(player, ("%{_color-1}%Notepad %{_color-2}%Download Pastebin", "", "%{_color-3}%Invalid link. Make sure to send it as", "%{_color-3}%""https://pastebin.com/..."""))
						delete {Notepad::Users::%player's uuid%::prompt}
						stop trigger
					set {_lines::*} to split (the paste response from {_parse::1} with the developer key {@developer-key}) at newline
					if size of {_lines::*} is more than {@line-limit}:
						notepadUpdate(player, ("%{_color-1}%Notepad %{_color-2}%Download Pastebin", "", "%{_color-3}%Text cannot be more than {@line-limit} lines long."))
						delete {Notepad::Users::%player's uuid%::prompt}
						stop trigger
					set {_id} to createFile(player, {_parse::1})
					set {Notepad::Files::%{_id}%::lines::*} to {_lines::*}
					set {Notepad::Users::%player's uuid%::file} to {_id}
					notepadUpdate(player, ("%{_color-1}%Notepad %{_color-2}%Download Pastebin", "", "%{_color-3}%Downloaded."))
				else if {Notepad::Users::%player's uuid%::prompt} is "download-github":
					set {_parse::*} to message parsed as "https\://raw.githubusercontent.com/%string%"
					if {_parse::*} is not set:
						notepadUpdate(player, ("%{_color-1}%Notepad %{_color-2}%Download Github", "", "%{_color-3}%Invalid link. Make sure to send it as", "%{_color-3}%""https://raw.githubusercontent.com/..."""))
						delete {Notepad::Users::%player's uuid%::prompt}
						stop trigger
					fetch url message:
						set {_lines::*} to split fetched url content at System.getProperty("line.separator")
						if size of {_lines::*} is more than {@line-limit}:
							notepadUpdate(player, ("%{_color-1}%Notepad %{_color-2}%Download Github", "", "%{_color-3}%Text cannot be more than {@line-limit} lines long."))
							delete {Notepad::Users::%player's uuid%::prompt}
							stop trigger
						set {_name::*} to split {_parse::1} at "/"
						set {_id} to createFile(player, {_name::%size of {_name::*}%})
						set {Notepad::Files::%{_id}%::lines::*} to {_lines::*}
						set {Notepad::Users::%player's uuid%::file} to {_id}
					notepadUpdate(player, ("%{_color-1}%Notepad %{_color-2}%Download Github", "", "%{_color-3}%Downloaded."))
				else if {Notepad::Users::%player's uuid%::prompt} ends with "|hex":
					set {_hex::*} to split {Notepad::Users::%player's uuid%::prompt} at "|"
					set {_hex} to {_hex::1}
					set {_parse::*} to message parsed as "\<##%string%\>"
					if {_parse::*} is not set:
						notepadUpdate(player, ("%{_color-1}%Notepad %{_color-2}%Hex", "", "%{_color-3}%Invalid hex color. Make sure to send it as", "%{_color-3}%""<##...>"""))
						delete {Notepad::Users::%player's uuid%::prompt}
						stop trigger
					set {Notepad::Users::%player's uuid%::color-%{_hex}%} to formatted message
					set {Notepad::Users::%player's uuid%::hex-%{_hex}%} to {_parse::1}
					set {_color} to notepadGetColor(player, {_hex} parsed as an integer)
					notepadUpdate(player, ("%{Notepad::Users::%player's uuid%::color-1}%Notepad %{_color-2}%Color Selector", "", "%{_color-3}%Set the theme to %{_color}%."))
				else if {Notepad::Users::%player's uuid%::prompt} ends with "|reset":
					set {_id::*} to split {Notepad::Users::%player's uuid%::prompt} at "|"
					set {_id} to {_id::1}
					if message is "yes":
						delete {Notepad::Files::%{_id}%::lines::*}
					notepadUpdate(player, ("%{_color-1}%Notepad %{_color-2}%Reset", "", "%{_color-3}%Reset the note ""%{Notepad::Files::%{_id}%::name}%""."))
		else:
			if {Notepad::Users::%player's uuid%::home} is "editor":
				set {_x} to false
				if {Notepad::Files::%{_file}%::sharedEditable::*} does not contain player's uuid:
					{Notepad::Files::%{_file}%::owner} is player's uuid
					set {_x} to true
				else:
					set {_x} to true
				if {_x} is false:
					notepadUpdate(player, ("%{_color-1}%Notepad %{_color-2}%Edit Permissions", "", "%{_color-3}%You do not have the required permissions to edit this file."))
				{_x} is true
				if {Notepad::Files::%{_file}%::type} is "Skript":
					set {_dir} to {Notepad::Files::%{_file}%::dir}
					set {Notepad::Files::%{_file}%::lines::*} to all lines of file path {_dir}
				set {_delete::*} to message parsed as "\[%integer%\]"
				set {_set::*} to message parsed as "\[%integer%\] %string%"
				set {_insert::*} to message parsed as "\[~%integer%\] %string%"
				if size of {_delete::*} is 1:
					{_delete::1} is more than 0
					{_delete::1} is less than or equal to size of {Notepad::Files::%{_file}%::lines::*}
					if size of {Notepad::Files::%{_file}%::lines::*} is more than 13:
						{Notepad::Users::%player's uuid%::scroll} is size of {Notepad::Files::%{_file}%::lines::*} - 12
						remove 1 from {Notepad::Users::%player's uuid%::scroll}
					delete {Notepad::Files::%{_file}%::lines::%{_delete::1}%}
					set {Notepad::Files::%{_file}%::lines::*} to {Notepad::Files::%{_file}%::lines::*}
					if {Notepad::Files::%{_file}%::type} is "Skript":
						delete line {_delete::1} of file path {_dir}
				else if size of {_set::*} is 2:
					{_set::1} is more than 0
					{_set::1} is less than or equal to size of {Notepad::Files::%{_file}%::lines::*}
					if size of {Notepad::Files::%{_file}%::lines::*} is more than 13:
						{Notepad::Users::%player's uuid%::scroll} is size of {Notepad::Files::%{_file}%::lines::*} - 12
						add 1 to {Notepad::Users::%player's uuid%::scroll}
					if {Notepad::Files::%{_file}%::type} is "Skript":
						set {_message} to createSpaces({_set::2})
						set {Notepad::Files::%{_file}%::lines::%{_set::1}%} to {_message}
						set line {_set::1} of file path {_dir} to {_message}
					else:
						set {Notepad::Files::%{_file}%::lines::%{_set::1}%} to {_set::2}
				else if size of {_insert::*} is 2:
					if size of {Notepad::Files::%{_file}%::lines::*} is more than or equal to {@line-limit}:
						notepadUpdate(player, ("%{_color-1}%Notepad %{_color-2}%Limit", "", "%{_color-3}%You have reached the note size limit ({@line-limit})."))
						stop trigger
					{_insert::1} is more than 0
					{_insert::1} is less than or equal to size of {Notepad::Files::%{_file}%::lines::*}
					if {Notepad::Files::%{_file}%::type} is "Skript":
						set {_message} to createSpaces({_insert::2})
						set {Notepad::Files::%{_file}%::lines::*} to insert({Notepad::Files::%{_file}%::lines::*}, {_message}, {_insert::1})
						insert {_message} at line {_insert::1} + 1 of file path {_dir}
					else:
						set {Notepad::Files::%{_file}%::lines::*} to insert({Notepad::Files::%{_file}%::lines::*}, {_insert::2}, {_insert::1})
				else:
					if size of {Notepad::Files::%{_file}%::lines::*} is more than or equal to {@line-limit}:
						notepadUpdate(player, ("%{_color-1}%Notepad %{_color-2}%Limit", "", "%{_color-3}%You have reached the note size limit ({@line-limit})."))
						stop trigger
					if (size of {Notepad::Files::%{_file}%::lines::*} - 12) is {Notepad::Users::%player's uuid%::scroll}:
						add 1 to {Notepad::Users::%player's uuid%::scroll}
					if {Notepad::Files::%{_file}%::type} is "Skript":
						set {_message} to createSpaces(message)
						add {_message} to {Notepad::Files::%{_file}%::lines::*}
						add {_message} to content of file path {_dir}
					else:
						add message to {Notepad::Files::%{_file}%::lines::*}
			notepadUpdate(player)

every 1 tick:
	loop all players where [{Notepad::Users::%input's uuid%::toggle} is true]:
		notepadUpdate(loop-player)
		set {_file} to {Notepad::Users::%loop-player's uuid%::file}
		if {Notepad::Files::%{_file}%::type} is "Skript":
			set {_dir} to {Notepad::Files::%{_file}%::dir}
			set {Notepad::Files::%{_file}%::lines::*} to all lines of file path {_dir}

function notepadUpdate(p: player, info: strings=("")):
	{Notepad::Users::%{_p}'s uuid%::toggle} is true
	runFileCheck({_p})
	set {_color-1} to {Notepad::Users::%{_p}'s uuid%::color-1}
	set {_color-2} to {Notepad::Users::%{_p}'s uuid%::color-2}
	set {_color-3} to {Notepad::Users::%{_p}'s uuid%::color-3}
	if {_info::*} is not (""):
		set {Notepad::Users::%{_p}'s uuid%::info::*} to {_info::*}
		set {Notepad::Users::%{_p}'s uuid%::infoNow} to now
	if difference between now and {Notepad::Users::%{_p}'s uuid%::infoNow} is greater than 15 seconds:
		delete {Notepad::Users::%{_p}'s uuid%::infoNow}
		delete {Notepad::Users::%{_p}'s uuid%::info::*}
		delete {Notepad::Users::%{_p}'s uuid%::prompt}
		delete {Notepad::Users::%{_p}'s uuid%::request}
	set {_home} to {Notepad::Users::%{_p}'s uuid%::home}
	set {_file} to {Notepad::Users::%{_p}'s uuid%::file}
	if {Notepad::Users::%{_p}'s uuid%::info::*} is set:
		set {_info} to "<reset>&8&m                             &r&8[<command:/notepad3-clearinfo><tooltip:%{_color-1}%Notepad %{_color-3}%Clear %{_color-2}%(%difference between 15 seconds and (difference between now and {Notepad::Users::%{_p}'s uuid%::infoNow})%)>%{_color-1}%-&8]"
		loop {Notepad::Users::%{_p}'s uuid%::info::*}:
			set {_info} to "%{_info}%<reset>%newline%  %loop-value%"
		set {_info} to "%{_info}%%newline%"
	else:
		set {_info} to ""
	set {_display} to ""
	if {_home} is "editor":
		set {_i} to {Notepad::Users::%{_p}'s uuid%::scroll}
		set {_times} to size of {Notepad::Users::%{_p}'s uuid%::info::*} + 1 if {Notepad::Users::%{_p}'s uuid%::info::*} is set
		add 7 to {_times}
		loop 20 - {_times} times:
			if {Notepad::Files::%{_file}%::lines::%{_i}%} is not set:
				exit loop
			if {Notepad::Files::%{_file}%::type} is "Skript":
				set {_suggest} to ""
			else:
				set {_suggest} to "<suggest command:[%{_i}%] %{Notepad::Files::%{_file}%::lines::%{_i}%}%>"
			set {_line} to format({_file}, {Notepad::Files::%{_file}%::lines::%{_i}%}, {_suggest})
			set {_display} to "%{_display}%%{_color-2}%%{_i}%. <reset>%{_suggest}%%{_line}%%newline%"
			add 1 to {_i}
		if {Notepad::Files::%{_file}%::owner} is "console":
			set {_file-owner} to "Console"
		else:
			set {_file-owner} to "%{Notepad::Files::%{_file}%::owner} parsed as an offline player%"
		set {_i} to 1
		set {_scroll-down} to "&7↓"
		if {Notepad::Users::%{_p}'s uuid%::scroll} is not (size of {Notepad::Files::%{_file}%::lines::*} - 12):
			size of {Notepad::Files::%{_file}%::lines::*} is more than 13
			set {_scroll-down} to "%{_color-1}%↓"
		set {_scroll-up} to "&7↑"
		if {Notepad::Users::%{_p}'s uuid%::scroll} - 1 is not less than 1:
			size of {Notepad::Files::%{_file}%::lines::*} is more than 13
			set {_scroll-up} to "%{_color-1}%↑"
		if size of {Notepad::Files::%{_file}%::lines::*} is more than 13:
			set {_max-scroll} to (size of {Notepad::Files::%{_file}%::lines::*} - 12)
		else:
			set {_max-scroll} to 1
		set {_scroll} to "%{_color-2}%(%{Notepad::Users::%{_p}'s uuid%::scroll}%/%{_max-scroll}%)"
		# This is because Skript gave me a little error about the huge line one time so I changed it.
		set {_infobox} to "%{_info}%<reset>&8&m                         &r&8[<command:/notepad3-scrollup><tooltip:%{_color-1}%Notepad %{_color-3}%Scroll Up %{_scroll}%>%{_scroll-up}%<reset>&8|<command:/notepad3-scrolldown><tooltip:%{_color-1}%Notepad %{_color-3}%Scroll Down %{_scroll}%>%{_scroll-down}%<reset>&8|<command:/notepad3-scrollset><tooltip:%{_color-1}%Notepad %{_color-3}%Set Scroll %{_scroll}%>%{_color-1}%●&8]%newline%| %{_color-2}%<command:/notepad3-home files><tooltip:%{_color-1}%Notepad %{_color-2}%Files%newline%%newline%%{_color-3}%The new file system makes it so much easier to view, edit, create, download, and upload files!%newline%%newline%&7(Click)>Files<reset>"
		set {_infobox} to "%{_infobox}%%newline%&8| %{_color-2}%<command:/notepad3-home notes><tooltip:%{_color-1}%Notepad %{_color-2}%Note Settings%newline%%newline%%{_color-2}%Owner - %{_color-3}%%{_file-owner} parsed as an offline player%%newline%%{_color-2}%Name - %{_color-3}%%{Notepad::Files::%{_file}%::name}%%newline%%{_color-2}%Type - %{_color-3}%%{Notepad::Files::%{_file}%::type}%%newline%%{_color-2}%Size - %{_color-3}%%size of {Notepad::Files::%{_file}%::lines::*}%%newline%%newline%&7(Click)>Note - %{_color-3}%%{Notepad::Files::%{_file}%::name}%<reset>"
		set {_infobox} to "%{_infobox}%%newline%&8| %{_color-2}%<command:/notepad3-home version><tooltip:%{_color-1}%Notepad %{_color-2}%Version 3.0%newline%%newline%%{_color-3}%Click this to view the newest changes to the notepad.%newline%%newline%&7(Click)>Version<reset>"
		set {_infobox} to "%{_infobox}%%newline%&8| %{_color-2}%<command:/notepad3-home qna><tooltip:%{_color-1}%Notepad %{_color-2}%Q&%{_color-2}%A%newline%%newline%%{_color-3}%Click this to view some possible questions you may have on the notepad.%newline%%newline%If this doesn't answer your question, please don't leave it in a review. Instead, please contact the script author, TrueFusion, about your problem at TrueFusion##7600 on Discord.%newline%%newline%&7(Click)>Q&%{_color-2}%A<reset>"
		set {_infobox} to "%{_infobox}%%newline%&8| %{_color-2}%<command:/notepad3-home player><tooltip:%{_color-1}%Notepad %{_color-2}%Settings%newline%%newline%%{_color-3}%Click this to change your notepad settings such as the theme and formatting.%newline%%newline%&7(Click)>%{_p}%<reset>%newline%&8&m                             &r<command:/notes><tooltip:&cClose Notepad>&8[&cX&8]"
	else if {_home} is "files":
		if {Notepad::Users::%{_p}'s uuid%::page} is less than ceiling(size of {Notepad::Users::%{_p}'s uuid%::files::*} / 5):
			set {_next-page} to "%{_color-1}%>"
		else:
			set {_next-page} to "&7>"
		if {Notepad::Users::%{_p}'s uuid%::page} is not 1:
			set {_previous-page} to "%{_color-1}%<"
		else:
			set {_previous-page} to "&7<"
		set {_files} to newline
		set {_i} to ({Notepad::Users::%{_p}'s uuid%::page} - 1) * 5 + 1
		loop 5 times:
			if {Notepad::Users::%{_p}'s uuid%::files::%{_i}%} is set:
				set {_id} to {Notepad::Users::%{_p}'s uuid%::files::%{_i}%}
				if {Notepad::Files::%{_id}%::type} is "Skript":
					set {_dot} to "%{_color-1}%●"
				else if {Notepad::Files::%{_id}%::owner} is not {_p}'s uuid:
					set {_dot} to "&e●"
				else:
					set {_dot} to "&7●"
				set {_i2} to 1
				if {Notepad::Files::%{_id}%::owner} is "console":
					set {_file-owner} to "Console"
				else:
					set {_file-owner} to "%{Notepad::Files::%{_id}%::owner} parsed as an offline player%"
				if {_id} is {Notepad::Users::%{_p}'s uuid%::file}:
					set {_name} to "%{_color-2}%%{Notepad::Files::%{_id}%::name}%"
				else:
					set {_name} to "%{_color-3}%%{Notepad::Files::%{_id}%::name}%"
				set {_files} to "%{_files}%&8| %{_dot}% <command:/notepad3-noteset %{_id}%><tooltip:%{_color-1}%Notepad %{_color-2}%Note%newline%%newline%%{_color-2}%Owner - %{_color-3}%%{_file-owner} parsed as an offline player%%newline%%{_color-2}%Name - %{_color-3}%%{Notepad::Files::%{_id}%::name}%%newline%%{_color-2}%Type - %{_color-3}%%{Notepad::Files::%{_id}%::type}%%newline%%{_color-2}%Size - %{_color-3}%%size of {Notepad::Files::%{_id}%::lines::*}%%newline%%newline%&7(Click to set)>%{_name}%<reset>%newline%"
			else:
				set {_files} to "%{_files}%&8|<reset>%newline%"
			add 1 to {_i}
		set {_page} to "%{_color-2}%(%{Notepad::Users::%{_p}'s uuid%::page}%/%ceiling(size of {Notepad::Users::%{_p}'s uuid%::files::*} / 5)%)"
		set {_infobox} to "%{_info}%<reset>&8&m                      &r&8[<command:/notepad3-create><tooltip:%{_color-1}%Notepad %{_color-3}%Create a new note>%{_color-1}%+<reset>&8|<tooltip:%{_color-1}%Notepad %{_color-3}%Download text from a pastebin link><command:/notepad3-download-pastebin>%{_color-1}%●<reset>&8|<tooltip:%{_color-1}%Notepad %{_color-3}%Download text from a github link><command:/notepad3-download-github>%{_color-1}%●<reset>&8|<command:/notepad3-pagedown><tooltip:%{_color-1}%Notepad %{_color-3}%Previous Page %{_page}%>%{_previous-page}%&8|<command:/notepad3-pageup><tooltip:%{_color-1}%Notepad %{_color-3}%Next Page %{_page}%>%{_next-page}%&8]&r%{_files}%&8&m                           &r<command:/notepad3-back><tooltip:%{_color-1}%Notepad %{_color-3}%Go back to the editor%newline%%{_color-2}%Home - %{_color-3}%Files>&8[%{_color-1}%<&8|&r<command:/notes><tooltip:%{_color-1}%Notepad %{_color-3}%Close the notepad>&cX&8]"
	else if {_home} is "notes":
		if {Notepad::Users::%{_p}'s uuid%::page} is not 1:
			set {_previous-page} to "%{_color-1}%<"
		else:
			set {_previous-page} to "&7<"
		if {Notepad::Files::%{_file}%::owner} is {_p}'s uuid:
			if {Notepad::Users::%{_p}'s uuid%::page} is less than 2:
				set {_next-page} to "%{_color-1}%>"
			else:
				set {_next-page} to "&7>"
			if {Notepad::Users::%{_p}'s uuid%::page} is 1:
				set {_contents} to "&8| <command:/notepad3-home shared><tooltip:%{_color-1}%Notepad %{_color-2}%Shared%newline%%newline%%{_color-3}%Click this to see who this note has been shared to, and unshare them. You can also manage a user's note permissions here.%newline%%newline%%{_color-2}%(Click)>%{_color-2}%Shared%newline%<reset>&8| <command:/notepad3-notes-reset %{_file}%><tooltip:%{_color-1}%Notepad %{_color-2}%Reset%newline%%newline%%{_color-3}%Click this to reset the note contents. Requires confirmation.%newline%%newline%%{_color-2}%(Click)>%{_color-2}%Reset%newline%<reset>&8| <tooltip:%{_color-1}%Notepad %{_color-2}%Rename%newline%%newline%%{_color-3}%Click to rename this note.%newline%%newline%%{_color-2}%(Click)><command:/notepad3-noterename %{_file}%>%{_color-2}%Rename Note%newline%<reset>&8| <tooltip:%{_color-1}%Notepad %{_color-2}%Share%newline%%newline%%{_color-3}%Share the note with another online player.%newline%%newline%%{_color-2}%(Click)><command:/notepad3-noteshare %{_file}%>%{_color-2}%Share Note%newline%<reset>&8| <tooltip:%{_color-1}%Notepad %{_color-2}%Delete%newline%%newline%%{_color-3}%Deletes the note. Requires confirmation.%newline%%newline%%{_color-2}%(Click)><command:/notepad3-notedelete %{_file}%>%{_color-2}%Delete Note"
			else if {Notepad::Users::%{_p}'s uuid%::page} is 2:
				set {_contents} to "&8| <command:/notepad3-notepastebin %{_file}%><tooltip:%{_color-1}%Notepad %{_color-2}%Pastebin%newline%%newline%%{_color-3}%Uploads the contents of the note in pastebin.%newline%%newline%%{_color-2}%(Click)>%{_color-2}%Convert to Pastebin%newline%%newline%%newline%%newline%"
			set {_page} to "%{_color-2}%(%{Notepad::Users::%{_p}'s uuid%::page}%/2)"
		else:
			set {_next-page} to "&7>"
			set {_page} to "%{_color-2}%(1/1)"
			set {_contents} to "<command:/notepad3-removeshare><tooltip:%{_color-1}%Notepad %{_color-2}%Remove%newline%%newline%%{_color-3}%Click to remove this note from your files.%newline%%newline%%{_color-2}%(Click)>%{_color-2}%Remove%newline%%newline%%newline%%newline%"
		set {_infobox} to "%{_info}%<reset>&8&m                           &r&8[<command:/notepad3-pagedown><tooltip:%{_color-1}%Notepad %{_color-3}%Previous Page %{_page}%>%{_previous-page}%&8|<command:/notepad3-pageup><tooltip:%{_color-1}%Notepad %{_color-3}%Next Page %{_page}%>%{_next-page}%&8]&r%newline%%{_contents}%%newline%&r&8&m                           &r<command:/notepad3-back><tooltip:%{_color-1}%Notepad %{_color-3}%Go back to the editor%newline%%{_color-2}%Home - %{_color-3}%Note Settings>&8[%{_color-1}%<&8|&r<command:/notes><tooltip:%{_color-1}%Notepad %{_color-3}%Close the notepad>&cX&8]"
	else if {_home} is "shared":
		if {Notepad::Users::%{_p}'s uuid%::page} is less than ceiling(size of {Notepad::Files::%{_files}%::shared::*} / 5):
			set {_next-page} to "%{_color-1}%>"
		else:
			set {_next-page} to "&7>"
		if {Notepad::Users::%{_p}'s uuid%::page} is not 1:
			set {_previous-page} to "%{_color-1}%<"
		else:
			set {_previous-page} to "&7<"
		set {_players} to ""
		set {_i} to ({Notepad::Users::%{_p}'s uuid%::page} - 1) * 5 + 1
		loop 5 times:
			if {Notepad::Files::%{_file}%::shared::%{_i}%} is set:
				set {_player} to {Notepad::Files::%{_file}%::shared::%{_i}%} parsed as an offline player
				if {Notepad::Files::%{_file}%::sharedEditable::*} contains {_player}'s uuid:
					set {_editable} to "%{_color-2}%Edit Permissions &aEnabled"
				else:
					set {_editable} to "%{_color-2}%Edit Permissions &cDisabled"
				set {_players} to "%{_players}%%newline%&8| &7● <command:/notepad3-shared-player %{_player}'s uuid%><tooltip:%{_color-1}%Notepad %{_color-2}%Player %{_color-3}%%{_player}%%newline%%newline%%{_editable}%%newline%%newline%%{_color-2}%(Click)>%{_color-3}%%{_player}%<reset>"
			else:
				set {_players} to "%{_players}%%newline%&8|<reset>"
			add 1 to {_i}
		set {_max} to ceiling(size of {Notepad::Files::%{_file}%::shared::*} / 5)
		if {_max} is 0:
			set {_max} to 1
		set {_page} to "%{_color-2}%(%{Notepad::Users::%{_p}'s uuid%::page}%/%{_max}%)"
		set {_infobox} to "%{_info}%<reset>&8&m                           &r&8[<command:/notepad3-pagedown><tooltip:%{_color-1}%Notepad %{_color-3}%Previous Page %{_page}%>%{_previous-page}%&8|<command:/notepad3-pageup><tooltip:%{_color-1}%Notepad %{_color-3}%Next Page %{_page}%>%{_next-page}%&8]&r%{_players}%%newline%&r&8&m                           &r<command:/notepad3-home notes><tooltip:%{_color-1}%Notepad %{_color-3}%Go back to the note settings%newline%%{_color-2}%Home - %{_color-3}%Share List>&8[%{_color-1}%<&8|&r<command:/notes><tooltip:%{_color-1}%Notepad %{_color-3}%Close the notepad>&cX&8]"
	else if {_home} is "version":
		if {Notepad::Users::%{_p}'s uuid%::page} is 1:
			set {_next-page} to "%{_color-1}%>"
		else:
			set {_next-page} to "&7>"
		if {Notepad::Users::%{_p}'s uuid%::page} is not 1:
			set {_previous-page} to "%{_color-1}%<"
		else:
			set {_previous-page} to "&7<"
		if {Notepad::Users::%{_p}'s uuid%::page} is 1:
			set {_contents} to "%newline%&8| %{_color-2}%[&a+%{_color-2}%] %{_color-3}%Addition%newline%&8| %{_color-2}%[&e-%{_color-2}%] %{_color-3}%Improvement%newline%&8| %newline%&8| &a+ %{_color-3}%Added sharing%newline%&8| &a+ %{_color-3}%Added ability to upload-from/download-to pastebin and github."
		else if {Notepad::Users::%{_p}'s uuid%::page} is 2:
			set {_contents} to "%newline%&8| &a+ %{_color-3}%Added ability to edit .sk and .txt files.%newline%&8| &a+ %{_color-3}%Scrolling%newline%&8| &e- %{_color-3}%Greatly improved file editor%newline%&8| &e- %{_color-3}%Improved themes%newline%&8| %{_color-3}%More..."
		set {_page} to "%{_color-2}%(%{Notepad::Users::%{_p}'s uuid%::page}%/2)"
		set {_infobox} to "%{_info}%<reset>&8&m                           &r&8[<command:/notepad3-pagedown><tooltip:%{_color-1}%Notepad %{_color-3}%Previous Page %{_page}%>%{_previous-page}%&8|<command:/notepad3-pageup><tooltip:%{_color-1}%Notepad %{_color-3}%Next Page %{_page}%>%{_next-page}%&8]&r%{_contents}%%newline%&r&8&m                           &r<command:/notepad3-back><tooltip:%{_color-1}%Notepad %{_color-3}%Go back to the editor%newline%%{_color-2}%Home - %{_color-3}%Version>&8[%{_color-1}%<&8|&r<command:/notes><tooltip:%{_color-1}%Notepad %{_color-3}%Close the notepad>&cX&8]"
	else if {_home} is "qna":
		if {Notepad::Users::%{_p}'s uuid%::page} is 1 or 2:
			set {_next-page} to "%{_color-1}%>"
		else:
			set {_next-page} to "&7>"
		if {Notepad::Users::%{_p}'s uuid%::page} is not 1:
			set {_previous-page} to "%{_color-1}%<"
		else:
			set {_previous-page} to "&7<"
		if {Notepad::Users::%{_p}'s uuid%::page} is 1:
			set {_contents} to "%newline%&8| %{_color-2}%Share/Unshare Files%newline%&8| %newline%&8| %{_color-3}%If you wish to share a note with a player,%newline%&8| %{_color-3}%or if you want to remove a note you need%newline%&8| %{_color-3}%to click the note settings."
		else if {Notepad::Users::%{_p}'s uuid%::page} is 2:
			set {_contents} to "%newline%&8| %{_color-2}%Pastebin Errors%newline%&8| %newline%&8| %{_color-3}%Click this pastebin link to read about%newline%&8| %{_color-3}%any possible errors you've seen:%newline%&8| %{_color-2}%<link:https://pastebin.com/kCLTJtyS><tooltip:%{_color-2}%Pastebin %{_color-3}%Click to go to pastebin>https://pastebin.com/kCLTJtyS"
		else if {Notepad::Users::%{_p}'s uuid%::page} is 3:
			set {_contents} to "%newline%&8| %{_color-2}%Further Questions%newline%&8| %newline%&8| %{_color-3}%Any more questions you have can%newline%&8| %{_color-3}%be sent to TrueFusion##2022%newline%&8| "
		set {_page} to "%{_color-2}%(%{Notepad::Users::%{_p}'s uuid%::page}%/3)"
		set {_infobox} to "%{_info}%<reset>&8&m                           &r&8[<command:/notepad3-pagedown><tooltip:%{_color-1}%Notepad %{_color-3}%Previous Page %{_page}%>%{_previous-page}%&8|<command:/notepad3-pageup><tooltip:%{_color-1}%Notepad %{_color-3}%Next Page %{_page}%>%{_next-page}%&8]&r%{_contents}%%newline%&r&8&m                           &r<command:/notepad3-back><tooltip:%{_color-1}%Notepad %{_color-3}%Go back to the editor%newline%%{_color-2}%Home - %{_color-3}%Q&%{_color-3}%A>&8[%{_color-1}%<&8|&r<command:/notes><tooltip:%{_color-1}%Notepad %{_color-3}%Close the notepad>&cX&8]"
	else if {_home} is "player":
		set {_infobox} to "%{_info}%<reset>&8&m                                &r%newline%&8| %{_color-2}%<command:/notepad3-player-theme 1><tooltip:%{_color-1}%Notepad %{_color-2}%Theme%newline%%newline%%{_color-3}%The theme are the colors that you see in the notepad. Click this to set the primary color.%newline%%{_color-2}%Current: &r%notepadGetColor({_p}, 1)%%newline%%newline%%{_color-2}%(Click)>Theme 1%newline%<reset>&8| %{_color-2}%<command:/notepad3-player-theme 2><tooltip:%{_color-1}%Notepad %{_color-2}%Theme%newline%%newline%%{_color-3}%The theme are the colors that you see in the notepad. Click this to set the secondary color.%newline%%{_color-2}%Current: &r%notepadGetColor({_p}, 2)%%newline%%newline%%{_color-2}%(Click)>Theme 2%newline%<reset>&8| %{_color-2}%<command:/notepad3-player-theme 3><tooltip:%{_color-1}%Notepad %{_color-2}%Theme%newline%%newline%%{_color-3}%The theme are the colors that you see in the notepad. Click this to set the tertiary color.%newline%%{_color-2}%Current: &r%notepadGetColor({_p}, 3)%%newline%%newline%%{_color-2}%(Click)>Theme 3%newline%<reset>&8| %{_color-2}%<command:/notepad3-player-formatting><tooltip:%{_color-1}%Notepad %{_color-2}%Theme%newline%%newline%%{_color-3}%Enabling formatting allows you to include tooltips, links, commands, and suggestions.%newline%%newline%%{_color-2}%(Click)>Formatting<reset>%newline%&8| %newline%<reset>&r&8&m                           &r<command:/notepad3-back><tooltip:%{_color-1}%Notepad %{_color-3}%Go back to the editor%newline%%{_color-2}%Home - %{_color-3}%Settings>&8[%{_color-1}%<&8|&r<command:/notes><tooltip:%{_color-1}%Notepad %{_color-3}%Close the notepad>&cX&8]"
	send formatted "%{Cherry::blank}%%{_display}%%{_infobox}%" to {_p}

on command:
	executor is not console
	full command starts with "notepad3"
	player has permission "skript.notepad.use"
	set {_command::*} to split full command at " "
	set {_color-1} to {Notepad::Users::%player's uuid%::color-1}
	set {_color-2} to {Notepad::Users::%player's uuid%::color-2}
	set {_color-3} to {Notepad::Users::%player's uuid%::color-3}
	if {_command::1} is "notepad3-home":
		cancel event
		if {_command::2} is "editor":
			set {_file} to {Notepad::Users::%player's uuid%::file}
			{Notepad::Files::%{_file}%::type} is "Skript"
			set {_dir} to {Notepad::Files::%{_file}%::dir}
			set {Notepad::Files::%{_file}%::lines::*} to all lines of file path {_dir}
		set {Notepad::Users::%player's uuid%::home} to {_command::2}
		set {Notepad::Users::%player's uuid%::page} to 1
		set {Notepad::Users::%player's uuid%::scroll} to 1
	else if {_command::1} is "notepad3-scrolldown":
		cancel event
		{Notepad::Users::%player's uuid%::scroll} is not (size of {Notepad::Files::%{Notepad::Users::%player's uuid%::file}%::lines::*} - 12)
		size of {Notepad::Files::%{Notepad::Users::%player's uuid%::file}%::lines::*} is more than 13
		add 1 to {Notepad::Users::%player's uuid%::scroll}
	else if {_command::1} is "notepad3-scrollup":
		cancel event
		{Notepad::Users::%player's uuid%::scroll} - 1 is not less than 1
		size of {Notepad::Files::%{Notepad::Users::%player's uuid%::file}%::lines::*} is more than 13
		remove 1 from {Notepad::Users::%player's uuid%::scroll}
	else if {_command::1} is "notepad3-scrollset":
		cancel event
		set {Notepad::Users::%player's uuid%::prompt} to "scroll-set"
		set {_max} to (size of {Notepad::Files::%{Notepad::Users::%player's uuid%::file}%::lines::*} - 12)
		if {_max} is less than 1:
			set {_max} to 1
		notepadUpdate(player, ("%{_color-1}%Notepad %{_color-2}%Set Scroll", "", "%{_color-3}%Please type in the scroll number ranging from 1-%{_max}%", "%{_color-3}%To cancel type ""(cancel)"""))
	else if {_command::1} is "notepad3-noteset":
		cancel event
		set {Notepad::Users::%player's uuid%::file} to {_command::2}
		delete {Notepad::Users::%player's uuid%::info::*}
		delete {Notepad::Users::%player's uuid%::infoNow}
		delete {Notepad::Users::%player's uuid%::prompt}
		notepadUpdate(player, ("%{_color-1}%Notepad %{_color-2}%Set", "", "%{_color-3}%Set your note to %{Notepad::Files::%{_command::2}%::name}%."))
	else if {_command::1} is "notepad3-noterename":
		cancel event
		{Notepad::Files::%{_command::2}%::owner} is player's uuid
		set {Notepad::Users::%player's uuid%::prompt} to "%{_command::2}%|rename"
		notepadUpdate(player, ("%{_color-1}%Notepad %{_color-2}%Rename %{_color-3}%%{Notepad::Files::%{_command::2}%::name}%", "", "%{_color-3}%Please type in the new name ranging to 20 characters.", "%{_color-3}%To cancel type ""(cancel)"""))
	else if {_command::1} is "notepad3-noteshare":
		cancel event
		{Notepad::Files::%{_command::2}%::owner} is player's uuid
		set {Notepad::Users::%player's uuid%::prompt} to "%{_command::2}%|share"
		notepadUpdate(player, ("%{_color-1}%Notepad %{_color-2}%Share %{_color-3}%%{Notepad::Files::%{_command::2}%::name}%", "", "%{_color-3}%Please type in the name of the player.", "%{_color-3}%To cancel type ""(cancel)"""))
	else if {_command::1} is "notepad3-notedelete":
		cancel event
		{Notepad::Files::%{_command::2}%::owner} is player's uuid
		set {Notepad::Users::%player's uuid%::prompt} to "%{_command::2}%|delete"
		notepadUpdate(player, ("%{_color-1}%Notepad %{_color-2}%Delete %{_color-3}%%{Notepad::Files::%{_command::2}%::name}%", "", "%{_color-3}%Please type ""yes"" if you want to delete this note.", "%{_color-3}%To cancel type ""(cancel)"""))
	else if {_command::1} is "notepad3-notepastebin":
		cancel event
		{Notepad::Files::%{_command::2}%::owner} is player's uuid
		if player has permission "skript.notepad.pastebin":
			if {@developer-key} is not "":
				set {_pastebin-id} to random uuid
				create paste with id {_pastebin-id}
				set {_paste} to paste with id {_pastebin-id}
				if size of {Notepad::Files::%{_command::2}%::lines::*} is more than 0:
					set raw text of {_paste} to {Notepad::Files::%{_command::2}%::lines::*}
				else:
					set raw text of {_paste} to ("")
				build the paste with id {_pastebin-id} with the developer key {@developer-key}
				if link of last built pastebin starts with "https://":
					set {_link::*} to ("%{_color-3}%<link:%link of last built pastebin%><tooltip:%{_color-2}%Pastebin %{_color-3}%Click to go to pastebin>%link of last built pastebin%")
				else:
					set {_error::*} to link of last built pastebin parsed as "%string%: %number% for%string%"
					if {_error::*} is set:
						set {_error} to {_error::2}
					else:
						set {_error} to "..."
					set {_link::*} to ("%{_color-3}%There was an error while building your pastebin. Please try again after a few seconds.", "%{_color-3}%If the problem persists, read the Q&%{_color-3}%A.", "%{_color-2}%Error code: %{_error}%")
				notepadUpdate(player, ("%{_color-1}%Notepad %{_color-2}%Pastebin %{_color-3}%%{Notepad::Files::%{_command::2}%::name}%", "", {_link::*}))
			else:
				notepadUpdate(player, ("%{_color-1}%Notepad %{_color-2}%Pastebin", "", "%{_color-3}%This action requires adminstrators to fill out ", "%{_color-3}%the developer key in notepad settings."))
		else:
			notepadUpdate(player, ("%{_color-1}%Notepad %{_color-2}%Pastebin", "", "%{_color-3}%You do not have the required permission."))
	else if {_command::1} is "notepad3-pageup":
		cancel event
		if {Notepad::Users::%player's uuid%::home} is "files":
			set {_max} to ceiling(size of {Notepad::Users::%player's uuid%::files::*} / 5)
		else if {Notepad::Users::%player's uuid%::home} is "shared":
			set {_max} to ceiling(size of {Notepad::Files::%{Notepad::Users::%player's uuid%::file}%::shared::*} / 5)
		else if {Notepad::Users::%player's uuid%::home} is "notes":
			if {Notepad::Files::%{Notepad::Users::%player's uuid%::file}%::owner} is player's uuid:
				set {_max} to 2
			else:
				set {_max} to 1
		else if {Notepad::Users::%player's uuid%::home} is "version":
			set {_max} to 2
		else if {Notepad::Users::%player's uuid%::home} is "qna":
			set {_max} to 3
		{Notepad::Users::%player's uuid%::page} is less than {_max}
		add 1 to {Notepad::Users::%player's uuid%::page}
	else if {_command::1} is "notepad3-pagedown":
		cancel event
		{Notepad::Users::%player's uuid%::page} is not 1
		remove 1 from {Notepad::Users::%player's uuid%::page}
	else if {_command::1} is "notepad3-create":
		cancel event
		set {Notepad::Users::%player's uuid%::prompt} to "create"
		notepadUpdate(player, ("%{_color-1}%Notepad %{_color-2}%Create Note", "", "%{_color-3}%Please type in the note name.", "%{_color-3}%To cancel type ""(cancel)"""))
	else if {_command::1} is "notepad3-dowload-pastebin":
		cancel event
		set {Notepad::Users::%player's uuid%::prompt} to "download-pastebin"
		notepadUpdate(player, ("%{_color-1}%Notepad %{_color-2}%Download Pastebin", "", "%{_color-3}%Please type in the Pastebin link.", "It must be said as ""https://pastebin.com/...""", "%{_color-3}%To cancel type ""(cancel)"""))
	else if {_command::1} is "notepad3-download-github":
		cancel event
		set {Notepad::Users::%player's uuid%::prompt} to "download-github"
		notepadUpdate(player, ("%{_color-1}%Notepad %{_color-2}%Download Github", "", "%{_color-3}%Please type in the Github link.", "It must be said as ""https://raw.githubusercontent.com/...""", "%{_color-3}%To cancel type ""(cancel)"""))
	else if {_command::1} is "notepad3-clearinfo":
		cancel event
		delete {Notepad::Users::%player's uuid%::info::*}
		delete {Notepad::Users::%player's uuid%::infoNow}
		delete {Notepad::Users::%player's uuid%::prompt}
		delete {Notepad::Users::%player's uuid%::request}
	else if {_command::1} is "notepad3-back":
		cancel event
		set {Notepad::Users::%player's uuid%::home} to "editor"
	# player settings
	else if {_command::1} is "notepad3-player-theme":
		cancel event
		add "%{_color-1}%Notepad %{_color-2}%Color Selector" and "" to {_update::*}
		add "<tooltip:%notepadGetColor(player, "&a")%><command:/notepad3-theme %{_command::2}% a>&a⬛<tooltip:%notepadGetColor(player, "&b")%><command:/notepad3-theme %{_command::2}% b>&b⬛<tooltip:%notepadGetColor(player, "&c")%><command:/notepad3-theme %{_command::2}% c>&c⬛<tooltip:%notepadGetColor(player, "&d")%><command:/notepad3-theme %{_command::2}% d>&d⬛<tooltip:%notepadGetColor(player, "&e")%><command:/notepad3-theme %{_command::2}% e>&e⬛<tooltip:%notepadGetColor(player, "&f")%><command:/notepad3-theme %{_command::2}% f>&f⬛<tooltip:%notepadGetColor(player, "&0")%><command:/notepad3-theme %{_command::2}% 0>&0⬛<tooltip:%notepadGetColor(player, "&1")%><command:/notepad3-theme %{_command::2}% 1>&1⬛" to {_update::*}
		add "<tooltip:%notepadGetColor(player, "&2")%><command:/notepad3-theme %{_command::2}% 2>&2⬛<tooltip:%notepadGetColor(player, "&3")%><command:/notepad3-theme %{_command::2}% 3>&3⬛<tooltip:%notepadGetColor(player, "&4")%><command:/notepad3-theme %{_command::2}% 4>&4⬛<tooltip:%notepadGetColor(player, "&5")%><command:/notepad3-theme %{_command::2}% 5>&5⬛<tooltip:%notepadGetColor(player, "&6")%><command:/notepad3-theme %{_command::2}% 6>&6⬛<tooltip:%notepadGetColor(player, "&7")%><command:/notepad3-theme %{_command::2}% 7>&7⬛<tooltip:%notepadGetColor(player, "&8")%><command:/notepad3-theme %{_command::2}% 8>&8⬛<tooltip:%notepadGetColor(player, "&9")%><command:/notepad3-theme %{_command::2}% 9>&9⬛" to {_update::*}
		add "" and "<tooltip:%{_color-2}%Hex %{_color-3}%Click this to choose a hex color><command:/notepad3-hex %{_command::2}%>%{_color-3}%Hex %{_color-2}%(Click)" to {_update::*}
		notepadUpdate(player, {_update::*})
	else if {_command::1} is "notepad3-player-formatting":
		cancel event
		if player has permission "skript.notepad.formatting":
			if {Notepad::Users::%player's uuid%::formatting::*} contains "tooltip":
				set {_tooltip-status} to "&aEnabled"
			else:
				set {_tooltip-status} to "&cDisabled"
			if {Notepad::Users::%player's uuid%::formatting::*} contains "command":
				set {_command-status} to "&aEnabled"
			else:
				set {_command-status} to "&cDisabled"
			if {Notepad::Users::%player's uuid%::formatting::*} contains "suggest":
				set {_suggest-status} to "&aEnabled"
			else:
				set {_suggest-status} to "&cDisabled"
			if {Notepad::Users::%player's uuid%::formatting::*} contains "link":
				set {_link-status} to "&aEnabled"
			else:
				set {_link-status} to "&cDisabled"
			notepadUpdate(player, ("%{_color-1}%Notepad %{_color-2}%Formatting", "", "<tooltip:%{_color-2}%Tooltips %{_color-3}%Click to enable><command:/notepad3-formatting tooltip>%{_color-3}%Tooltips %{_tooltip-status}%", "<tooltip:%{_color-2}%Commands %{_color-3}%Click to enable><command:/notepad3-formatting command>%{_color-3}%Commands %{_command-status}%", "<tooltip:%{_color-2}%Suggest Command %{_color-3}%Click to enable><command:/notepad3-formatting suggest>%{_color-3}%Suggest Command %{_suggest-status}%", "<tooltip:%{_color-2}%Links %{_color-3}%Click to enable><command:/notepad3-formatting link>%{_color-3}%Links %{_link-status}%"))
		else:
			notepadUpdate(player, ("%{_color-1}%Notepad %{_color-2}%Formatting", "", "%{_color-3}%You do not have the required permission."))
	else if {_command::1} is "notepad3-theme":
		cancel event
		set {Notepad::Users::%player's uuid%::color-%{_command::2}%} to "&%{_command::3}%"
		set {_color} to notepadGetColor(player, formatted {Notepad::Users::%player's uuid%::color-%{_command::2}%})
		notepadUpdate(player, ("%{Notepad::Users::%player's uuid%::color-1}%Notepad %{Notepad::Users::%player's uuid%::color-2}%Color Selector", "", "%{Notepad::Users::%player's uuid%::color-3}%Set the theme to %{_color}%%{Notepad::Users::%player's uuid%::color-3}%."))
	else if {_command::1} is "notepad3-formatting":
		cancel event
		player has permission "skript.notepad.formatting"
		if {Notepad::Users::%player's uuid%::formatting::*} contains {_command::2}:
			remove {_command::2} from {Notepad::Users::%player's uuid%::formatting::*}
		else:
			add {_command::2} to {Notepad::Users::%player's uuid%::formatting::*}
		make player execute "/notepad3-player-formatting"
	else if {_command::1} is "notepad3-hex":
		cancel event
		set {Notepad::Users::%player's uuid%::prompt} to "%{_command::2}%|hex"
		notepadUpdate(player, ("%{_color-1}%Notepad %{_color-2}%Hex", "", "%{_color-3}%Say your hex color in the chat.", "It must be said as ""<##...>""", "%{_color-3}%To cancel type ""(cancel)"""))
	# notes settings
	else if {_command::1} is "notepad3-notes-reset":
		cancel event
		{Notepad::Files::%{_command::2}%::owner} is player's uuid
		if {Notepad::Files::%{_command::2}%::type} is "Skript":
			notepadUpdate(player, ("%{_color-1}%Notepad %{_color-2}%Reset", "", "%{_color-3}%Resetting is currently not supported for Skript files."))
			stop trigger
		set {Notepad::Users::%player's uuid%::prompt} to "%{_command::2}%|reset"
		notepadUpdate(player, ("%{_color-1}%Notepad %{_color-2}%Reset %{_color-3}%%{Notepad::Files::%{_command::2}%::name}%", "", "%{_color-3}%Please type ""yes"" if you want to reset this note.", "%{_color-3}%To cancel type ""(cancel)"""))
	else if {_command::1} is "notepad3-removeshare":
		cancel event
		remove {Notepad::Users::%player's uuid%::file} from {Notepad::Users::%player's uuid%::files::*}
		remove player's uuid from {Notepad::Files::%{Notepad::Users::%player's uuid%::file}%::shared::*}
		remove player's uuid from {Notepad::Files::%{Notepad::Users::%player's uuid%::file}%::sharedEditable::*}
		if {Notepad::Users::%player's uuid%::file} is {_file}:
			if size of {Notepad::Users::%player's uuid%::files::*} is more than 0:
				set {Notepad::Users::%player's uuid%::file} to {Notepad::Users::%player's uuid%::files::%size of {Notepad::Users::%player's uuid%::files::*}%}
			else:
				set {_file-id} to createFile(player, "Note")
				set {Notepad::Users::%player's uuid%::file} to {_file-id}
		set {Notepad::Users::%player's uuid%::home} to "editor"
		notepadUpdate(player, ("%{_color-1}%Notepad %{_color-2}%Remove", "", "%{_color-3}%Note removed."))
	# shared
	else if {_command::1} is "notepad3-shared-player":
		cancel event
		set {_p} to {_command::2} parsed as an offline player
		if {Notepad::Files::%{Notepad::Users::%player's uuid%::file}%::sharedEditable::*} contains {_p}'s uuid:
			set {_editable} to "%{_color-3}%Edit Permissions &aEnabled"
		else:
			set {_editable} to "%{_color-3}%Edit Permissions &cDisabled"
		notepadUpdate(player, ("%{_color-1}%Notepad %{_color-2}%Player %{_color-3}%%{_p}%", "", "<tooltip:%{_color-2}%Unshare %{_color-3}%Remove the note from this player.><command:/notepad3-shared-unshare %{_command::2}%>%{_color-3}%Unshare %{_color-2}%(Click)", "<tooltip:%{_color-2}%Edit Permissions %{_color-3}%Click this to change this person's edit permissions.><command:/notepad3-shared-edit %{_command::2}%>%{_editable}%"))
	else if {_command::1} is "notepad3-shared-unshare":
		cancel event
		remove {Notepad::Users::%player's uuid%::file} from {Notepad::Users::%{_command::2}%::files::*}
		remove {_command::2} from {Notepad::Files::%{Notepad::Users::%player's uuid%::file}%::shared::*}
		remove {_command::2}'s uuid from {Notepad::Files::%{Notepad::Users::%player's uuid%::file}%::sharedEditable::*}
		if {Notepad::Users::%{_command::2}%::file} is {_file}:
			if size of {Notepad::Users::%{_command::2}%::files::*} is more than 0:
				set {Notepad::Users::%{_command::2}%::file} to {Notepad::Users::%{_command::2}%::files::%size of {Notepad::Users::%{_command::2}%::files::*}%}
			else:
				set {_file-id} to createFile({_command::2} parsed as an offline player, "Note")
				set {Notepad::Users::%{_command::2}%::file} to {_file-id}
		delete {Notepad::Users::%player's uuid%::info::*}
		delete {Notepad::Users::%player's uuid%::infoNow}
		delete {Notepad::Users::%player's uuid%::prompt}
		notepadUpdate(player, ("%{_color-1}%Notepad %{_color-2}%Unshare", "", "%{_color-3}%Note removed."))
	else if {_command::1} is "notepad3-shared-edit":
		cancel event
		{Notepad::Files::%{Notepad::Users::%player's uuid%::file}%::owner} is player
		if {Notepad::Files::%{Notepad::Users::%player's uuid%::file}%::sharedEditable::*} contains {_command::2}:
			remove {_command::2} from {Notepad::Files::%{Notepad::Users::%player's uuid%::file}%::sharedEditable::*}
		else:
			add {_command::2} to {Notepad::Files::%{Notepad::Users::%player's uuid%::file}%::sharedEditable::*}
		make player execute "/notepad3-shared-player %{_command::2}%"
	# share requests
	else if {_command::1} is "notepad3-request-accept":
		cancel event
		{Notepad::Users::%player's uuid%::request} is set
		add {_command::2} to {Notepad::Users::%player's uuid%::files::*}
		add player's uuid to {Notepad::Files::%{_command::2}%::shared::*}
		notepadUpdate({Notepad::Files::%{_command::2}%::owner} parsed as an offline player, ("%{_color-1}%Notepad %{_color-2}%Share", "", "%{_color-3}%Your share request has been accepted."))
		delete {Notepad::Users::%player's uuid%::info::*}
		delete {Notepad::Users::%player's uuid%::infoNow}
		delete {Notepad::Users::%player's uuid%::prompt}
	else if {_command::1} is "notepad3-request-deny":
		cancel event
		{Notepad::Users::%player's uuid%::request} is set
		notepadUpdate({Notepad::Files::%{_command::2}%::owner} parsed as an offline player, ("%{_color-1}%Notepad %{_color-2}%Share", "", "%{_color-3}%Your share request has been denied."))
		delete {Notepad::Users::%player's uuid%::info::*}
		delete {Notepad::Users::%player's uuid%::infoNow}
		delete {Notepad::Users::%player's uuid%::prompt}

function runFileCheck(p: offline player):
	set {_file} to {Notepad::Users::%{_p}'s uuid%::file}
	if {Notepad::Files::%{_file}%::*} is set:
		loop {Notepad::Users::%{_p}'s uuid%::files::*} where [{Notepad::Files::%input%::*} is not set]:
			remove loop-value from {Notepad::Users::%{_p}'s uuid%::files::*}
	else:
		remove {_file} from {Notepad::Users::%{_p}'s uuid%::files::*}
		if size of {Notepad::Users::%{_p}'s uuid%::files::*} is 0:
			set {_file-id} to createFile({_p}, "Note")
			set {Notepad::Users::%{_p}'s uuid%::file} to {_file-id}
		else:
			set {Notepad::Users::%{_p}'s uuid%::file} to {Notepad::Users::%{_p}'s uuid%::files::1}
	set {Notepad::Users::%{_p}'s uuid%::files::*} to {Notepad::Users::%{_p}'s uuid%::files::*}
	loop {Notepad::Users::%{_p}'s uuid%::files::*} where [{Notepad::Files::%input%::owner} is not {_p}'s uuid]:
		{Notepad::Files::%loop-value%::shared::*} does not contain {_p}'s uuid
		remove loop-value from {Notepad::Users::%{_p}'s uuid%::files::*}
	loop {Notepad::Users::%{_p}'s uuid%::files::*} where [{Notepad::Files::%input%::type} is "Skript"]:
		set {_dir} to {Notepad::Files::%loop-value%::dir}
		file path {_dir} is missing
		remove loop-value from {Notepad::Users::%{_p}'s uuid%::files::*} 
	if size of {Notepad::Users::%{_p}'s uuid%::files::*} is 0:
		set {_file-id} to createFile({_p}, "Note")
		set {Notepad::Users::%{_p}'s uuid%::file} to {_file-id}
	else:
		{Notepad::Users::%{_p}'s uuid%::files::*} does not contain {Notepad::Users::%{_p}'s uuid%::file}
		set {Notepad::Users::%{_p}'s uuid%::file} to {Notepad::Users::%{_p}'s uuid%::files::1}


function insert(list: strings, object: object, index: integer) :: strings:
	set {_i} to size of {_list::*}
	loop (size of {_list::*}) - ({_index}) times:
		set {_list::%{_i} + 1%} to {_list::%{_i}%}
		remove 1 from {_i}
	set {_list::%{_index} + 1%} to {_object}
	return {_list::*}

function format(id: string, s: string, sgt: string) :: string:
	set {_owner} to {Notepad::Files::%{_id}%::owner} parsed as an offline player's uuid
	if {Notepad::Users::%{_owner}%::formatting::*} does not contain "suggest":
		replace all "<suggest command:" in {_s} with "&r%{_sgt}%<&r%{_sgt}%suggest command:"
		replace all "<sgt:" in {_s} with "&r%{_sgt}%<&r%{_sgt}%sgt:"
	if {Notepad::Users::%{_owner}%::formatting::*} does not contain "tooltip":
		replace all "<tooltip:" in {_s} with "&r%{_sgt}%<&r%{_sgt}%tooltip:"
		replace all "<ttp:" in {_s} with "&r%{_sgt}%<&r%{_sgt}%ttp:"
	if {Notepad::Users::%{_owner}%::formatting::*} does not contain "command":
		replace all "<command:" in {_s} with "&r%{_sgt}%<&r%{_sgt}%command:"
		replace all "<cmd:" in {_s} with "&r%{_sgt}%<&r%{_sgt}%cmd:"
	if {Notepad::Users::%{_owner}%::formatting::*} does not contain "link":
		replace all "<link:" in {_s} with "&r%{_sgt}%<&r%{_sgt}%link:"
	return "%{_s}%"

function createFile(p: player, name: string) :: string: # Returns the folder ID
	set {_id} to random uuid
	set {Notepad::Files::%{_id}%::owner} to {_p}'s uuid
	set {Notepad::Files::%{_id}%::password} to ""
	set {Notepad::Files::%{_id}%::name} to {_name}
	set {Notepad::Files::%{_id}%::type} to "Note"
	add {_id} to {Notepad::Users::%{_p}'s uuid%::Files::*}
	return {_id}

function notepadGetColor(p: offline player, color: object) :: string:
	if {_color} is an integer:
		set {_int} to {_color}
		set {_color} to formatted {Notepad::Users::%{_p}'s uuid%::color-%{_color}%}
	if {_color} is "&a":
		set {_return} to "&aGreen"
	else if {_color} is "&b":
		set {_return} to "&bAqua"
	else if {_color} is "&c":
		set {_return} to "&cRed"
	else if {_color} is "&d":
		set {_return} to "&dLight Purple"
	else if {_color} is "&e":
		set {_return} to "&eYellow"
	else if {_color} is "&f":
		set {_return} to "&fWhite"
	else if {_color} is "&0":
		set {_return} to "&0Black"
	else if {_color} is "&1":
		set {_return} to "&1Dark Blue"
	else if {_color} is "&2":
		set {_return} to "&2Dark Green"
	else if {_color} is "&3":
		set {_return} to "&3Dark Aqua"
	else if {_color} is "&4":
		set {_return} to "&4Dark Red"
	else if {_color} is "&5":
		set {_return} to "&5Dark Purple"
	else if {_color} is "&6":
		set {_return} to "&6Gold"
	else if {_color} is "&7":
		set {_return} to "&7Gray"
	else if {_color} is "&8":
		set {_return} to "&8Dark Gray"
	else if {_color} is "&9":
		set {_return} to "&9Blue"
	else:
		set {_return} to "%{_color}%##%{Notepad::Users::%{_p}'s uuid%::hex-%{_int}%}%"
	return {_return}

function createSpaces(s: string) :: string:
	set {_s::*} to split {_s} at ""
	set {_spaces} to ""
	loop {_s::*}:
		if loop-value is ">":
			set {_spaces} to "%{_spaces}% "
			add 1 to {_i}
		else:
			exit loop
	set {_subtext} to subtext of {_s} from characters {_i} + 1 to length of {_s}
	set {_subtext} to "" if {_subtext} is not set
	return "%{_spaces}%%{_subtext}%"

command /clear:
	trigger:
		loop 100 times:
			send "hello!"