#(zloyx_) About yaml

20 messages · Page 1 of 1 (latest)

real quest
#

Hello. I need to read yaml file, change some of it's values and save it in the same path. I don't understand how to get yaml, because all examples in wiki are generated or contain variable <path>. What is <path>? How to define yaml and edit it in denizen?

upper moonBOT
#

(zloyx_) About yaml

upper moonBOT
#

Hi I'm AutoThreadBot! Don't mind me, I'll just be adding the helper team to this thread so they can see it. A human will get to you soon.

real quest
#

Also how to disable security setting Error Message: Cannot read from that file path due to security settings in Denizen/config.yml.?

halcyon ice
#

What are you using yaml for?

real quest
#

(i want to add model_id to each of the models in ItemsAdder)

halcyon ice
#

<path> is just a file path from whatever OS you're using

#

!c yaml

torpid trenchBOT
# halcyon ice !c yaml
Group

file

Syntax

yaml [create]/[load:<file>]/[loadtext:<text> raw_format]/[unload]/[savefile:<file>]/[copykey:<source_key> <target_key> (to_id:<name>)]/[set <key>([<#>])(:<action>):<value> (data_type:{string}/integer/double/boolean/auto)] [id:<name>]

Short Description

Edits YAML data, especially for YAML files.

Description

Edits YAML configuration data.

This commands exists primarily for interoperability with pre-existing data files and other plugins.
It should never be used for storing data that only Denizen needs to use. Consider instead using !command flag.

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'.
The file path follows ...

halcyon ice
#

^ starting from the denizen folder

#

so if you want to read from /plugins/denizen/data/my_file.yml, you'd use data/my_file.yml as input

#

!c yaml u

torpid trenchBOT
# halcyon ice !c yaml u
Group

file

Syntax

yaml [create]/[load:<file>]/[loadtext:<text> raw_format]/[unload]/[savefile:<file>]/[copykey:<source_key> <target_key> (to_id:<name>)]/[set <key>([<#>])(:<action>):<value> (data_type:{string}/integer/double/boolean/auto)] [id:<name>]

Short Description

Edits YAML data, especially for YAML files.

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
Additional Usage Examples

... and 4 more.

halcyon ice
#

^ see the examples

real quest
#

Oh okay. I loaded file. But how can i add model_id: <something> to each key in the list?

tiny spruce
#

!pasteyaml

torpid trenchBOT
tiny spruce
#

@real quest can you post the yaml so we can see how the data structure looks like?