05-10-2003, 04:22 PM
hi.
a few months ago, i asked if it was possible to do some sorta screensaver when the PC was idle and a solution was posted, however, the problem was that even after u hit an option key (like 1 2 3 4 etc...) it didn't reset the total idle time back to zero and frankly, there was no way, but now I have found a solution and works
I shouldn't be giving it out cause it's for my OS...but hey, it was open source the screensaver code lol
enjoy!
a few months ago, i asked if it was possible to do some sorta screensaver when the PC was idle and a solution was posted, however, the problem was that even after u hit an option key (like 1 2 3 4 etc...) it didn't reset the total idle time back to zero and frankly, there was no way, but now I have found a solution and works
I shouldn't be giving it out cause it's for my OS...but hey, it was open source the screensaver code lol
Code:
CLS
idletimesub = 1
idletime = 6
time1 = TIMER
menu:
idletimesub = 1
idletime = idletime + monkey
CLS
DO WHILE (TIMER - time1) <= idletime
LOCATE 1, 1: PRINT "menu"
LOCATE 3, 1: PRINT "1) Run Program"
LOCATE 4, 1: PRINT "2) Delete Program"
LOCATE 5, 1: PRINT "3) exit"
i$ = INKEY$
IF i$ = "1" THEN idletimesub = 0: monkey = 6: CLS : PRINT "Running program!!": SLEEP 2: GOTO menu
IF i$ = "2" THEN idletimesub = 0: monkey = 4: CLS : PRINT "Deleting program!!": SLEEP 2: GOTO menu
IF i$ = "3" THEN END
LOOP
IF idletimesub = 0 THEN
monkey = 8
GOTO menu
END IF
DO
IF idletimesub = 1 THEN
i$ = INKEY$
IF (TIMER - time1) >= idletime THEN LOCATE 7, 1: PRINT "Idle": GOTO ss
IF i$ <> "" THEN time1 = TIMER
END IF
LOOP UNTIL i$ = CHR$(27)
GOTO menu
ss:
SCREEN 12 'Set screen mode 12 (VGA 640*480, 16 colors)
DO WHILE quit$ <> CHR$(27)
RANDOMIZE TIMER 'Initialize randomize with the time
x% = INT(RND * 639) 'Get x-coordinate
y% = INT(RND * 479) 'Get y-coordinate
rad% = INT(RND * 150) + 10 'Get radius
col% = INT(RND * 15) + 1 'Get color
CIRCLE (x%, y%), rad%, col% 'Draw circle
SOUND 30000, .1 'Short pause, remove for slow computers
quit$ = INKEY$
IF quit$ = CHR$(27) THEN EXIT DO
IF quit$ <> CHR$(27) THEN GOTO ss
quit$ = ""
LOOP 'UNTIL LEN(quit$)
quit$ = ""
idletime = 6
time1 = TIMER
GOTO menu
enjoy!