how to add line in txt 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 community!

    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.

Noy

Member
Feb 18, 2018
3
0
0
Code:
options:
    접두사: &d&l[후원기록]&f
    노드: command.cashlog.*

on script load:
    create directory "후원 기록"

command /후원기록 [<text>] [<offlineplayer>] [<integer>]:
    permission: {@노드}
    permission message: {@접두사} 당신은 해당 명령어에 대한 노드가 없어 사용할 수 없습니다. &8[ {@노드} ]
    trigger:

        if arg 1 is not set:
            send "{@접두사} /후원기록 추가 [닉네임] [금액] &7- &f해당 유저의 후원 금액을 추가 합니다." to player
            stop

        if arg 1 is "추가":
            if arg 2 is set:
                if arg 3 is set:
                    if file "후원 기록/%arg 2%님의 후원 기록.txt" is exist:
                        write "%player% 님께서 %arg 2% 님의 후원 기록에 %arg 3%원을 %now%에 기록하셨습니다." at line (file "후원 기록/%arg 2%님의 후원 기록.txt"'s line count + 1) to file "후원 기록/%arg 2%님의 후원 기록.txt"
                    else:
                        create file "후원 기록/%arg 2%님의 후원 기록.txt"
                        wait 1 tick
                        write "%player% 님께서 %arg 2% 님의 후원 기록에 %arg 3%원을 %now%에 기록하셨습니다." at line (file "후원 기록/%arg 2%님의 후원 기록.txt"'s line count + 1) to file "후원 기록/%arg 2%님의 후원 기록.txt"
                    broadcast "{@접두사} &c관리자 %player% &f님께서 &e%arg 2% &f님의 후원 기록에 &6%arg 3%원 &f의 후원 기록이 추가 되었습니다."
                    stop
                send "{@접두사} 해당 유저의 후원 금액을 입력 해주시기 바랍니다." to player
                stop
            send "{@접두사} 후원 금액을 기록할 유저의 이름을 입력 해주시기 바랍니다." to player
            stop


"at line (file "후원 기록/%arg 2%님의 후원 기록.txt"'s line count + 1)" this line doesn't work
 
Use skript-yaml, and .yml not .txt

Code:
    load yaml "Databases/Test" as "Test-database"
    set yaml value "Test.New Line.Here" in "Test-database" to true
    set yaml value "Value" in "Test-database" to 24444
    save yaml "Test-database"
 
Status
Not open for further replies.