Skript-yaml |Adding %text% to file.

  • 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!

  • LOOKING FOR A VERSION OF SKRIPT?

    You can always check out skUnity Downloads for downloads and any other information about Skript!

Status
Not open for further replies.

KingAdmin_YT

Member
May 16, 2018
28
0
1
25
Hi, there.

In WildSkript, its has effect this
Code:
wf "something" to "file.txt"

And,
What is this effect in version of skript-yaml?

So I have found, but I dont get result.
Code:
set the comments of yaml node "test" from "config" to "First line" and "Second line"
delete the comments of yaml node "test" from "config"

set {_header::*} to "First line" and "Second line"
set the comments at the top of "config" to {_header::*}
delete  the comments at the top of "config"

set the header of "config" to "First line" and "Second line"
delete  the header of "config"
set the header of "config" to {_header::*}
Here

I don't understand how to use this.

In others word,

Code:
#Adding {_toyaml::*} to file (does not contain yaml value so like text)

Skript Version: 2.4 alpha4
Sk-yaml Version: 2.0.0
Server Version: 1.14.4
[doublepost=1564218234,1564167286][/doublepost]bump
 
Try this

Code:
command /testyaml <text>:
    trigger:
        load yaml "plugins/Skript/Boltz/test.yml" as "test"
        set {_arg1} to arg-1
        set {_var} to "yourvarhere"
        set {%{_var}%::*} to {_arg1} split by " "
        loop {%{_var}%::*}:
            set yaml value "%{_var}%.%loop-index%" from "test" to "%loop-value%"
        save yaml "test"

Result:
https://prnt.sc/olbwdg
[doublepost=1564381465,1564381326][/doublepost]if you just want to add some comments use this code
Code:
    set the header of "test" to "|-------------|" and "| Something something |" and "|-------------|"
 
  • Like
Reactions: KingAdmin_YT
Thank you for your help i tried but it is not printing to yaml.

Code:
command /setchc <text>:
    permission: op
    permission message: &cBunun için yetkin yok.
    trigger:
        if arg is set:
            set {_arg::*} to arg split at ""
            loop {_arg::*}:
                loop-value is not ""
                set {_loop-value} to loop-value
                set {_loop-value} to ChatControlRules("%loop-value%")
                if {_censored} is set:
                    set {_censored} to "%{_censored}%*%{_loop-value}%+(\W|\d|_)"
                else:
                    set {_censored} to "%{_loop-value}%+(\W|\d|_)"
            add "##Blocks '%arg%'" to {_toyaml::*}
            add "match \b(%{_censored}%*)" to {_toyaml::*}
            add "handle as swear" to {_toyaml::*}
            add " " to {_toyaml::*}
            #add {_toyaml::*} to file
            set the header of "ChatControl-rules.yml" to {_toyaml::*}
            save yaml "ChatControl-rules.yml"
            stop
        send "&cHatalı kullanım: &e/setchc <yasaklanacak kelime>"
on load:
    load yaml "plugins/ChatControl/rules/rules.yml" as "ChatControl-rules.yml"
function ChatControlRules(t: text) :: text:
    if {_t} is "a", "4" or "@":
        return "(a|4|@)"
    if {_t} is "b" or "p":
        return "(b|p)"
    if {_t} is "c", "j" or "ç":
        return "(c|j|ç)"
    if {_t} is "i", "ı", "1" or "l":
        return "(i|ı|1|l)"
    if {_t} is "e", "3" or "€":
        return "(e|3|€)"
    if {_t} is "9", "g" or "ğ":
        return "(9|g|ğ)"
    if {_t} is "o", "0" or "ö":
        return "(o|0|ö)"
    if {_t} is "u", "ü", "w" or "v":
        return "(u|ü|v|w)"
    if {_t} is "k" or "q":
        return "(k|q)"
    if {_t} is "x":
        return "(x|ks)"
    if {_t} is "y":
        return "(y|i)"
    else:
        return {_t}
 
Add this on "on (enable|load) event:"

Code:
on enable:
    load yaml "plugins/Skript/Boltz/asdasd.yml" as "asdasd"
    if yaml value "example.example" from "asdasd" is not set:
        set yaml value "example.example" from "asdasd" to true

I dont know why skript-yaml wont add yaml header when no value is set
[doublepost=1564452891,1564452735][/doublepost]
Skript:
upload_2019-7-30_9-14-31.png


Results:
upload_2019-7-30_9-14-14.png
 
Yes it worked but still I don't get result.

There is no problem, when I use it for the first time. But the first lines change when I use it a second time so it is not added. Only first lines is changing. I think we are using the wrong event.

I want the lines to be superimposed. As well, adding '##' at the beginning of each line. This shouldn't be.
 
Status
Not open for further replies.