Discord song variable countdown.

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

BrettPlayMC

Supporter
Jan 26, 2017
715
53
28
SkUnity Street
Category: Fun

Suggested name: VariableCountdown

What I want:
I need a script that takes a variable I am making with this line:
code_language.skript:
set {song.duration} to "duration of track {_name}"
and make it countdown.
Basically I would like, when my Discord song starts, this variable to be set (I have this done as it is under "on song start by bot") and I would like it to countdown one every second so I can put this in chat, etc. Like a countdown until the song is over.

Ideas for commands:
/test - test it
Ideas for permissions:
bot.countdown.see
When I'd like it by: 4 days. :emoji_slight_smile:
[doublepost=1490311329,1490220050][/doublepost]bump.
 
I kinda get what you want, but I think this would be a simple workaround that would work too:

add this to your code:

set {song.starttime} to now

when new music starts.

and use this command:

code_language.skript:
command /checkduration:
  trigger:
    if {song.duration} is set:
      set {song.time.to.end} difference between {song.starttime} and {song.duration}
      if {song.starttime} < {song.duration}:
        message "[Discord Music] %{song.time.to.end}% until the music ends"
      if {song.starttime} > {song.duration}:
        message "[Discord Music] No music is playing now. If this is a bug, contact the administrator"

Or for a broadcast countdown:

code_language.skript:
every second in "world":
    if {song.duration} is set:
      set {song.time.to.end} difference between {song.starttime} and {song.duration}
      if {song.starttime} < {song.duration}:
        Broadcast "%{song.time.to.end}% until the music end"
 
I kinda get what you want, but I think this would be a simple workaround that would work too:

add this to your code:

set {song.starttime} to now

when new music starts.

and use this command:

code_language.skript:
command /checkduration:
  trigger:
    if {song.duration} is set:
      set {song.time.to.end} difference between {song.starttime} and {song.duration}
      if {song.starttime} < {song.duration}:
        message "[Discord Music] %{song.time.to.end}% until the music ends"
      if {song.starttime} > {song.duration}:
        message "[Discord Music] No music is playing now. If this is a bug, contact the administrator"

Or for a broadcast countdown:

code_language.skript:
every second in "world":
    if {song.duration} is set:
      set {song.time.to.end} difference between {song.starttime} and {song.duration}
      if {song.starttime} < {song.duration}:
        Broadcast "%{song.time.to.end}% until the music end"
I think I will use the command as it I suggest more efficient. I mean I like the other, automatic one but it would lag the server as checking every second is not very efficient.
 
I think I will use the command as it I suggest more efficient. I mean I like the other, automatic one but it would lag the server as checking every second is not very efficient.
The command is better.
You give the player the option to use it, instead of something that would lag and spam the chat with broadcasts.

Tell me if it works, and if possible, drop the original skript here. I may use it on my server too, if you let me.
[doublepost=1490383188,1490383110][/doublepost]Oh, and I think the "<" and ">" in the "if" needs SkQuerry
 
You need GLIBC 2.15, Bit like Minecraft different versions can have major changes

You running a VPS or Hosted?

VPS is an easy fix

Hosted, move to a compatible host
 
We will not be going through this again. That error is not Vixios fault. Whatsoever. Get out of the stone age with that 13 year old libc version. I've told you this six times now. Last time I'm going to tell you.
I am sorry and thank you greatly. Though it seems that the latest version now is 2.25..? So I will see if I can update my node to this version.