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 []: 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%.", "", "%{_color-2}%Accept", "%{_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 "&8&m &r&8[%{_color-1}%-&8]" loop {Notepad::Users::%{_p}'s uuid%::info::*}: set {_info} to "%{_info}%%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 "" set {_line} to format({_file}, {Notepad::Files::%{_file}%::lines::%{_i}%}, {_suggest}) set {_display} to "%{_display}%%{_color-2}%%{_i}%. %{_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}%&8&m &r&8[%{_scroll-up}%&8|%{_scroll-down}%&8|%{_color-1}%●&8]%newline%| %{_color-2}%Files" set {_infobox} to "%{_infobox}%%newline%&8| %{_color-2}%Note - %{_color-3}%%{Notepad::Files::%{_file}%::name}%" set {_infobox} to "%{_infobox}%%newline%&8| %{_color-2}%Version" set {_infobox} to "%{_infobox}%%newline%&8| %{_color-2}%Q&%{_color-2}%A" set {_infobox} to "%{_infobox}%%newline%&8| %{_color-2}%%{_p}%%newline%&8&m &r&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}% %{_name}%%newline%" else: set {_files} to "%{_files}%&8|%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}%&8&m &r&8[%{_color-1}%+&8|%{_color-1}%●&8|%{_color-1}%●&8|%{_previous-page}%&8|%{_next-page}%&8]&r%{_files}%&8&m &r&8[%{_color-1}%<&8|&r&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| %{_color-2}%Shared%newline%&8| %{_color-2}%Reset%newline%&8| %{_color-2}%Rename Note%newline%&8| %{_color-2}%Share Note%newline%&8| %{_color-2}%Delete Note" else if {Notepad::Users::%{_p}'s uuid%::page} is 2: set {_contents} to "&8| %{_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 "%{_color-2}%Remove%newline%%newline%%newline%%newline%" set {_infobox} to "%{_info}%&8&m &r&8[%{_previous-page}%&8|%{_next-page}%&8]&r%newline%%{_contents}%%newline%&r&8&m &r&8[%{_color-1}%<&8|&r&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● %{_color-3}%%{_player}%" else: set {_players} to "%{_players}%%newline%&8|" 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}%&8&m &r&8[%{_previous-page}%&8|%{_next-page}%&8]&r%{_players}%%newline%&r&8&m &r&8[%{_color-1}%<&8|&r&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}%&8&m &r&8[%{_previous-page}%&8|%{_next-page}%&8]&r%{_contents}%%newline%&r&8&m &r&8[%{_color-1}%<&8|&r&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}%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}%&8&m &r&8[%{_previous-page}%&8|%{_next-page}%&8]&r%{_contents}%%newline%&r&8&m &r&8[%{_color-1}%<&8|&r&cX&8]" else if {_home} is "player": set {_infobox} to "%{_info}%&8&m &r%newline%&8| %{_color-2}%Theme 1%newline%&8| %{_color-2}%Theme 2%newline%&8| %{_color-2}%Theme 3%newline%&8| %{_color-2}%Formatting%newline%&8| %newline%&r&8&m &r&8[%{_color-1}%<&8|&r&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 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 "&a⬛&b⬛&c⬛&d⬛&e⬛&f⬛&0⬛&1⬛" to {_update::*} add "&2⬛&3⬛&4⬛&5⬛&6⬛&7⬛&8⬛&9⬛" to {_update::*} add "" and "%{_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", "", "%{_color-3}%Tooltips %{_tooltip-status}%", "%{_color-3}%Commands %{_command-status}%", "%{_color-3}%Suggest Command %{_suggest-status}%", "%{_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}%", "", "%{_color-3}%Unshare %{_color-2}%(Click)", "%{_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 "": 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!"