skUtilities parse Date

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

Runakai

Supporter
Apr 27, 2018
496
32
28
21
Hey! when i want to parse something as a text i get a error from SkUtilities. "Could not be parsed as index 2" i changed the date format in the config.yml in skript. When i dont parse it as a date i get the correct date format but the time is wrong and i can't add e.g 8 hours to it. There is no error but the time is still the same

code_language.skript:
            set {_timespan} to "%{lastlogin.%loop-value%.f}%" (parsed as date)[Does not work]
            add 8 hours to {_timespan}
            add 9 minutes to {_timespan}
 
code_language.skript:
//You need to check if {LastLogin.%loop-value%} is actually a timespan
command /timespan [<timespan>] [<text>]:
    trigger:
        if arg-1 isn't set:
            send "You must specify a timespan"
        else if arg-2 isn't set:
            send "You must specify something to convert to"
            send "(Hours, Minutes, Days, etc.)"
        else:
            send "Converting %arg-1% into %arg-2%"
            send "Success"
            set {_timespan} to arg-1 converted to arg-2

I would recommend using SkStuff
 
code_language.skript:
//You need to check if {LastLogin.%loop-value%} is actually a timespan
command /timespan [<timespan>] [<text>]:
    trigger:
        if arg-1 isn't set:
            send "You must specify a timespan"
        else if arg-2 isn't set:
            send "You must specify something to convert to"
            send "(Hours, Minutes, Days, etc.)"
        else:
            send "Converting %arg-1% into %arg-2%"
            send "Success"
            set {_timespan} to arg-1 converted to arg-2

I would recommend using SkStuff
I really don't understand it ^^ How can use SkStuff for Date parsing? Can't i add something to the timespan without a command? Like when leaving the server the variable for each player will be set to the correct format
 
you can, but I was just showing u an example of how SkStuff's date conversions work
 
What are you trying to achieve with this? There are probably better ways to do it.

Also, I wouldn't recommend skStuff, it is unstable and about to become unusable when 1.13 comes out.
 
What are you trying to achieve with this? There are probably better ways to do it.

Also, I wouldn't recommend skStuff, it is unstable and about to become unusable when 1.13 comes out.
Well, in my Friend skript i want them to know when their last login was.
[doublepost=1526394872,1526385031][/doublepost]
code_language.skript:
//You need to check if {LastLogin.%loop-value%} is actually a timespan
command /timespan [<timespan>] [<text>]:
    trigger:
        if arg-1 isn't set:
            send "You must specify a timespan"
        else if arg-2 isn't set:
            send "You must specify something to convert to"
            send "(Hours, Minutes, Days, etc.)"
        else:
            send "Converting %arg-1% into %arg-2%"
            send "Success"
            set {_timespan} to arg-1 converted to arg-2

I would recommend using SkStuff
Does Not work for me
 
Status
Not open for further replies.