#Need help with a format

1 messages · Page 1 of 1 (latest)

balmy fox
#

I've asked on mh skript help & looked on docs nothing is what i need

tawdry hornet
#

There’s about 100 snippets that format timespans in #skript-snippets

#

You can also do some math or use (hour|minute|second)s of %timespan% to do make your own

balmy fox
tawdry hornet
#

Im not going to do it foe you. There’s pre-made snippets though.

You could probably also just use “%seconds of %timespan%% seconds”

balmy fox
tawdry hornet
#

No

#

Replace %timespan% with your actual timespan

balmy fox
#

huh?

tawdry hornet
#

And you need to fix the indentation

balmy fox
#

so %hours of {kothtimer}% ?

tawdry hornet
#

Mhmm

balmy fox
#

mm lemme test

tawdry hornet
#

But then when you get minutes that will be included as well

#

So it will say like 61min instead of 1

#

So you need to remove the hours once you get them

balmy fox
tawdry hornet
#

remove %timespan% from {_yourTimespan}

balmy fox
#

so remove mintes from {kothtimer} ?

balmy fox
#

or could i just make it like if there is 59 min it would just put hours to 0

balmy fox
tawdry hornet
#

look at the snippets for examples

#

please stop pinging me

#

you can set a local var to the seconds, then do some math

balmy fox
#

also what local var would i use

tawdry hornet
tawdry hornet
balmy fox
#

sobs i'm horrible at tis

tawdry hornet
#
set {_seconds} to seconds of {_timespan} #: should be 3710

#: 3600 seconds in 1 hour:
set {_hours} to floor({_seconds}/3600)
remove {_hours}*3600 from {_seconds}```
#

repeat as needed

balmy fox
#

mm

#
set {_seconds} to seconds of {_timespan} #: should be 3710

#: 3600 seconds in 1 hour:
set {_hours} to floor({_seconds}/3600)
remove {_hours}*3600 from {_seconds}```?
#

but how would i make it execute after it ended

tawdry hornet
#

days, hours, minutes, whatever you want to display

balmy fox
#

i so confused how this works

#

i hate being dumb to timespans

tawdry hornet
#

repeat the last 2 lines but change the number to 60 for seconds

#

or 86400 for days

obtuse quiver
#

#skript-snippets message

tawdry hornet
#
  remove {_time::days}*86400 from {_timespan}
  set {_time::hours} to floor({_timespan}/3600)
  remove {_time::hours}*3600 from {_timespan}
  set {_time::minutes} to floor({_timespan}/60)
  remove {_time::minutes}*60 from {_timespan}
  set {_time::seconds} to {_timespan}```
#

is what i use

balmy fox
#

mm

tawdry hornet
#

then just loop {_time::*}:, and use the index and value

balmy fox
#

so set {_timespan} to 2 hours, 59 minutes, 60 seconds
set {_seconds} to seconds of {_timespan} #: should be 3710

#: 3600 seconds in 1 hour:
set {_hours} to floor({_seconds}/3600)
remove {_hours}*3600 from {_seconds}

#

mm

#

so then for minutes i copy last 2 lines

#

then same for seconds

#

but how do i display it @tawdry hornet last ping dw

tawdry hornet
#

literally just put it in a message

obtuse quiver
#

birdy please format its hard for a phone user

balmy fox
#
set {_seconds} to seconds of {_timespan} #: should be 3710

#: 3600 seconds in 1 hour:
set {_hours} to floor({_seconds}/3600)
remove {_hours}*3600 from {_seconds}```
obtuse quiver
balmy fox
#

k

tawdry hornet
#

that wouldnt work

obtuse quiver
#

wait so how

balmy fox
#

?

#

i think i would display {_hours} etc

#

{_hours} {_minutes}

obtuse quiver
#

you nedd to display each variable

tawdry hornet
#

you would need to use %{_time::days}% days, %{_time::hours}% hours, ...

obtuse quiver
#

yes

balmy fox
#

how would i like make it so once the time is up it resets & starts again

obtuse quiver
#

if seconds is 0

tawdry hornet
#

use a periodical or something

balmy fox
#

k

#

uh it just shows <none>

#
    trigger:
        set {_timespan} to 2 hours, 59 minutes, 60 seconds
        set {_seconds} to seconds of {_timespan} #: should be 3710

#: 3600 seconds in 1 hour:
        set {_hours} to floor({_seconds}/3600)
        remove {_hours}*3600 from {_seconds}```
#

then i set it it just shows <none>

tawdry hornet
#

shows <none> where?

#

you arent displaying anything in that code

balmy fox
#

it works fine it just means the variables are = 0

tawdry hornet
#

you cant use local variables across events

balmy fox
#

bru

tawdry hornet
#

And I wouldnt define vars in a command and then get them

#

I would just put the code into the placeholder, that way the command doesnt need to be run every time you want to get the placeholder

balmy fox
#

huh?

#

how

#

my whole code is ```on placeholderapi placeholder request for the prefix "kothtimer":
set result to "%{_hours}% %{_minutes}% %{_seconds}%"
command /test:
trigger:
set {_timespan} to 2 hours, 59 minutes, 60 seconds
set {_seconds} to seconds of {_timespan} #: should be 3710

#: 3600 seconds in 1 hour:
set {_hours} to floor({_seconds}/3600)
remove {_hours}*3600 from {_seconds}
set {_minutes} to floor({_seconds}/3600)
remove {_minutes}*3600 from {_seconds}``` rn

tawdry hornet
#

yes

#

put the code into the placeholder event

balmy fox
#

ohh

#
        set result to "%{_hours}% %{_minutes}% %{_seconds}%"
        set {_timespan} to 2 hours, 59 minutes, 60 seconds
        set {_seconds} to seconds of {_timespan} #: should be 3710

#: 3600 seconds in 1 hour:
        set {_hours} to floor({_seconds}/3600)
        remove {_hours}*3600 from {_seconds}
        set {_minutes} to floor({_seconds}/3600)
        remove {_minutes}*3600 from {_seconds}```
#

it still showing <none>

#

how would i fix

balmy fox
tawdry hornet
#

because you are sending the result before setting the variables...

balmy fox
#

mm

tawdry hornet
#

ill respond when I'm able to, no need to be impatient

balmy fox
#

ok so i'm seeing it says 3 0 0 but if i request the placeholder in more then 1 area would it malfunction?

#

also i wanted it to like be 3 hours, then it would show 2 hours 5 minutes & 49 seconds but it aint doing that

tawdry hornet
#

its always gonna return 3 0 0, because you're setting it every time you try to get it

balmy fox
#

also i wanted it to like be 3 hours, then it would show 2 hours 5 minutes & 49 seconds but it aint doing that

#

i rlly wanted this cuz it would look cool, but ig i won't have a hologram showing how long till it starts

#

i prob wont add it anymore unless some1 can make it for me

tawdry hornet
#

just set a global variable to the time it was started

#

then use time since {} in your placeholder

balmy fox
tawdry hornet
#

stop

#

pinging

#

me

#

(please)

balmy fox
#

frfr

tawdry hornet
#

okay.

finite ocean
#

There is tons of examples

finite ocean
#

its right there

#

for a minigame

#

just repurpose it

balmy fox
#

just shows <none> & i tryd setting it

paper jolt
#

Ya called it wrong.

tawdry hornet
#

Maybe send_code

raven flower
#

solved?

normal trout
#

u would need to replace %timespan% with ur actual timepsan

balmy fox
#

🤦

raven flower
#

sorry for being late

normal trout
#

^

raven flower
#

I got the ss

normal trout
#

the grammer is crazy tho

balmy fox
#

fr

raven flower
#

bro doesn't know about ? and .

#

just ,

balmy fox
#

now go look at shanes first msgs

raven flower
#

sure

#

273588 msgs by shane