Need help with targetting a background window for spam keys Topic is solved

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
kimcheezy
Posts: 2
Joined: 14 May 2024, 00:22

Need help with targetting a background window for spam keys

14 May 2024, 00:30

i have this script right now for spamming 3 and e, with hotkeys f4 and f5. how would i go about having this spammed to a specific window "xyz". and is it possible to have that window in the background being spammed, while i work on other things?

Code: Select all

F5:: ;On/Off with key F5
SendEactive := !SendEactive
If SendEactive
	SetTimer SendE, 200 ;spams every 200ms
Else
	SetTimer SendE, Off
Return
SendE: ;spams key e
	Send, e
Return

F4:: ;On/Off with key F4
Send3active := !Send3active
If Send3active
	SetTimer Send3, 200 ;spams every 200ms
Else
	SetTimer Send3, Off
Return
Send3: ;spams key 3
	Send, 3
Return

[Mod action: Moved topic from “Scripts and Function (v1)” because that sub-forum is for sharing finished scripts with others, not for asking for help with your scripts.]
Rohwedder
Posts: 7732
Joined: 04 Jun 2014, 08:33
Location: Germany

Re: Need help with targetting a background window for spam keys  Topic is solved

14 May 2024, 02:07

Hallo,
perhaps??:

Code: Select all

F5:: ;On/Off with key F5
If SendEactive := !SendEactive
	SetTimer SendE, 200 ;spams every 200ms
Else
	SetTimer SendE, Off
Return
SendE: ;spams key e
	ControlSend,, {e Down}, xyz
	Sleep, 30
	ControlSend,, {e Up}, xyz
Return

F4:: ;On/Off with key F4
If Send3active := !Send3active
	SetTimer Send3, 200 ;spams every 200ms
Else
	SetTimer Send3, Off
Return
Send3: ;spams key 3
	ControlSend,, {3 Down}, xyz
	Sleep, 30
	ControlSend,, {3 Up}, xyz
Return
Window xyz decides whether it wants to receive the virtual keystrokes or not.
Would you like to work (get Spam) in the lunch break (background) ?
kimcheezy
Posts: 2
Joined: 14 May 2024, 00:22

Re: Need help with targetting a background window for spam keys

14 May 2024, 02:50

omg exactly what i was looking for! thank you so much

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: Google [Bot] and 139 guests