Jump to content

Recommended Posts

HotKeySet("{PAUSE}", "mExit")

MouseClick("left", 551, 23, 1)

$AfterHours = 3

$FinishTime = String(@Hour + $AfterHours) & ":" & @MIN

Do

Send("{F2}")

Sleep(1080000)

Send("{F2}")

Sleep(1080000)

Send("{F2}")

Until $FinishTime = @Hour & ":" & @MIN

Func mExit()

Exit

EndFunc

Shutdown (1)

-------------------------------

this isnt doing what i really want it to do....

all i want is a program that press f2 every 18 minutes and keeps doing that for 3 hours and then after 3 hours shutdown computer

Link to post
Share on other sites
  • Developers

Untested but should be close:

HotKeySet("{PAUSE}", "mExit")
MouseClick("left", 551, 23, 1)
$AfterHours = 3
$start = TimerInit()
While TimerDiff($Start) < $AfterHours * 60 * 60 * 1000
    Send("{F2}")
    Sleep(18 * 60 * 1000)
WEnd
Shutdown(1)
;
Func mExit()
    Exit
EndFunc  ;==>mExit

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

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
  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...