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!

  2. LOOKING FOR A VERSION OF SKRIPT??:

    You can always check our our Wiki for downloads and any other information about Skript!

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

Skript-yaml |Adding %text% to file.

Discussion in 'Skript' started by KingAdmin_YT, Jul 26, 2019.

Thread Status:
Not open for further replies.
  1. KingAdmin_YT

    KingAdmin_YT Member

    Joined:
    May 16, 2018
    Messages:
    23
    Likes Received:
    0
    Hi, there.

    In WildSkript, its has effect this
    Code (Text):
    1. 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 (Text):
    1.  
    2. set the comments of yaml node "test" from "config" to "First line" and "Second line"
    3. delete the comments of yaml node "test" from "config"
    4.  
    5. set {_header::*} to "First line" and "Second line"
    6. set the comments at the top of "config" to {_header::*}
    7. delete  the comments at the top of "config"
    8.  
    9. set the header of "config" to "First line" and "Second line"
    10. delete  the header of "config"
    11. set the header of "config" to {_header::*}
    12.  
    Here

    I don't understand how to use this.

    In others word,

    Code (Text):
    1.  
    2. #Adding {_toyaml::*} to file (does not contain yaml value so like text)
    3.  
    Skript Version: 2.4 alpha4
    Sk-yaml Version: 2.0.0
    Server Version: 1.14.4
    --- Double Post Merged, Jul 27, 2019, Original Post Date: Jul 26, 2019 ---
    bump
     
  2. Azternaut

    Azternaut Member

    Joined:
    Feb 3, 2017
    Messages:
    15
    Likes Received:
    2
    Try this

    Code (Text):
    1. command /testyaml <text>:
    2.     trigger:
    3.         load yaml "plugins/Skript/Boltz/test.yml" as "test"
    4.         set {_arg1} to arg-1
    5.         set {_var} to "yourvarhere"
    6.         set {%{_var}%::*} to {_arg1} split by " "
    7.         loop {%{_var}%::*}:
    8.             set yaml value "%{_var}%.%loop-index%" from "test" to "%loop-value%"
    9.         save yaml "test"
    Result:
    https://prnt.sc/olbwdg
    --- Double Post Merged, Jul 29, 2019, Original Post Date: Jul 29, 2019 ---
    if you just want to add some comments use this code
    Code (Text):
    1.  
    2.     set the header of "test" to "|-------------|" and "| Something something |" and "|-------------|"
     
    • Like Like x 1
  3. KingAdmin_YT

    KingAdmin_YT Member

    Joined:
    May 16, 2018
    Messages:
    23
    Likes Received:
    0
    Thank you for your help i tried but it is not printing to yaml.

    Code (Text):
    1. command /setchc <text>:
    2.     permission: op
    3.     permission message: &cBunun için yetkin yok.
    4.     trigger:
    5.         if arg is set:
    6.             set {_arg::*} to arg split at ""
    7.             loop {_arg::*}:
    8.                 loop-value is not ""
    9.                 set {_loop-value} to loop-value
    10.                 set {_loop-value} to ChatControlRules("%loop-value%")
    11.                 if {_censored} is set:
    12.                     set {_censored} to "%{_censored}%*%{_loop-value}%+(\W|\d|_)"
    13.                 else:
    14.                     set {_censored} to "%{_loop-value}%+(\W|\d|_)"
    15.             add "##Blocks '%arg%'" to {_toyaml::*}
    16.             add "match \b(%{_censored}%*)" to {_toyaml::*}
    17.             add "handle as swear" to {_toyaml::*}
    18.             add " " to {_toyaml::*}
    19.             #add {_toyaml::*} to file
    20.             set the header of "ChatControl-rules.yml" to {_toyaml::*}
    21.             save yaml "ChatControl-rules.yml"
    22.             stop
    23.         send "&cHatalı kullanım: &e/setchc <yasaklanacak kelime>"
    24. on load:
    25.     load yaml "plugins/ChatControl/rules/rules.yml" as "ChatControl-rules.yml"
    26. function ChatControlRules(t: text) :: text:
    27.     if {_t} is "a", "4" or "@":
    28.         return "(a|4|@)"
    29.     if {_t} is "b" or "p":
    30.         return "(b|p)"
    31.     if {_t} is "c", "j" or "ç":
    32.         return "(c|j|ç)"
    33.     if {_t} is "i", "ı", "1" or "l":
    34.         return "(i|ı|1|l)"
    35.     if {_t} is "e", "3" or "€":
    36.         return "(e|3|€)"
    37.     if {_t} is "9", "g" or "ğ":
    38.         return "(9|g|ğ)"
    39.     if {_t} is "o", "0" or "ö":
    40.         return "(o|0|ö)"
    41.     if {_t} is "u", "ü", "w" or "v":
    42.         return "(u|ü|v|w)"
    43.     if {_t} is "k" or "q":
    44.         return "(k|q)"
    45.     if {_t} is "x":
    46.         return "(x|ks)"
    47.     if {_t} is "y":
    48.         return "(y|i)"
    49.     else:
    50.         return {_t}
     
  4. Azternaut

    Azternaut Member

    Joined:
    Feb 3, 2017
    Messages:
    15
    Likes Received:
    2
    Add this on "on (enable|load) event:"

    Code (Text):
    1. on enable:
    2.     load yaml "plugins/Skript/Boltz/asdasd.yml" as "asdasd"
    3.     if yaml value "example.example" from "asdasd" is not set:
    4.         set yaml value "example.example" from "asdasd" to true
    I dont know why skript-yaml wont add yaml header when no value is set
    --- Double Post Merged, Jul 30, 2019, Original Post Date: Jul 30, 2019 ---

    Skript:
    upload_2019-7-30_9-14-31.png

    Results:
    upload_2019-7-30_9-14-14.png
     
  5. KingAdmin_YT

    KingAdmin_YT Member

    Joined:
    May 16, 2018
    Messages:
    23
    Likes Received:
    0
    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.
     
    • Agree Agree x 1
Thread Status:
Not open for further replies.
Loading...