Logging commands to a .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 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.

OfficialLiovo

Member
Apr 29, 2017
16
1
0
23
Hey, I'm getting no errors on reload, but when I do a command, I get this error in console: https://hastebin.com/diroqolebu.vbs
And when I join, I get this error: https://hastebin.com/unoganuwep.vbs

Here's my code:
code_language.skript:
on join:
    if {rank.%player%} is not "Member" or "DonarRank1" or "DonarRank2":
        if file "plugins\Minedroid-Core\logs\staffcmd\%player's uuid%.txt" doesn't exists:
            create file "plugins\Minedroid-Core\logs\staffcmd\%player's uuid%.txt"
        if file "plugins\Minedroid-Core\logs\staffcmd\%player's uuid%.txt"'s line count is less than 2:
            set line 1 in file "plugins\Minedroid-Core\logs\staffcmd\%player's uuid%.txt" to "%player's uuid% (%player%)'s Command Log:"
            set line 2 in file "plugins\Minedroid-Core\logs\staffcmd\%player's uuid%.txt" to "-"

        
on command:
    if executor is not the console:
        if {rank.%player%} is not "Member" or "DonarRank1" or "DonarRank2":
            set {_line} to file "plugins\Minedroid-Core\logs\staffcmd\%player's uuid%.txt"'s line count + 1
            set line {_line} in file "plugins\Minedroid-Core\logs\staffcmd\%player's uuid%.txt" to "Date/Time : %time in timezone ""GMT""% - /%full command%"

It'd be great if I could get some help.

Signed,

Liovo
 
I tried that, but I didn't want the [<some time here>] thing, so I didn't use that. Plus it does it in skript's log folder, not my file path
 
1. You can use other path with log when you use ".." its mean 1 back folder. Example normally the log folder spawn in /plugins/script/logs/name.log

Now just easy add this:

log "bla" to "../../../plugins/Minedorid-core/logs/Staffcmd/bla.log"

i don't think this will pushibled time? I have no problem.
 
Status
Not open for further replies.