As there is a new addon to handle yaml files (skript-yaml) in a new way that doesn't affect to server performance, I decided to update all the yaml files of my SuperBans skript. I experimented with some of the expressions but I can't create create the file like the one below.
Code that works, but using SkUtilities:
I need someone who can help me creating the same file with skript-yaml. (Checking if the value isn't set so it will be created in the file, setting a variable to it... The same as my code does, but using a different and better addon)
Code that works, but using SkUtilities:
code_language.skript:
on load:
file "plugins\SuperBans\config.yml" doesn't exist:
create file "plugins\SuperBans\config.yml"
set skutil yaml value "PUNISHMENTS.Notification-Type" from file "plugins\SuperBans\config.yml" to "1"
set skutil yaml value "PUNISHMENTS.Console-Notifications" from file "plugins\SuperBans\config.yml" to "true"
set skutil yaml value "PUNISHMENTS.Show-Leave-Message" from file "plugins\SuperBans\config.yml" to "false"
set skutil yaml value "PUNISHMENTS.Max-Warns" from file "plugins\SuperBans\config.yml" to "4"
set skutil yaml value "GUI.Unban-Messages" from file "plugins\SuperBans\config.yml" to "true"
set skutil yaml value "GUI.Keep-Open" from file "plugins\SuperBans\config.yml" to "true"
set skutil yaml value "GUI.Silent" from file "plugins\SuperBans\config.yml" to "false"
set skutil yaml value "SERVER.Name" from file "plugins\SuperBans\config.yml" to "Server Name"
set skutil yaml value "SERVER.Shop" from file "plugins\SuperBans\config.yml" to "https://mc.yourserver.com/shop"
set skutil yaml value "SERVER.Web" from file "plugins\SuperBans\config.yml" to "https://mc.yourserver.com/formum"
set skutil yaml value "DISALLOWED.COMMANDS.While-Frozen" from file "plugins\SuperBans\config.yml" to ""
add "spawn" to skutil yaml list "DISALLOWED.COMMANDS.While-Frozen" from file "plugins\SuperBans\config.yml"
add "warp" to skutil yaml list "DISALLOWED.COMMANDS.While-Frozen" from file "plugins\SuperBans\config.yml"
add "home" to skutil yaml list "DISALLOWED.COMMANDS.While-Frozen" from file "plugins\SuperBans\config.yml"
add "tpa" to skutil yaml list "DISALLOWED.COMMANDS.While-Frozen" from file "plugins\SuperBans\config.yml"
set skutil yaml value "DISALLOWED.COMMANDS.While-Muted" from file "plugins\SuperBans\config.yml" to ""
add "tell" to skutil yaml list "DISALLOWED.COMMANDS.While-Muted" from file "plugins\SuperBans\config.yml"
add "msg" to skutil yaml list "DISALLOWED.COMMANDS.While-Muted" from file "plugins\SuperBans\config.yml"
add "me" to skutil yaml list "DISALLOWED.COMMANDS.While-Muted" from file "plugins\SuperBans\config.yml"
set skutil yaml value "ANTISWEAR.Enabled" from file "plugins\SuperBans\config.yml" to "true"
set skutil yaml value "ANTISWEAR.Word-Replacer" from file "plugins\SuperBans\config.yml" to "*"
set skutil yaml value "ANTISWEAR.WORDS" from file "plugins\SuperBans\config.yml" to ""
add "fuck" to skutil yaml list "ANTISWEAR.WORDS" from file "plugins\SuperBans\config.yml"
add "dick" to skutil yaml list "ANTISWEAR.WORDS" from file "plugins\SuperBans\config.yml"
add "cunt" to skutil yaml list "ANTISWEAR.WORDS" from file "plugins\SuperBans\config.yml"
set skutil yaml value "MAIN.File-Name" from file "plugins\SuperBans\config.yml" to "SuperBans"
set skutil yaml value "MAIN.Check-For-Updates" from file "plugins\SuperBans\config.yml" to "true"
write "## This will be the type of notification sent on new punishments. Valid values are: '1' for messages, '2' for actionbars." at line 2 to file "plugins\SuperBans\config.yml"
write "" at line 7 to file "plugins\SuperBans\config.yml"
write "" at line 12 to file "plugins\SuperBans\config.yml"
write "" at line 17 to file "plugins\SuperBans\config.yml"
write "" at line 29 to file "plugins\SuperBans\config.yml"
write "" at line 37 to file "plugins\SuperBans\config.yml" set {OPTIONS::PUNISHMENTS::Notification-Type} to yml value "PUNISHMENTS.Notification-Type" of file "plugins\SuperBans\config.yml"
set {OPTIONS::PUNISHMENTS::Console-Notifications} to yml value "PUNISHMENTS.Console-Notifications" of file "plugins\SuperBans\config.yml"
set {OPTIONS::PUNISHMENTS::Show-Leave-Message} to yml value "PUNISHMENTS.Show-Leave-Message" of file "plugins\SuperBans\config.yml"
set {OPTIONS::PUNISHMENTS::Max-Warns} to yml value "PUNISHMENTS.Max-Warns" of file "plugins\SuperBans\config.yml"
set {OPTIONS::GUI::Unban-Messages} to yml value "GUI.Unban-Messages" of file "plugins\SuperBans\config.yml"
set {OPTIONS::GUI::Keep-Open} to yml value "GUI.Keep-Open" of file "plugins\SuperBans\config.yml"
set {OPTIONS::GUI::Silent} to yml value "GUI.Silent" of file "plugins\SuperBans\config.yml"
set {OPTIONS::SERVER::Name} to yml value "SERVER.Name" of file "plugins\SuperBans\config.yml"
set {OPTIONS::SERVER::Shop} to yml value "SERVER.Shop" of file "plugins\SuperBans\config.yml"
set {OPTIONS::SERVER::Web} to yml value "SERVER.Web" of file "plugins\SuperBans\config.yml"
set {OPTIONS::DISALLOWED::COMMANDS::While-Frozen::*} to yml list "DISALLOWED.COMMANDS.While-Frozen" of file "plugins\SuperBans\config.yml"
set {OPTIONS::DISALLOWED::COMMANDS::While-Muted::*} to yml list "DISALLOWED.COMMANDS.While-Muted" of file "plugins\SuperBans\config.yml"
set {OPTIONS::ANTISWEAR::Enabled} to yml value "ANTISWEAR.Enabled" of file "plugins\SuperBans\config.yml"
set {OPTIONS::ANTISWEAR::Word-Replacer} to yml value "ANTISWEAR.Word-Replacer" of file "plugins\SuperBans\config.yml"
set {OPTIONS::ANTISWEAR::WORDS::*} to yml list "ANTISWEAR.WORDS" of file "plugins\SuperBans\config.yml"
set {OPTIONS::MAIN::File-Name} to yml value "MAIN.File-Name" of file "plugins\SuperBans\config.yml"
set {OPTIONS::MAIN::Check-For-Updates} to yml value "MAIN.Check-For-Updates" of file "plugins\SuperBans\config.yml"
# The file looks like this:
# https://proxy.spigotmc.org/afb4b8e87e99442322d76f6d7180a7bf42a9f62c?url=https://i.imgur.com/xPYjHPB.png
I need someone who can help me creating the same file with skript-yaml. (Checking if the value isn't set so it will be created in the file, setting a variable to it... The same as my code does, but using a different and better addon)