Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

DarkBASIC Professional Discussion / Do something after set amount of time (Help)

Author
Message
madmaz
17
Years of Service
User Offline
Joined: 14th Mar 2009
Location:
Posted: 11th Nov 2011 10:34
Hello again, I'm sorry for not being the most active person on the board but I don't really have much time to be online.

I have recently run into a problem. I was trying to make a simple program to write text letter by letter while doing something's in the background (So "wait" is out of the question) but I found that it was really hard to make it. I had a lot of if clauses. I was wondering if there is any way to make a function that does something along these lines:

Start timer
Check if timer is in the set time
return value = 1 (true)

pause function until needed again.

Thanks in advance

Programing is not as easy as it seems at first... the learning is never really over...
Pincho Paxton
23
Years of Service
User Offline
Joined: 8th Dec 2002
Location:
Posted: 11th Nov 2011 13:37
If T <= Timer()
T = Timer() + 1000

`Type a letter code

Endif

chafari
Valued Member
20
Years of Service
User Offline
Joined: 2nd May 2006
Location: Canary Islands
Posted: 11th Nov 2011 22:23
I have not understood exactly what you ask for. Do you meant something like this:



Cheers.

I'm not a grumpy grandpa
IanM
Retired Moderator
23
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 12th Nov 2011 00:45
Why muck around with low-level timing when you can make it dead simple:


Daniel wright 2311
User Banned
Posted: 12th Nov 2011 01:01
Quote: "make ticker 1, 200 ` every 200ms = 5 times a second"


this is not a command so i am confused ianm, sorry but explain, is this in one of your plugins? if so ill downlod it and use it.

my signature keeps being erased by a mod So this is my new signature.
Grog Grueslayer
Valued Member
21
Years of Service
User Offline
Joined: 30th May 2005
Playing: Green Hell
Posted: 12th Nov 2011 02:03
You don't have IanM's Matrix1 Utilities Plugins?!?!

Yeah it's just one of the hundreds of useful commands you've been missing all these years.

Daniel wright 2311
User Banned
Posted: 12th Nov 2011 02:17
Quote: "Yeah it's just one of the hundreds of useful commands you've been missing all these years."


yea, i did download it just now, this one command saves me alot work, now i have to replace it with what i have now

my signature keeps being erased by a mod So this is my new signature.
=PRoF=
23
Years of Service
User Offline
Joined: 17th Mar 2003
Location: Milton Keynes, UK
Posted: 12th Nov 2011 20:25
Quote: "this one command saves me alot work"


I think I can say that about EVERY command from IanM's plugin lol

madmaz
17
Years of Service
User Offline
Joined: 14th Mar 2009
Location:
Posted: 18th Nov 2011 16:06
Wow, didn't expect this much help. Thank you guys, this really is a great community. Well, out of every answer here and after player about with these things I found that the best one really is "IanM's Matrix1 Utilities Plugins".

Thank you all so much. But I have yet another Question. I know timer based moviment helps every computer run the game at the same speed. So my question is. Doesn't the sync rate do that?

Programing is not as easy as it seems at first... the learning is never really over...
IanM
Retired Moderator
23
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 18th Nov 2011 17:02
Not really. It causes your program to effectively run slower on faster machines, but has no mechanism to run faster on slower machines.

Timer-based movement does do this, but movement will appear a little more choppy on the slower machines.

Daniel wright 2311
User Banned
Posted: 18th Nov 2011 17:41
Quote: "Timer-based movement does do this, but movement will appear a little more choppy on the slower machines"


This is why it is best to build your aplication for high end machines,geard to them.

you dont need to worry about frame rate compleatly on most machines this day and adge.

my signature keeps being erased by a mod So this is my new signature.
Pincho Paxton
23
Years of Service
User Offline
Joined: 8th Dec 2002
Location:
Posted: 18th Nov 2011 18:54 Edited at: 18th Nov 2011 18:54
Quote: "you dont need to worry about frame rate compleatly on most machines this day and adge."


Adge? Reminds me of Parker in Thunderbirds.

"This day 'n adge m'lady."

Daniel wright 2311
User Banned
Posted: 18th Nov 2011 23:35
lol, im a man, but ok,as long as you understood me this is all that matters, not my grammer.

my signature keeps being erased by a mod So this is my new signature.
madmaz
17
Years of Service
User Offline
Joined: 14th Mar 2009
Location:
Posted: 25th Nov 2011 10:01
Ohh right, so that's why you use timer based moviment. I guess you can learn something new everyday. Thanks guys, my problem has been solved

Programing is not as easy as it seems at first... the learning is never really over...

Login to post a reply

Server time is: 2026-07-10 01:59:21
Your offset time is: 2026-07-10 01:59:21