forum.vdsworld.com Forum Index forum.vdsworld.com
Visit VDSWORLD.com
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


Timer problem (random stop)

 
Post new topic   Reply to topic    forum.vdsworld.com Forum Index -> General Help
View previous topic :: View next topic  
Author Message
filip
Valued Contributor
Valued Contributor


Joined: 07 Aug 2004
Posts: 340

PostPosted: Tue Feb 01, 2005 3:03 pm    Post subject: Timer problem (random stop) Reply with quote

I dont know why the timer just stop itself.

Example:
System shutdown preset with 30 minutes in seconds so a delay is made on current time

Problem:
Countdown timer randomly stops


I recently upgrade system with newer graphics card and better PSU (power) the cpu is the same

AMD 1700+
768 DDR
FX 5600
PSU 350W
Back to top
View user's profile Send private message Send e-mail
Serge
Professional Member
Professional Member


Joined: 04 Mar 2002
Posts: 1480
Location: Australia

PostPosted: Wed Feb 02, 2005 1:01 am    Post subject: Reply with quote

filip,

showing the code part of how you use the timer will help folks help you Smile

serge

_________________
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
filip
Valued Contributor
Valued Contributor


Joined: 07 Aug 2004
Posts: 340

PostPosted: Wed Feb 02, 2005 6:22 am    Post subject: Reply with quote

Here you go...

:loop
wait event,0
goto @event()

:Half hourMENU
%K = 1800
%b = %T
Dialog disable,Time
Dialog disable,BUTTON1
Dialog set,Time2, 30 minutes
goto loop

:Evloop
wait event,0
goto @event()

:Timer
%t = @datetime(hh:nn)
dialog set,time,%T
IF @Equal(%T,%B)
goto newloop
end

:newloop
%E = @event()
%k = @pred(%K)
dialog set,status1,Shutdown in %K s...
wait event,1
if @equal(%E,BUTTON2)
stop
run sysoff.exe
exit
end
if @equal(%K,0)
runh Shutdown.exe -s -t 00
end
goto evloop
Back to top
View user's profile Send private message Send e-mail
Serge
Professional Member
Professional Member


Joined: 04 Mar 2002
Posts: 1480
Location: Australia

PostPosted: Wed Feb 02, 2005 1:15 pm    Post subject: Reply with quote

your problem seems to be in the part of the code

Code:
 IF @Equal(%T,%B)
goto newloop
end


because it will stop your timer once the current time is ahead by 1 minute compared to the time you have set

in other words, your timer will count down as long as the current time is the same as the time set, but once it goes on to the next minute, then your IF condition is no longer met

hope i explained it right

serge

_________________
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
filip
Valued Contributor
Valued Contributor


Joined: 07 Aug 2004
Posts: 340

PostPosted: Wed Feb 02, 2005 6:13 pm    Post subject: Reply with quote

yes

i use very poor timer

i never look the timer.dsc sample


where to put: timer stop,%T or mybe timer stop,1


Thanks anyway
Back to top
View user's profile Send private message Send e-mail
DavidR
Contributor
Contributor


Joined: 05 Aug 2003
Posts: 83
Location: Bethel Pennsylvania U.S.A.

PostPosted: Fri Feb 04, 2005 11:55 am    Post subject: Timer frustration Reply with quote

I've given up on using the VDS TIMER function.
I've spent hours trying to get this to work reliably without success.
I would preload the timer with a value and on the next timer read would get the timers previous value instead of the value I loaded. Also trying to restart a timer with less than 1 second left would sometimes fail. I tried numerous work-arounds but finally gave up.
Now I grab the system time when starting a timer - like this:
Code:
%%TEMP2 = @SUBSTR(@DATETIME(),7,15)

and compare with offsets to create my own timers.
This has worked flawlessly!
I'm not discounting the possibility that I'm doing something wrong with the VDS TIMER but I can only struggle for so long, then I look for another solution.
...........David
Back to top
View user's profile Send private message
filip
Valued Contributor
Valued Contributor


Joined: 07 Aug 2004
Posts: 340

PostPosted: Fri Feb 04, 2005 2:03 pm    Post subject: Reply with quote

from script was removed ?

IF @greater(%T,%A)
goto newloop
end

With this code works but i get minus values of %K
Back to top
View user's profile Send private message Send e-mail
Serge
Professional Member
Professional Member


Joined: 04 Mar 2002
Posts: 1480
Location: Australia

PostPosted: Sat Feb 05, 2005 1:02 am    Post subject: Reply with quote

i need to point out that there are 2 timers in vds, in very general terms,

1. there is the label :TIMER which filip is using,

2. there is the TIMER command and the @TIMER() function, which i assume David is talking about. I have had problems with TIMER and @TIMER() but once i understood how it reported the timer values, i have not had any problems.

Note that 1. and 2. are not the same

serge

_________________
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
DavidR
Contributor
Contributor


Joined: 05 Aug 2003
Posts: 83
Location: Bethel Pennsylvania U.S.A.

PostPosted: Mon Feb 07, 2005 12:46 pm    Post subject: Reply with quote

Quote:
i need to point out that there are 2 timers in vds, in very general terms,

1. there is the label :TIMER which filip is using,

2. there is the TIMER command and the @TIMER() function, which i assume David is talking about. I have had problems with TIMER and @TIMER() but once i understood how it reported the timer values, i have not had any problems.

Note that 1. and 2. are not the same


Embarassed You are exactly correct Serge. I wasn't paying close enough attention when I read his post.
My problems with the TIMER command were in the "sub-second" range and probably was not what the timer was originally intended for.
The beauty of VDS is that there's almost always some other way available to achieve the desired results.
..............David
Back to top
View user's profile Send private message
Serge
Professional Member
Professional Member


Joined: 04 Mar 2002
Posts: 1480
Location: Australia

PostPosted: Mon Feb 07, 2005 2:07 pm    Post subject: Reply with quote

no sweat Smile

Quote:
The beauty of VDS is that there's almost always some other way available to achieve the desired results.


i so agree with you Smile

serge

_________________
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
Display posts from previous:   
Post new topic   Reply to topic    forum.vdsworld.com Forum Index -> General Help All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum

Twitter@vdsworld       RSS

Powered by phpBB © 2001, 2005 phpBB Group