Page 1 of 1

Help with keystrokes and timer please!!!

Posted: 23 Feb 2018, 18:59
by Damsz
I started making a script but, When it get to 2 mins on the second button that needs to be pressed, the first time its exactly 2 mins, then every time after that it changes to 4 min intervals.

__________________________________________________________________________________
F12::Pause, Toggle ;Button to Pause\Start program
F11:: ;Button to ONLY start script


SetTimer, 3000msKeyset, 3000 ; Set timer to run every 3000 milliseconds
SetTimer, 2mKeyset, 120000 ; 120000 ms = 2 minutes, so this timer label will be run every 2 minutes
SetTimer, 15mKeyset, 900000 ; 900000 ms = 15 minutes, so this timer label will be run every 15 minutes

3000msKeyset: ; 3000 ms keyset after this label
Send {LButton} ;left button mouse click
return

2mKeyset: ; 2 minute keyset after this label
Send {5}
return

15mKeyset: ; 15 minute keyset after this label
Send {4}

return
__________________________________________________________________________________



If there is a better way to make this work or any help would be much appreciated,

Re: Help with keystrokes and timer please!!!

Posted: 24 Feb 2018, 01:17
by Nwb
The only thing you forgot was the return after settimers. Let me try the script, give me a minute.

Update: It's working for me try the script after putting a 'return' after the three settimers. Nothing else is wrong. Try left clicking the script, twice, in the tray when it's running, it
should give you a log.

Re: Help with keystrokes and timer please!!!

Posted: 26 Feb 2018, 05:03
by Damsz
Still the same issue, when the script runs the timing is way different to what I have in the script.

Re: Help with keystrokes and timer please!!!

Posted: 01 Mar 2018, 20:18
by Damsz
bump

Re: Help with keystrokes and timer please!!!

Posted: 02 Mar 2018, 07:51
by evilC
Seems fine to me.
I shortened the times so that I did not have to wait so long, but it appears to fire at the correct time intervals.

Code: Select all

F12::Pause, Toggle ;Button to Pause\Start program
F11:: ;Button to ONLY start script

t := A_TickCount
SetTimer, 3000msKeyset, 3000 ; Set timer to run every 3000 milliseconds
SetTimer, 2mKeyset, 12000 ; 120000 ms = 2 minutes, so this timer label will be run every 2 minutes
SetTimer, 15mKeyset, 90000 ; 900000 ms = 15 minutes, so this timer label will be run every 15 minutes
return

3000msKeyset: ; 3000 ms keyset after this label
ToolTip % "3000msKeyset fired after " (A_TickCount - t) / 1000 " seconds"
;~ Send {LButton} ;left button mouse click
return

2mKeyset: ; 2 minute keyset after this label
ToolTip % "2mKeyset fired after " (A_TickCount - t) / 1000 " seconds"
;~ Send {5}
return

15mKeyset: ; 15 minute keyset after this label
ToolTip % "15mKeyset fired after " (A_TickCount - t) / 1000 " seconds"
;~ Send {4}

return