Have the info for script, just don't know how to put it together

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
BananaMana
Posts: 2
Joined: 16 Jun 2021, 16:59

Have the info for script, just don't know how to put it together

16 Jun 2021, 17:08

I have the guts for a script that i'd like to put together, i'm just new and I don't know exactly HOW to get it all working. I'd like to press a key like F12 to start this code that repeats until I tell it to stop, bonus points if I can keep the window minimized and have all these clicks still register

Code: Select all

F12::
    if !init
    {
        WinGetActiveTitle, winid
        init := F12
    }

Click, 478 867
Sleep 3000
Send Blah blah blah
Sleep 3000
Click, 786 650
Sleep 900000
Click, 245 871
Sleep 420000
Send, F10
Sleep 3000
Send, Q
Sleep 60000
Click, 439 854
Sleep 30000
((REPEAT FROM TOP "CLICK, 478 867")
[Mod edit: [code][/code] tags added.]


Any help or advice or pointers in the right direction would be much appreciated!
User avatar
mikeyww
Posts: 26935
Joined: 09 Sep 2014, 18:38

Re: Have the info for script, just don't know how to put it together

16 Jun 2021, 17:51

Here is an example of a toggle. You can replace the hotkey & code inside braces.

https://www.autohotkey.com/boards/viewtopic.php?p=405563#p405563

ControlSend might work for sending to non-minimized inactive windows.
BananaMana
Posts: 2
Joined: 16 Jun 2021, 16:59

Re: Have the info for script, just don't know how to put it together

16 Jun 2021, 18:11

TY. Does this look about right for a starting point?

Code: Select all

#MaxThreadsPerHotkey 2
F12::
on := !on
While on {
Click 478 867
Sleep, 3000
Send blah blah blah
Sleep, 3000
Click 786 650
Sleep, 900000
Click 245 871
Sleep, 420000
Send F10
Sleep, 3000
Send Q
Sleep, 60000
Click 439 854
Sleep, 30000
}
Return
User avatar
mikeyww
Posts: 26935
Joined: 09 Sep 2014, 18:38

Re: Have the info for script, just don't know how to put it together

16 Jun 2021, 21:32

It's worth a go, but you need not take my word for it. You can just try the script, to see whether it works. Keep in mind that the entire iteration will need to complete, once it is started, unless you decide to add conditional statements into the loop to break out of it or skip commands. Another option is to Reload to turn it off.

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: Google [Bot], inseption86, mikeyww and 468 guests