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 Discussion / avoiding screensaver looping?

Author
Message
Sonic 91 Software
20
Years of Service
User Offline
Joined: 19th Mar 2005
Location: In a Cryptic Crossworld!
Posted: 4th Dec 2006 18:21
I read somewhere else that when you make a screensaver, you should include a text document that the .scr will check constantly when running to see if the screensaver is running, to avoid running the screensaver again and again when the PC's delay time has elapsed, e.g. if the PC is set to activate the screensaver when the PC is idle for 30 minutes, then a screensaver made in DB will run every 30 minutes, even if it's already running. how would I go about making the program check if the screensaver is running, to avoid running out of memory? Is it something to do with the "execute file" command, e.g.

open to read 1,"saver.txt"
read string 1,a$
close file 1
if a$="no" then execute file [screensaver]

...etc.

i have never fully understood the "execute file" command, even though i have the book and read the help in DB itself.

"Fight the good fight of faith,
Lay hold on eternal life"
-1 Timothy 6:12
Krilik
19
Years of Service
User Offline
Joined: 16th Mar 2006
Location: Arizona, USA
Posted: 4th Dec 2006 18:45
I don't know if thats true, but what you could do is create a file when the program is running, and if the file already exists then it would end the program. And then delete the file on a natural close of the screensaver.
indi
22
Years of Service
User Offline
Joined: 26th Aug 2002
Location: Earth, Brisbane, Australia
Posted: 5th Dec 2006 08:08
from what i understand you need to write a while loop.

while mouse click and or any keys are being pressed, run the screen saver.
this terminates the screen saver when you move the mouse or press a key, hence what they all do.

Sonic 91 Software
20
Years of Service
User Offline
Joined: 19th Mar 2005
Location: In a Cryptic Crossworld!
Posted: 5th Dec 2006 10:44 Edited at: 5th Dec 2006 10:56
i know i need a loop to run a screensaver, but what i mean is if the computer is set to execute a screensaver after 10 minutes of being idle, then a DB made screensaver would execute every 10 minutes after that, even if still running, therefore using up too much RAM.

scroll down to Van B's posts in this thread to see what I mean.

http://forum.thegamecreators.com/?m=forum_view&t=73724&b=10

p.s. I don't know why I bothered asking. All the information is in the above thread! Oops!

"Fight the good fight of faith,
Lay hold on eternal life"
-1 Timothy 6:12
indi
22
Years of Service
User Offline
Joined: 26th Aug 2002
Location: Earth, Brisbane, Australia
Posted: 5th Dec 2006 11:31
oops by your hand, oops by my hand, not knowing the timed execution had anything to do with it.
cheers, I will carry that on to the next user who needs screen-saver advice.

Sonic 91 Software
20
Years of Service
User Offline
Joined: 19th Mar 2005
Location: In a Cryptic Crossworld!
Posted: 5th Dec 2006 15:04
no probs, indi, glad i could help!

"Fight the good fight of faith,
Lay hold on eternal life"
-1 Timothy 6:12
Grog Grueslayer
Valued Member
19
Years of Service
User Offline
Joined: 30th May 2005
Playing: Green Hell
Posted: 6th Dec 2006 23:59
I did a screensaver test... it's a screensaver that opens a file and writes how many times the screensaver was activated.

I selected it and put the wait to 1 minute and let my computer go for 15 minutes. When I moved the mouse I opened the file it created and it only ran one time during the whole 15 minutes.

You don't have anything to worry about.

Here's the code:
indi
22
Years of Service
User Offline
Joined: 26th Aug 2002
Location: Earth, Brisbane, Australia
Posted: 7th Dec 2006 00:38
ahh last time i listen to a little blue guy.lol

Sonic 91 Software
20
Years of Service
User Offline
Joined: 19th Mar 2005
Location: In a Cryptic Crossworld!
Posted: 7th Dec 2006 09:49
cheers for that, indi, that makes me feel a whole lot better!

"Fight the good fight of faith,
Lay hold on eternal life"
-1 Timothy 6:12
indi
22
Years of Service
User Offline
Joined: 26th Aug 2002
Location: Earth, Brisbane, Australia
Posted: 7th Dec 2006 13:21
sorry mate its just fun, im dry as the sahara, you will know if i dont like you.
good luck in what your doing.

Sonic 91 Software
20
Years of Service
User Offline
Joined: 19th Mar 2005
Location: In a Cryptic Crossworld!
Posted: 7th Dec 2006 15:20
thanks indi. no hard feelings, i can be a bit too touchy sometimes!

"Fight the good fight of faith,
Lay hold on eternal life"
-1 Timothy 6:12

Login to post a reply

Server time is: 2025-05-26 03:48:50
Your offset time is: 2025-05-26 03:48:50