Grabbing info from .log files

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

SkRATZ

Member
Nov 16, 2018
11
0
1
24
Im trying to find a way to grab some text that is stored in a .log file. I couldnt find any ways online

code_language.skript:
#example code
options:
    log: alog.log

on chat:
    log message to "{@log}"

command /messagelog <offline player>:
    trigger:

After this I cant find out what to do.
 
I really don't know anything about this but maybe this will promt something who does know?

code_language.skript:
on chat:
    set {_i} to 1
    loop (line count of file {@log}) times:
        add 1 to {_i}
    write "[SENDER=%player%] [MESSAGE] %message%" at line {_i} to file {@log}
command /messagelog <offline player>:
    trigger:
        loop (line count of file {@log}) times:
            if "%line loop-count in file {@log}%" contains "%arg-1"
            send "%line %loop-count% in file {@log}%" to player

This requires SkUtilities
 
Is there any way to do it without SkUtilities?
Not that I'm aware of. Why wouldn't you just get SkUtilities? Also the above code won't work it's just to kind of make it easier for someone smarter than myself.
 
Status
Not open for further replies.