Joshuaaaa Posted November 27, 2007 Posted November 27, 2007 I've been looking for a code that will click F1 every 60 seconds or so. Anybody?
JustinReno Posted November 27, 2007 Posted November 27, 2007 (edited) Ok.. This is untested, but it should work. HotKeySet("{ESC}", "MyExit") While 1 Sleep(60000) Send("{F1}") WEnd Func MyExit () Exit EndFunc Edit: Press Escape to close it. Edited November 27, 2007 by JustinReno
Achilles Posted November 27, 2007 Posted November 27, 2007 I've been looking for a code that will click F1 every 60 seconds or so. Anybody?Generally people don't like making code for you when it appears you haven't tried anything yourself. However, this is so simple I'll give it a 10 second try: While 1 Sleep(60 * 1000) Send('{F1}') WEnd Check the helpfile for Sleep, Send and While if you don't understand anything. My Programs[list][*]Knight Media Player[*]Multiple Desktops[*]Daily Comics[*]Journal[/list]
Joshuaaaa Posted November 27, 2007 Author Posted November 27, 2007 I've been trying everything actually, I just can't find something. It's a little more complicated... what I'm trying to do is have a checkbox, saying "auto reload" for example, and when checked and "Run" is clicked, it will press down once every 60 seconds. These are what I came up with... but still wrong. Here it is: Case $Run If BitAND(GUICtrlRead($Checkbox2), $GUI_CHECKED) Then Send("{F1 Down}") Sleep(6000); 60 seconds Send("{F1 Up}") EndIf I realize what it's doing is holding F1 down for 60 seconds, or atleast I think it is, but I still can't fix it up.
Achilles Posted November 27, 2007 Posted November 27, 2007 Case $Run If BitAND(GUICtrlRead($Checkbox2), $GUI_CHECKED) Then While 1 Sleep(60 * 1000) Send('{F1}') WEnd EndIf That kind of freezes your program but a work around would be simple. My Programs[list][*]Knight Media Player[*]Multiple Desktops[*]Daily Comics[*]Journal[/list]
Joshuaaaa Posted November 27, 2007 Author Posted November 27, 2007 Got it! Though when I use it along with my first code, it is cancelled out. I've tried changing sleep times, but I don't think that has anything to do with it. This is how it looks. PS: Final question. If BitAND(GUICtrlRead($Checkbox3), $GUI_CHECKED) Then Do MouseClick ("SECONDARY") Sleep(1); 1= .01sec Until _IsPressed ("09") EndIf If BitAND(GUICtrlRead($Checkbox2), $GUI_CHECKED) Then While 1 Sleep(60000) Send("{F1}") Wend EndIf EndSwitch WEnd
Achilles Posted November 27, 2007 Posted November 27, 2007 (edited) Try looking in the helpfile for the AdlibEnable function. You would want to put this: Func _SendF1() Send("{F1}") EndFunc As a function, and then use something like: AdLibEnable('_SendF1', 60 *1000) That would go where the loop used to be. Edited November 27, 2007 by Piano_Man My Programs[list][*]Knight Media Player[*]Multiple Desktops[*]Daily Comics[*]Journal[/list]
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now