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 out 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.

Logging commands to a .txt file

Discussion in 'Skript' started by OfficialLiovo, Jun 25, 2017.

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

    OfficialLiovo Member

    Joined:
    Apr 29, 2017
    Messages:
    16
    Likes Received:
    1
    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 (Skript):
    1.        
    2. on join:
    3.     if {rank.%player%} is not "Member" or "DonarRank1" or "DonarRank2":
    4.         if file "plugins\Minedroid-Core\logs\staffcmd\%player's uuid%.txt" doesn't exists:
    5.             create file "plugins\Minedroid-Core\logs\staffcmd\%player's uuid%.txt"
    6.         if file "plugins\Minedroid-Core\logs\staffcmd\%player's uuid%.txt"'s line count is less than 2:
    7.             set line 1 in file "plugins\Minedroid-Core\logs\staffcmd\%player's uuid%.txt" to "%player's uuid% (%player%)'s Command Log:"
    8.             set line 2 in file "plugins\Minedroid-Core\logs\staffcmd\%player's uuid%.txt" to "-"
    9.  
    10.        
    11. on command:
    12.     if executor is not the console:
    13.         if {rank.%player%} is not "Member" or "DonarRank1" or "DonarRank2":
    14.             set {_line} to file "plugins\Minedroid-Core\logs\staffcmd\%player's uuid%.txt"'s line count + 1
    15.             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
     
  2. ShaneBee

    Supporter + Addon Developer

    Joined:
    Sep 7, 2017
    Messages:
    2,183
    Likes Received:
    234
    I also log the commands, but like this:

    log "WHAT TO LOG" to "LOGFOLDER/LOGNAME.log"
     
  3. ShaneBee

    Supporter + Addon Developer

    Joined:
    Sep 7, 2017
    Messages:
    2,183
    Likes Received:
    234
    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
     
  4. ShaneBee

    Supporter + Addon Developer

    Joined:
    Sep 7, 2017
    Messages:
    2,183
    Likes Received:
    234
    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.
     
  5. ShaneBee

    Supporter + Addon Developer

    Joined:
    Sep 7, 2017
    Messages:
    2,183
    Likes Received:
    234
    No, it doesn't work. It makes multiple files for each "log" and stuff. Is there another way?
     
Thread Status:
Not open for further replies.

Share This Page

Loading...