- D1 Meta Docs - Denizen Script -
Home Page / Pi to one million places / Contact mcmonkey / Donate / Paste Scripts / Denizen Help /
You are browsing as a guest.
Login | Register




Search:

Listing Commands...

 View All

Found 1 match.
Nameyaml
Syntax - yaml [create]/[load:<file>]/[loadtext:<text>]/[unload]/[savefile:<file>]/[copykey:<source key> <target key> (to_id:<name>)]/[set <key>([<#>])(:<action>):<value>] [id:<name>]
Short DescriptionEdits a YAML configuration file.
Full DescriptionEdits a YAML configuration file.
This can be used for interacting with other plugins' configuration files.
It can also be used for storing your own script's data.

Use waitable syntax ("- ~yaml load:...") with load or savefile actions to avoid locking up the server during file IO.
Refer to language/~waitable.

For loading and saving, the starting path is within 'plugins/Denizen'.

Please note that all usages of the YAML command except for "load" and "savefile" arguments are purely in memory.
That means, if you use "set" to make changes, those changes will not be saved to any file, until you use "savefile".
Similarly, "create" does not create any file, instead it only creates a YAML object in RAM.

Note that the '.yml' extension is not automatically appended, and you will have to include that in filenames.

All usages of the YAML command must include the "id:" argument. This is any arbitrary name, as plaintext or from a tag,
to uniquely and globally identify the YAML object in memory. This ID can only be used by one YAML object at a type.
IDs are stored when "create" or "load" arguments are used, and only removed when "unload" is used.
If, for example, you have a unique YAML data container per-player, you might use something like "id:myscript_<player>".

For ways to use the "set" argument, refer to language/data actions.


Related Tags<yaml[<idname>].contains[<path>]>
<yaml[<idname>].read[<path>]>
<yaml[<idname>].list_keys[<path>]>

Usages

» Use to create a new YAML file.
- yaml create id:myfile


» Use to load a YAML file from disk.
- ~yaml load:myfile.yml id:myfile


» Use to modify a YAML file similarly to a flag.
- yaml id:myfile set my.key:HelloWorld


» Use to save a YAML file to disk.
- ~yaml savefile:myfile.yml id:myfile


» Use to unload a YAML file from memory.
- yaml unload id:myfile


» Use to modify a YAML file similarly to a flag.
- yaml id:myfile set my.key:+:2


» Use to modify a YAML file similarly to a flag.
- yaml id:myfile set my.key[2]:hello


» Use to modify a copy the contents of one YAML key to a new owning key.
- yaml id:myfile copykey:my.first.key my.new.key


» Use to modify a copy the contents of one YAML key to a new owning key on a different YAML file.
- yaml id:myfile copykey:my.first.key my.new.key to_id:myotherfile
Groupfile