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

Solved Convert seconds into hh:mm:ss

Discussion in 'Skript' started by xendercrafterx, Aug 24, 2018.

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

    Joined:
    May 28, 2018
    Messages:
    5
    Likes Received:
    0
    Hi how can I start counting up in seconds from when I type a command and then have another command which will stop the counting up, and then tell me how long it was between each command.

    For example: I type /command1 I wait a bit then I type /command2 and say I waited 10 seconds between typing each one, it will say, that command took you 00:00:10.
     
  2. Maezukie

    Maezukie Member

    Joined:
    May 21, 2018
    Messages:
    15
    Likes Received:
    0
    set a loop that continuously adds 1 to a variable every second once that variable reaches 60 it adds 1 to another variable(being minutes) and once again when that reaches 60 add one to another variable being hours? then another command to stop the loop
     
  3. jaylawl

    jaylawl Well-Known Member

    Joined:
    Jan 29, 2017
    Messages:
    173
    Likes Received:
    31
    Code (Skript):
    1. command /timer<text>:
    2.     trigger:
    3.  
    4.       if arg-1 = "start":
    5.           set {Timer} to now
    6.    
    7.       else if arg-2 = "stop":
    8.           set {_timespan} to difference between {Timer} and now
    9.           send "%{_timespan}%"
    10.           delete {Timer}
     
  4. xendercrafterx

    Joined:
    May 28, 2018
    Messages:
    5
    Likes Received:
    0
Thread Status:
Not open for further replies.
Loading...