Jump to content
Sign in to follow this  
aphesia

if time = 7:00 then exit

Recommended Posts

aphesia

how can i check which time it is on my pc? i want to exit a script on a specific time (7:00 in the morning).

thansk :D

_nowdate should it be?

so

if _nowdate(3) = 7 then

exit

endif

is this correct?

Edited by aphesia

Share this post


Link to post
Share on other sites
Manko

how can i check which time it is on my pc? i want to exit a script on a specific time (7:00 in the morning).

thansk :D

Have you looked through the helpfile, at all? CLUE: ... _date...

/Manko


Yes i rush things! (I sorta do small bursts inbetween doing nothing.) Things I have rushed and reRushed:* ProDLLer - Process manager - Unload viri modules (dll) and moore...* _WinAPI_ProcessListOWNER_WTS() - Get Processes owner list...* _WinAPI_GetCommandLineFromPID() - Get commandline of target process...* _WinAPI_ThreadsnProcesses() Much info if expanded - optional Indented "Parent/Child"-style Processlist. Moore to come... eventually...

Share this post


Link to post
Share on other sites
aphesia

ye i just edited cause i found it (didnt found it before)

if _nowdate(3) = 7 then

exit

endif

is this correct?

Share this post


Link to post
Share on other sites
TerarinK

First off you cannot put time = 7:00 then exit. Check the time today then you need to have a counter time line to check this unless your just string linking them. In that case you need to declare a variable $sTime equals to a string "7:00"

If $sTime = "7:00" Then Exit

This will only work if you have gotten $sTime to give up a possible 7:00 too


0x576520616C6C206469652C206C697665206C69666520617320696620796F75207765726520696E20746865206C617374207365636F6E642E

Share this post


Link to post
Share on other sites
Manko

if _nowdate(3) = 7 then

You mean _nowtime(3)

and read through helpsection on that carefully.

Then try to display results of call with msgbox or consolewrite to better understand. :D

/Manko


Yes i rush things! (I sorta do small bursts inbetween doing nothing.) Things I have rushed and reRushed:* ProDLLer - Process manager - Unload viri modules (dll) and moore...* _WinAPI_ProcessListOWNER_WTS() - Get Processes owner list...* _WinAPI_GetCommandLineFromPID() - Get commandline of target process...* _WinAPI_ThreadsnProcesses() Much info if expanded - optional Indented "Parent/Child"-style Processlist. Moore to come... eventually...

Share this post


Link to post
Share on other sites
BlackPhoenix

You could use @HOUR to.

something like

$iTime=7

If @HOUR=$iTime then Exit

Share this post


Link to post
Share on other sites
aphesia

so this:

If $sTime = "7:00" Then Exit

or the @HOUR thingy.. the @hour thingy looks better :D

Share this post


Link to post
Share on other sites
SandelPerieanu

;Time to Exit: 22:57:00
;
Global $exit_hour = 22
Global $exit_min = 57
Global $exit_sec = 00
;
AdlibEnable('Exit_On_Time',1000)
;
While 1
   Sleep(1)
WEnd
;
Func Exit_On_Time()
   If Number(StringFormat("%02d%02d%02d", $exit_hour, $exit_min, $exit_sec)) <= Number(@HOUR & @MIN & @SEC) Then
      MsgBox(262144, '', 'Done')
      Exit 0
   EndIf
EndFunc   ;==>Exit_On_Time

Share this post


Link to post
Share on other sites
PhilRip

If @hour=7 then exit

(short, simple, works :D )

oh BlackPhoenix mentioned it already

Edited by PhilRip

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.