Start program in specific time ?

12/05/2014 22:47 mlukac89#1
Hi

Can u tell me how i can start program on my computer in computer time ?
12/05/2014 23:26 KDeluxe#2
Do you want to start an application at a given time with an AutoIt script?
  • Macros (@HOUR, @MIN, @SEC)
  • Run()

You can add the (compiled) script to your startup folder if Windows should run the application automatically. A better solution would be the Windows Task Scheduler.
12/06/2014 01:10 mlukac89#3
Ok ty i will try both

Edit:
This works nice

Code:
While 1
	If @HOUR = 02 And @MIN = 20 And @SEC = 00 Then
		ConsoleWrite("Current time : " & @HOUR & " : " & @MIN & " : " &  @SEC & @CRLF)
		Sleep(1000)
	EndIf
WEnd
12/06/2014 14:50 YatoDev#4
maybe with @SEC it fails because of that sleep put it away or make something like >= 00 And <= 02
12/06/2014 15:19 alpines#5
Warum sollte das failen? Er hat doch keinen Sleep für die Schleife selber.


You better add a Sleep(10) to the While-Condition because it'll decrease your cpu usage.
12/06/2014 21:02 YatoDev#6
Quote:
Originally Posted by alpines View Post
Warum sollte das failen? Er hat doch keinen Sleep für die Schleife selber.


You better add a Sleep(10) to the While-Condition because it'll decrease your cpu usage.
ja sry habe bei sleep(1000) irgendwie gedacht das wär außerhalb der if dann wärs natürlich fatal
12/06/2014 23:50 mlukac89#7
Quote:
Originally Posted by alpines View Post
Warum sollte das failen? Er hat doch keinen Sleep für die Schleife selber.


You better add a Sleep(10) to the While-Condition because it'll decrease your cpu usage.
How it will decrease cpu usage i dont understand ?
12/07/2014 00:08 YatoDev#8
because it dont do anything for 10 ms. 10ms are much more cpu cycles
12/07/2014 00:14 mlukac89#9
Ok ty :)
12/07/2014 02:00 alpines#10
Quote:
Originally Posted by »FlutterShy™ View Post
ja sry habe bei sleep(1000) irgendwie gedacht das wär außerhalb der if dann wärs natürlich fatal
Nein eigentlich nicht. Es wird nach @SEC gefragt und wenn man einen idealen Sleep von 1000 hätte, dann ist das egal denn es ist spielt keine Rolle ob man @SEC = 02 checkt wenn die Sekunden gerade auf 02 umgesprungen sind oder es erst bei 02.980 checkt.
12/07/2014 03:04 YatoDev#11
Quote:
Originally Posted by alpines View Post
Nein eigentlich nicht. Es wird nach @SEC gefragt und wenn man einen idealen Sleep von 1000 hätte, dann ist das egal denn es ist spielt keine Rolle ob man @SEC = 02 checkt wenn die Sekunden gerade auf 02 umgesprungen sind oder es erst bei 02.980 checkt.
ja das weis ich doch war ja nur aus versehen hab mich da verguckt mit dem sleep