Sign in to follow this  
Followers 0
MaCgyver

Run Script at a particular time. Can this be done?

13 posts in this topic

I want a particular script to run at a certain time? Can autoit do this?

Share this post


Link to post
Share on other sites



I want a particular script to run at a certain time? Can autoit do this?

moin, moin...:o!

try something like this:

If @WDay = 1 Then
    Sleep(90000)
        RunFunction()
    Else
        Exit
EndIf

[font="Comic Sans Ms"][center]Powered by AutoIt3http://www.wik-eric.de/zips/Synchro2.2.2-4free.zip[/center][/font]

Share this post


Link to post
Share on other sites

#3 ·  Posted (edited)

This should work:

#Include <Date.au3>



While 1
$Time = _NowTime(4)
    If $Time == "hh:mm" Then;change hh:mm to whatever time you want it to run
        ExitLoop
    Else
        Sleep(500);you can make this longer if you don't need it to be exact
    EndIf
WEnd
;Whatever function you want to run here

Edit: I had the variable outside the while statement

Edit: And an EndIf

Edited by big_daddy

Share this post


Link to post
Share on other sites

moin, moin...:geek:!

try something like this:

If @WDay = 1 Then
    Sleep(90000)
        RunFunction()
    Else
        Exit
EndIf
:o moin?

[quote] Gilbertson's Law: Nothing is foolproof to a sufficiently talented fool.Sandro Alvares: Flaxcrack is please not noob! i can report you is stop stupid. The Post[/quote]I made this: FWD & MD5PWD()

Share this post


Link to post
Share on other sites

:o moin?

:geek:

Thanks guys. I was trying to work out something along the lines of what Big Daddy wrote.

Thanks!

Share this post


Link to post
Share on other sites

yah... it´s a north german greet at every time the day

Nice! I'll have to remember that...


[quote] Gilbertson's Law: Nothing is foolproof to a sufficiently talented fool.Sandro Alvares: Flaxcrack is please not noob! i can report you is stop stupid. The Post[/quote]I made this: FWD & MD5PWD()

Share this post


Link to post
Share on other sites

I tried the sample script in the helpfile but that gives me an error. I will further research, but thanks anyway!

Share this post


Link to post
Share on other sites

I tried the sample script in the helpfile but that gives me an error. I will further research, but thanks anyway!

Are you saying you tried my code along with a script from the help file and it didn't work? I just tested it with a few of my scripts and it worked fine.

Share this post


Link to post
Share on other sites

#Include <Date.au3>

While 1

$Time = _NowTime(4)

If $Time == "hh:mm" Then;change hh:mm to whatever time you want it to run

ExitLoop

Else

Sleep(500);you can make this longer if you don't need it to be exact

EndIf

WEnd

;Whatever function you want to run here

Are 2 equal signs there on purpose? Maybe thats the error

Share this post


Link to post
Share on other sites

Several ways to accomplish this...

- Use one of the inbuilt macros to ascertain the time and go from there (@Hour etc). This requires script to be running all the time.

- Use Windows Scheduler to launch a script at a predetermined time.

Share this post


Link to post
Share on other sites

#12 ·  Posted (edited)

Are 2 equal signs there on purpose? Maybe thats the error

from the help file under Operators:

== Tests if two values are equal (case sensitive if used with strings)

edit:

= Tests if two values are equal (case insensitive if used with strings).

Edited by herewasplato

[size="1"][font="Arial"].[u].[/u][/font][/size]

Share this post


Link to post
Share on other sites

Several ways to accomplish this...

- Use one of the inbuilt macros to ascertain the time and go from there (@Hour etc). This requires script to be running all the time.

- Use Windows Scheduler to launch a script at a predetermined time.

Sometimes I get a one track mind. Plus I haven't used Windows Scheduler in a few years, so I totally forgot it.

Thanks

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  
Followers 0