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.

Newcomers DBPro Corner / Timer Function [DBPro]

Author
Message
Steel
18
Years of Service
User Offline
Joined: 7th Apr 2006
Location:
Posted: 1st May 2006 18:59
I can't figure out how to reset the timer and to actually program an If statement to run off the time. I tried this but it didn't work and I don't understand.

Timer()=0
Load Image "Background.jpg",1
Do
If Timer()=5000
Paste Image 1,0,0
Endif
Loop
CattleRustler
Retired Moderator
21
Years of Service
User Offline
Joined: 8th Aug 2003
Location: case modding at overclock.net
Posted: 1st May 2006 19:44 Edited at: 1st May 2006 19:44
timer is read-only
you can make a var equal to timer then reset that if you like

BatVink
Moderator
21
Years of Service
User Offline
Joined: 4th Apr 2003
Location: Gods own County, UK
Posted: 1st May 2006 20:43
myTime = Timer()
Load Image "Background.jpg",1
Do
If Timer()- MyTime =5000
Paste Image 1,0,0
Endif
Loop



CattleRustler
Retired Moderator
21
Years of Service
User Offline
Joined: 8th Aug 2003
Location: case modding at overclock.net
Posted: 2nd May 2006 01:54
as Batvink has so elequintly put.

the reset might occur like:

myTime = Timer()
Load Image "Background.jpg",1
Do
If Timer()- MyTime = 5000
Paste Image 1,0,0
MyTime=Timer()
Endif
Loop

Mr X
19
Years of Service
User Offline
Joined: 25th Sep 2005
Location: Universe, milkyway, sol-system, Earth...
Posted: 2nd May 2006 10:20
This might help:
Green Gandalf
VIP Member
19
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 2nd May 2006 18:26
@CattleRustler

You suggested (with added indentation):



Is that safe? The test might miss 5000 (if you had a longer loop or a slow machine). Perhaps safer to use



?
CattleRustler
Retired Moderator
21
Years of Service
User Offline
Joined: 8th Aug 2003
Location: case modding at overclock.net
Posted: 2nd May 2006 19:27
yep that would work too, or even =>

Green Gandalf
VIP Member
19
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 3rd May 2006 00:23
Quote: "yep that would work too, or even =>"


I know - but mere "=" might not, if the activity within the loop made the timer step directly from 4999 to 5001, for example.
CattleRustler
Retired Moderator
21
Years of Service
User Offline
Joined: 8th Aug 2003
Location: case modding at overclock.net
Posted: 3rd May 2006 15:24
and I was agreeing with you.

Login to post a reply

Server time is: 2024-11-27 20:39:37
Your offset time is: 2024-11-27 20:39:37