#Strictly Typed Minimalistic Timer Module

1 messages Β· Page 2 of 1

gloomy rapids
#

actually

#

I just removed it

#

Imma just push it

#

Hopefully no more future updates

red ridge
#

πŸ”₯

normal vector
#

πŸ”₯πŸ”₯

quaint vale
#

What one do I use

gloomy rapids
quaint vale
#

Oke

gloomy rapids
#

timed signal is a new thing I made it's basically allows you to add timeouts to signals

#

without promise

#

it's like promise-light

#

it has states and :Resolve

#

and also :Cancel

quaint vale
#

Like Resume?

gloomy rapids
#

have you ever used promise before

wild bane
#

lmao

quaint vale
#

No I thought you mean Resolve and Cancel were methods in the TimedSignal

gloomy rapids
#

it's basically that without fancy stuff like :finally and :andThen

gloomy rapids
wild bane
#

ironically the existance of promise is just that 1 xpcall

quaint vale
#

What about a Started signal

gloomy rapids
#

that's stupid errors will be caught anyways

#

actually

wild bane
#

you could gut everything and it still would be a promise

gloomy rapids
#

that's a great idea

wild bane
#

actually that gives a dumb idea lmao

gloomy rapids
#

Ill add that to the uhh promise-light Im making

#

wait a sec

#

no

wild bane
#

gut-promise

gloomy rapids
#

Im stupid

#

you don2t need it

#

you can wrap it inside pcall yourself

#

although an error state is nice ig

#

it's super easy to add actually

wild bane
#

I just wanna see how bare bones I can make promise be

#

screw the promise caught a exception, we gonna warn raw error message

quaint vale
#

Doesn't this Timer module have a memory leak?

wild bane
#

πŸ™

gloomy rapids
#

show me

#

if it does

quaint vale
#

ActiveTimers

gloomy rapids
#

from active timers

quaint vale
#

Oh I see

#

I was looking for nil but you have a switchback

gloomy rapids
#

yes

#

the myth

#

the legend

quaint vale
#

PromiseDark

wild bane
#

I wonder if heartbeat one was made because I showed DrSinek the ooga booga way

quaint vale
#

πŸ‘Ώ

gloomy rapids
#

looks inside

gloomy rapids
#

your ooga booga my booga booga

#

neuron activation

#

actually the real reason was using coroutines to wait out was really not a great way to handle things

wild bane
gloomy rapids
#

I just came to that conclusion

wild bane
#

becsuse promises use link list, but screw that becsuse we can just directly order functions via mixed table

wild bane
#

[1..n] are the steps and then ["final"] is the finally

gloomy rapids
#

and :finally

wild bane
#

meh

quaint vale
#

Why does Timer send 0 on the first fire

wild bane
#

it just sounds like steps to me tbh

gloomy rapids
wild bane
gloomy rapids
normal vector
#

yo sinek could you connect :stop() to .Ended

gloomy rapids
#

is it not?

#

wait a sec

normal vector
#

nah it only fires when the countdown ends

gloomy rapids
#

.Stop pauses timer midway

#

that's not wanted behaavior

normal vector
#

yeh

gloomy rapids
#

fire it yourself

#

if you really need it

normal vector
#

how

quaint vale
gloomy rapids
#

timer.Ended:Fire()

gloomy rapids
quaint vale
#

1

normal vector
#

ahhhh

#

didnt even bother doing that

quaint vale
#

You don't start counting at 0 normally?

normal vector
#

thanks

gloomy rapids
#

it actually represents how many ticks were done

quaint vale
#

And not the current tick

gloomy rapids
#

basically the current tick

wild bane
gloomy rapids
#

but I start at 0

wild bane
#

lmao

gloomy rapids
#

I need to include it probably

#

:finally is stupid tho

#

like gang what

#

is it supposed to run on resolvement?

#

or maybe the last resolvement Ig

#

it only makes sense to use these in a loading context when you have a request to some outside stuff

wild bane
#

sounds like the last andThen

gloomy rapids
#

yeah Idk why it exists

#

never needed it

#

istg luau scripters have surpassed actual lua coders

#

why do we do things much more efficiently with much better looking code 😭

fresh wave
quaint vale
#

I don't like Promise either

gloomy rapids
wild bane
#

hmmm maybe renaming :Finally to :Finished, but dunno about that

gloomy rapids
#

like whaty

#

gang excuse me

wild bane
#

all I heard is that you wanna use promises only when you're doing like http stuff lmao

gloomy rapids
#

if you want to do waiting

#

and have cancellable stuff

#

like a round system

#

use my timed signal πŸ‘…

fresh wave
wild bane
#

unless you like it

gloomy rapids
fresh wave
wild bane
#

im joking that theres more comments than lines of code

gloomy rapids
#

finally finallyCall finallyReturn πŸ₯€

#

what are we even doing

wild bane
#

finallyExplode

gloomy rapids
#

also awaitStatus is crazy aswell. You either get a request or not bro

#

you are the one supposed to handle the status

#

if you need to use awaitStatus your code sucks

gloomy rapids
quaint vale
#

What is the reasoning for using an array over a dictionary

gloomy rapids
quaint vale
#

Idk wym

wild bane
#

Ironically if they didnt bother making comments so VS people are pleased

#

it'd magically save like 300 lines

#

lmao πŸ’€

gloomy rapids
gloomy rapids
#

lines

quaint vale
gloomy rapids
#

bigger than entire remote table

quaint vale
#

Why does array do better than dictionary

gloomy rapids
#

and keeps memory low

gloomy rapids
quaint vale
#

Don’t think it actually helps with memory I feel

gloomy rapids
#

it does

#

cuz hashmaps need to get memory from different locations

quaint vale
#

You have to keep the array ID though

gloomy rapids
#

but arrays can be kept in 1 single contagious memory

gloomy rapids
#

this is dod design trust

wild bane
#

just be like C

quaint vale
#

But adding a key to a dictionary to stop you from adding a key to a dictionary doesn’t help πŸ”₯

wild bane
#

local THIS_THING = number

#

truly saved you 0 bytes

gloomy rapids
#

that's whole point

#

looping a dict is slow

quaint vale
#

I know but you said it saves memory

gloomy rapids
#

that's a more complicated reason

#

need to understand how clustering works

#

plus I doubt it changes much

#

these are cursed examples

#

promise needs to be stopped

#

you can't just wrap task.wait

#

and call it a utility module

wild bane
fresh wave
wild bane
#

so the status could be "maybe"

gloomy rapids
wild bane
#

"maybe not", "probable", "i dont know"

gloomy rapids
#

:afterWhich

#

:willBe

wild bane
#

:whenIFeelLikeIt

gloomy rapids
#

:iDontFeelLikeIt

fresh wave
wild bane
#

its for those people who get whipped for not scripting fast enough

#

so they can't bother fixing errors

gloomy rapids
#

that might be true πŸ₯€

#

and devastating

#

just get the metatable gang πŸ₯€

fresh wave
gloomy rapids
#

promise needs to be fixed

#

promise needs a hero

#

no one asked for

fresh wave
gloomy rapids
#

truly

wild bane
#

I like how we are back to just shit on overcomplicated things which should've not existed in luau

gloomy rapids
wild bane
#

Wait until you see my

#

Pise

normal vector
#

are we discussing the purpose of promise

#

why cant i spell

gloomy rapids
#

just discussing why it's so bloated

#

and why so many useless events and methods

normal vector
#

it really is

#

have you seen the sc

gloomy rapids
#

horrible

#

never again

normal vector
#

i use it but i hope they revamp it

wild bane
#

Never

gloomy rapids
wild bane
#

if it works they wont touch it

gloomy rapids
#

so I can understand the way people use it

wild bane
#

lmao

normal vector
#

.try, andThen, .is and delay

#

oh and .all

#

for batching

gloomy rapids
#

hmm

#

alr

#

seems reasonable

normal vector
#

.resolve too

gloomy rapids
#

I will also have

  • :Cancel
  • Error handling
  • :Resolve to manually resolve
#

and also PreResolve

#

and PostResolve

normal vector
#

you're making your own?

gloomy rapids
#

yes

#

less less bloated

normal vector
#

damn let me know when it's done

gloomy rapids
#

we are at 83 lines rn base is done

fresh wave
# gloomy rapids these are cursed examples

We need to introduce the creator of promise and this guy:
https://devforum.roblox.com/t/pauser-a-wait-function-but-better/3942035

wild bane
#

oh I finally got a name for :finally

#

:afterPromising

gloomy rapids
#

for a sec

#

and I was like

normal vector
#

crazy bait

gloomy rapids
#

dang it

fresh wave
gloomy rapids
#

bro basically made comments inside the function

#

with task.wait

#
--Preparing
task.wait(10)
normal vector
#

*insert gru

wild bane
fresh wave
gloomy rapids
#

πŸ’”

normal vector
#

do you guys use coroutines frequently

#

i think ive used it twice in my life

wild bane
#

I never knew that girl in my life

gloomy rapids
#

main:Lobby()

#

is crazy work

gloomy rapids
#

atp

wild bane
#

I love adding syntax sugar to stuff which dont need it

gloomy rapids
#

cuz of all the timer stuff I do

fresh wave
normal vector
# gloomy rapids A LOT

i know theres differences between it and the task library but i've never have a need to

#

what is the most obvious use case in your opinion

fresh wave
gloomy rapids
#

timer module?

normal vector
gloomy rapids
#

oh

#

task library is a coroutine wrapper with engine scheduler updating all timers

#

you can make your own task library

#

suphi made in td video

#

but you can even go more barebone

normal vector
#

damn did bro make everything in the td video

gloomy rapids
#

and do it with fully coroutines

gloomy rapids
normal vector
#

lmao everyone keeps citing it like a source

gloomy rapids
gloomy rapids
normal vector
#

pretty sick

gloomy rapids
#

best luau tuto Ive ever watched

normal vector
#

might have to check it out

wild bane
#

okay now the hardest challenge is to predict computers frame time to perfect wait n seconds

#

lmao

gloomy rapids
wild bane
#

we must get that accurate 0.1

gloomy rapids
#

oh wait

#

it's even worse

fresh wave
#

The amount of comments here will soon surpass the Nem's backpack module

gloomy rapids
#

main:Lobby(main)

#

holy shit

#

I think Im going crazy

#

not even main.Lobby(main)

#

Guys Imma make busy waiting with coroutines who support me fr πŸ€‘

fresh wave
wild bane
gloomy rapids
#

good idea

#

excellent

#

pc crasher 3000

wild bane
#

we must use every core because we paid for it

fresh wave
wild bane
#

so that actually makes me wonder

#

Suphi TD in PARALLEL

#

πŸ€‘

gloomy rapids
#

holy

wild bane
#

we gonna have 4800 enemies with 240 fps

gloomy rapids
#

I don't even know if it's possible

#

cuz of determinism

fresh wave
wild bane
#

we just gonna use actors

#

shhhh shhhhh

gloomy rapids
#

I feel like suphi td is more performant on single core

wild bane
#

Can roblox introduce a new way to cause segfault?, becsuse I wanna fast deliver parallel values back to main thread

fresh wave
#

But I don't remember TD having something like that

fresh wave
#

Use SharedTable.update() every frame

wild bane
#

oh hell nah

fresh wave
#

Truly the best decision

wild bane
#

Trust me bro once you master parallel in roblox

fresh wave
#

Put the whole TD variables in it and hit update

wild bane
#

you can make anything

fresh wave
fresh wave
#

Nested SharedTables. Guys, I'm cooking

wild bane
#

so the first thing would be is to port over the thing which rearranges pixels of a image to Obama

gloomy rapids
#

why are we using #1392625916152381580 as chat

#

lol

fresh wave
gloomy rapids
#

true tho

#

truly a competition

fresh wave
#

Let's farm some comments

fresh wave
#

How was your day? @gloomy rapids

wild bane
fresh wave
gloomy rapids
fresh wave
#

😞

gloomy rapids
#

cyall

fresh wave
wild bane
#

Yeah its late

fresh wave
wild bane
#

maybe wasnt bright idea to stay up, but it was fun so who cares

wild bane
#

yo when at promise light

gloomy rapids
wild bane
#

I want to make said Pise, but I wonder howd you even gut it lmao

#

because this technically you passing a traceback and then using xpcall to error handle

red ridge
#

these days its only promise heavy

gloomy rapids
#

promise without comment is suprisingly low

#

900 lines spend on comments

#

still 1.1k is a bit diabolical

red ridge
gloomy rapids
#

still 1.1k is huge considering no comments

#

pure code

#

although they implement a lot of stuff

#

and it actually feels like js

#

which I don't want in roblox

red ridge
gloomy rapids
#

js is already a mess on it's own and roblox doesn't need all that

#

we have your own systems js dont

#

so basically this is going to be a new take on promise

wild bane
#

Romise

#

truly

#

just a better coroutine.resumeβ„’

#

@gloomy rapids Im joking that the javascripts promise is better written than roblox promise lmao

wild bane
#

truly just port this and we got promise+\

wild bane
#

okay I just realized how messy promise is

#

πŸ˜”

wild bane
#

like you look where stuff is

#

then you realize its 1.1k lines later

#

lmaoooo

wild bane
#

@gloomy rapids totally a revolutionary way to do error handling

wild bane
#

@gloomy rapids where is there just like

#

maybe runtime error

gloomy rapids
#

Idk

#

Nothing should be named maybe in codeπŸ₯€

#

Maybe its the error code

fresh wave
gloomy rapids
#

But they decided to call it maybeRuntimeError bc it might be runtime error code

#

Stupid naming tho

wild bane
#

possibleRuntimeError

fresh wave
wild bane
#

RuntimeErrorGambit

#

ngl I think I cracked on how roblox promise is scripted, but I don't feel like recreating it because it already exists

#

lmao

red ridge
plain escarp
gloomy rapids
plain escarp
gloomy rapids
plain escarp
#

isRuntimeError?

gloomy rapids
#

Yeah

#

But since this value carries the error itself

plain escarp
#

no that's worse, it sounds like a boolean

gloomy rapids
gloomy rapids
#

Its also weird something is a runtime error or nil

#

I never needed to do this in my code ever

plain escarp
#

lol

#

this is so bad

gloomy rapids
#

Why is it only runtime error and nil

#

Error should be unified

plain escarp
#

if the only reason your variable name isnt overwriting something is because it uses a different casing rule its a bad variable name

gloomy rapids
#

Error handling should be unified

gloomy rapids
#

Disagreee

#

Thats been done so many times

#

And by very respectable coders

plain escarp
#

so has pairs()

#

doesn't make it good

gloomy rapids
plain escarp
#

pairs has been used many times, and by many respectable coders

#

your argument is trash

gloomy rapids
#

Cuz it used to be relevant

#

Duh

#

Your argument is even more trash

gloomy rapids
plain escarp
#

"people are on my side" isn't even an argument

gloomy rapids
plain escarp
#

"people have done this" isn't either

gloomy rapids
gloomy rapids
plain escarp
#

to avoid overwriting api

#

by using casing rules

gloomy rapids
gloomy rapids
gloomy rapids
#

If name is api then add _

plain escarp
#

using naming conventions to avoid overwriting api is objectively bad

#

no naming convention is objectively bad, thats what youre trying to twist my words to mean

gloomy rapids
#

Sory

#

Have better things to do rn

plain escarp
#

i also have a rule yk

#

its called dont overwrite api

#

and dont try to lazily hide the fact that youre doing it either

gloomy rapids
#

to keep code style consistent across many languages

#

this is the best way

gloomy rapids
#

this is gpts response

#

tell me what name you'd pick

#

error_result is kinda good icl

#

I would probably use that if I thought for like 3 more seconds

#

look they check for kind anyways

#

then why call it runtime error

#

there are not static error in lua anyways

#

so you can just call it resulting_error

#

or error_result

#

or simply just error_

#

all work pretty good names

#

also it's been weeks since this

#

I don't even remember the context of this code

#

but yeah this is definitely not a good way to handle errors

#

a bit unnecessary

gloomy rapids
#

v1.15 is here

  • Added IsRunning public function
  • Switched to zignal
wild bane
#

Unexpected timer update

gloomy rapids
#

v1.16 is here

  • Removed OOP
  • Destroyed flag fixed
wild bane
#

removed OOP πŸ€”

#

is it now just like a table with Signal and necessary data (ill probably just check it later)

gloomy rapids
#

it's really good

#

no more metatables

#

I became anti metatablist

wild bane
#

its like 11 pm and I have skool tomorrow

gloomy rapids
#

I can just post it here ig lol

wild bane
#

(I wonder why you became anti metatablist, I was there once until I realized its sometimes better to use metatables)

gloomy rapids
#

bro

#

code snap doesn't work

#

for some fucking reason

wild bane
#

depends on what you're doing

gloomy rapids
#

there you go

wild bane
#

I see what you're doing

#

So yeah I was there once doing that style

gloomy rapids
#

I only use this for code that I will never touch

#

Stuff like utility

#

I still use OOP

red ridge
#

is the new version backwards compatible

gloomy rapids
#

Drop in replacement

gloomy rapids
#

No functionality change

red ridge
#

πŸ’―

wild bane
#

if you dont want OOP, how about... you make it be that you just register under a name

#

Timer.register(name, config)
Timer.start(name)
Timer.stop(name)

#

Timer.get(name) <- yields if its not created

gloomy rapids
#

especially for a such small object

#

like a timer

#

I do that in remote table

#

every remote table is registered with a name

wild bane
#

you save memory by doijg that

#

very worth

#

^ I mean what I say is a joke

#

but there might actually be a use case for it

#

also if thats what you want to call "Removed OOP"

gloomy rapids
#

that's it

#

its pure references now

wild bane
#

also, thats kinda what __index metamethod does too (refrence coated in sugar)

gloomy rapids
#

unfortunately

#

__index removes the default trigger for indexing

#

and runs a different branch of code block

wild bane
#

but if you think about it

#

it's still just a refrence coated in sugar

#

Because once you get addicted then it gets hard to stop

gloomy rapids
#

😭

#

metatables are not just syntactic sugar

wild bane
#

but I still gonna insist that __index in its most simplest form is just sugar

#

πŸ€‘

gloomy rapids
#

no