skript-yaml

Addon skript-yaml v1.3.2

  • Welcome to skUnity!

    Welcome to skUnity! This is a forum where members of the Skript community can communicate and interact. Skript Resource Creators can post their Resources for all to see and use.

    If you haven't done so already, feel free to join our official Discord server to expand your level of interaction with the comminuty!

    Now, what are you waiting for? Join the community now!

Sashie updated skript-yaml with a new update entry:

More fixes

  • Fixed issue with files not loading if some keys contained integers
    • They now get converted into characters, keep this in mind when fetching data from those nodes
  • Fixed issue with elements not saving in the same order they were set
  • Fixed error when loading a file with empty nodes
  • Fixed a casting issue with lists

Read the rest of this update entry...
 
I found a bug i think:
code_language.skript:
            set {_gui} to loop-value
            replace "/home/minecraft/multicraft/servers/server36481/" in {_gui} with ""
the plugin only accepts a file if the root folder of the file is "plugins/"
i have to use the above method to make it work

otherwise it will consider the file loaded, but i can't get any contents from it
 
can you add a syntax that loops all yaml files from a directory?
isnt that already a thing?
GBUHXiV.png
 
Yep it is:
code_language.skript:
    Load all YAML from directory:
        ID: EffLoadYamlDirectory
        Description:
            Loads a directory YAML files into memory.
  - The input is a directory (ie. "plugins/MyAwesomePlugin/").
  - If for example a file in that directory is named test.yml then the output ID would be 'plugins/MyAwesomePlugin/test.yml'
  - Using the optional filename ID would output `test.yml`
        Examples:
            #This isn't something you would really want to do, or is it?
            load all yaml from directory "/plugins/skript-yaml/test"
            loop all of the currently loaded yaml files:
                loop yaml nodes "" from loop-value-1:
                    loop yaml nodes loop-value-2 from loop-value-1:
                        broadcast yaml value "%loop-value-2%.%loop-value-3%" from loop-value-1
        Since:
            1.2
        Patterns:
            [re]load all [y[a]ml] from [(1¦non[(-| )]relative)] director(y|ies) %strings%
            [re]load all [y[a]ml] from [(1¦non[(-| )]relative)] director(y|ies) %strings% using [the] filename as [the] id
 
loop not load, I can loop only all loaded yaml files, not from a specified directory.
 
i think he's looking for functionality that e.g. SkUtilities provides where you can simply loop files in given directories
 
code_language.skript:
loop all yaml from directory "plugins/game/arenas":
    load yaml "plugins/game/arenas/%loop-value%" as "ARENA.%loop-value%"

but I managed to do that using this

code_language.skript:
    load all yaml from directory "plugins/game/arenas"
    loop currently loaded yaml files:
        loop-value contains "plugins/game/arenas/"
        set {_value} to loop-value
        unload yaml "plugins/game/arenas/%loop-value%.yml"
        set {_name} to last element of {_value} split at "plugins/game/arenas/"
        replace all ".yml" with "" in {_name}
        load yaml "plugins/game/arenas/%{_name}%" as "ARENA.%{_name}%"
 
ugg this is supposed to be a yaml plugin not a file manipulation plugin... oh boy...

i suppose an expression that gets a list of `all yaml from directory "plugins/blah"` would be kind of handy though but what would you do with it if it isnt loaded, its kind of useless in my mind