1. 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!

Dismiss Notice
This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Addon skript-yaml v1.3.2

YAML the way it should be

  1. ShaneBee

    Supporter + Addon Developer

    Joined:
    Sep 7, 2017
    Messages:
    2,049
    Likes Received:
    145
    Sashie updated skript-yaml with a new update entry:

    More fixes

    Read the rest of this update entry...
     
  2. jaylawl

    jaylawl Well-Known Member

    Joined:
    Jan 29, 2017
    Messages:
    173
    Likes Received:
    31
    I found a bug i think:
    Code (Skript):
    1.  
    2.             set {_gui} to loop-value
    3.             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
     
  3. Sashie

    Moderator Addon Developer

    Joined:
    Jan 22, 2017
    Messages:
    50
    Likes Received:
    47
    um.. full code? that syntax isnt even from my addon
     
  4. jaylawl

    jaylawl Well-Known Member

    Joined:
    Jan 29, 2017
    Messages:
    173
    Likes Received:
    31
    Excuse me i didn't think my post through very well. Here's the full relevant bit: https://hastebin.com/gifiwabobi.sql

    As i said: the issue is that skript-yaml seems not to like loading yamls if the root of the file path doesnt start with "plugins/"
     
  5. Uzumaki

    Uzumaki Well-Known Member

    Joined:
    Feb 20, 2017
    Messages:
    290
    Likes Received:
    8
    can you add a syntax that loops all yaml files from a directory?
     
  6. ShaneBee

    Supporter + Addon Developer

    Joined:
    Sep 7, 2017
    Messages:
    2,049
    Likes Received:
    145
    isnt that already a thing?
    [​IMG]
     
    • Winner Winner x 1
  7. jaylawl

    jaylawl Well-Known Member

    Joined:
    Jan 29, 2017
    Messages:
    173
    Likes Received:
    31
    Yep it is:
    Code (Skript):
    1.     Load all YAML from directory:
    2.         ID: EffLoadYamlDirectory
    3.         Description:
    4.             Loads a directory YAML files into memory.
    5.   - The input is a directory (ie. "plugins/MyAwesomePlugin/").
    6.   - If for example a file in that directory is named test.yml then the output ID would be 'plugins/MyAwesomePlugin/test.yml'
    7.   - Using the optional filename ID would output `test.yml`
    8.         Examples:
    9.             #This isn't something you would really want to do, or is it?
    10.             load all yaml from directory "/plugins/skript-yaml/test"
    11.             loop all of the currently loaded yaml files:
    12.                 loop yaml nodes "" from loop-value-1:
    13.                     loop yaml nodes loop-value-2 from loop-value-1:
    14.                         broadcast yaml value "%loop-value-2%.%loop-value-3%" from loop-value-1
    15.         Since:
    16.             1.2
    17.         Patterns:
    18.             [re]load all [y[a]ml] from [(1¦non[(-| )]relative)] director(y|ies) %strings%
    19.             [re]load all [y[a]ml] from [(1¦non[(-| )]relative)] director(y|ies) %strings% using [the] filename as [the] id
     
    • Winner Winner x 1
  8. Uzumaki

    Uzumaki Well-Known Member

    Joined:
    Feb 20, 2017
    Messages:
    290
    Likes Received:
    8
    loop not load, I can loop only all loaded yaml files, not from a specified directory.
     
    • Funny Funny x 1
  9. Sashie

    Moderator Addon Developer

    Joined:
    Jan 22, 2017
    Messages:
    50
    Likes Received:
    47
    what specifically are you trying to do with it? what would be the point of looping unloaded yaml files?
     
  10. jaylawl

    jaylawl Well-Known Member

    Joined:
    Jan 29, 2017
    Messages:
    173
    Likes Received:
    31
    i think he's looking for functionality that e.g. SkUtilities provides where you can simply loop files in given directories
     
  11. Uzumaki

    Uzumaki Well-Known Member

    Joined:
    Feb 20, 2017
    Messages:
    290
    Likes Received:
    8
    Code (Skript):
    1. loop all yaml from directory "plugins/game/arenas":
    2.     load yaml "plugins/game/arenas/%loop-value%" as "ARENA.%loop-value%"
    but I managed to do that using this

    Code (Skript):
    1.     load all yaml from directory "plugins/game/arenas"
    2.     loop currently loaded yaml files:
    3.         loop-value contains "plugins/game/arenas/"
    4.         set {_value} to loop-value
    5.         unload yaml "plugins/game/arenas/%loop-value%.yml"
    6.         set {_name} to last element of {_value} split at "plugins/game/arenas/"
    7.         replace all ".yml" with "" in {_name}
    8.         load yaml "plugins/game/arenas/%{_name}%" as "ARENA.%{_name}%"
     
  12. Sashie

    Moderator Addon Developer

    Joined:
    Jan 22, 2017
    Messages:
    50
    Likes Received:
    47
    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
     
    • Agree Agree x 3
Loading...