Avoid AFK Kick/Idle Kick for Battlefield 1?

Ask gaming related questions (AHK v1.1 and older)
ojgnay
Posts: 2
Joined: 10 Nov 2016, 10:39

Avoid AFK Kick/Idle Kick for Battlefield 1?

10 Nov 2016, 10:54

I'd like to know if it's possible to idle in Battlefield 1 in this manner and a creation of this simple script.

send L
delay 20 seconds
send L again
delay 20 seconds
send enter
delay 20 seconds
repeat

I've tried it myself, but seemingly it doesn't want input these commands to bring up the squad chat (with l), then type the letter l, then enter the message with {enter}.

this is the script I tried to do.

Code: Select all

#Persistent
SetTimer, PressTheKey, 20000
Return

PressTheKey:
Send,l
Sleep, 20000
Send,l
Sleep, 20000
Send, {enter}
Return
I'm pretty sure any Battlefield game you could try to test this to see if it works. Can anyone figure out what I'm doing wrong and how I could possibly afk in this game?
User avatar
WAZAAAAA
Posts: 88
Joined: 13 Jan 2015, 19:48

Re: Avoid AFK Kick/Idle Kick for Battlefield 1?

10 Nov 2016, 12:01

Many games ignore inputs when you don't simulate long enough DOWN events. If a game runs at 30 frames per second, you may want to make your Send commands hold buttons DOWN for at least 33.34 milliseconds (Sleep,50 would be fine), try this one maybe:

Code: Select all

SendMode,Event

loop
{
	Send,{l down}
	Sleep,50
	Send,{l up}
	Sleep,20000
	Send,{l down}
	Sleep,50
	Send,{l up}
	Sleep,20000
	Send,{enter down}
	Sleep,50
	Send,{enter up}
	Sleep,20000
}
Additionally, some games only support certain Send methods. If Input doesn't work, try Event. If Event doesn't work, try Play.
Some user made a useful tool to check what kind of inputs your application may or may not support, so check it out if you still have problems: https://autohotkey.com/board/topic/9565 ... -tool-v41/
YOU'RE NOT ALEXANDER
ojgnay
Posts: 2
Joined: 10 Nov 2016, 10:39

Re: Avoid AFK Kick/Idle Kick for Battlefield 1?

10 Nov 2016, 15:12

WAZAAAAA wrote:Many games ignore inputs when you don't simulate long enough DOWN events. If a game runs at 30 frames per second, you may want to make your Send commands hold buttons DOWN for at least 33.34 milliseconds (Sleep,50 would be fine), try this one maybe:

Code: Select all

SendMode,Event

loop
{
 Send,{l down}
 Sleep,50
 Send,{l up}
 Sleep,20000
 Send,{l down}
 Sleep,50
 Send,{l up}
 Sleep,20000
 Send,{enter down}
 Sleep,50
 Send,{enter up}
 Sleep,20000
}
Additionally, some games only support certain Send methods. If Input doesn't work, try Event. If Event doesn't work, try Play.
Some user made a useful tool to check what kind of inputs your application may or may not support, so check it out if you still have problems: https://autohotkey.com/board/topic/9565 ... -tool-v41/
This does seemingly work, but is there any way to get "IfWinExist,WinGet, and WinActivate" with the "Battlefield™ 1" window? This is so I could be in other applications and it could automatically go to the window and send that letter "l" to squad chat for example.

That trademark seems to throw me off a bit.
User avatar
WAZAAAAA
Posts: 88
Joined: 13 Jan 2015, 19:48

Re: Avoid AFK Kick/Idle Kick for Battlefield 1?

10 Nov 2016, 20:41

Use AU3_Spy.exe which is included in AutoHotkey's installation folder to check all sorts of window info. I don't have Battlefield 1 so I can't tell you exactly what to type.
You could try making the window matching patterns more lenient by adding a few lines to get around the TM symbol. Or use something else to recognize it, such as the executable name. Try something like this maybe:

Code: Select all

SetTitleMatchMode, 2
SetTitleMatchMode, Slow
DetectHiddenWindows, On

Loop
{
	WinActivate ahk_exe BF1.exe
	Sleep,1500
	;keys to send
}

I also recommend you to read ControlSend's documentation which is capable of sending keys to a background process. Not many games may support it, but it's worth a try.

Code: Select all

SetTitleMatchMode, 2
SetTitleMatchMode, Slow
DetectHiddenWindows, On

Loop
{
	ControlSend,,{l down},ahk_exe BF1.exe
	Sleep,50
	ControlSend,,{l up},ahk_exe BF1.exe
	Sleep,20000
	ControlSend,,{l down},ahk_exe BF1.exe
	Sleep,50
	ControlSend,,{l up},ahk_exe BF1.exe
	Sleep,20000
	ControlSend,,{enter down},ahk_exe BF1.exe
	Sleep,50
	ControlSend,,{enter up},ahk_exe BF1.exe
	Sleep,20000
}
YOU'RE NOT ALEXANDER
User avatar
YOLO
Posts: 16
Joined: 17 Nov 2015, 17:17

Re: Avoid AFK Kick/Idle Kick for Battlefield 1?

07 Mar 2018, 13:11

ojgnay wrote:
WAZAAAAA wrote:This does seemingly work, but is there any way to get "IfWinExist,WinGet, and WinActivate" with the "Battlefield™ 1" window? This is so I could be in other applications and it could automatically go to the window and send that letter "l" to squad chat for example.

That trademark seems to throw me off a bit.
Did you ever get something to work to send to the window?

Return to “Gaming Help (v1)”

Who is online

Users browsing this forum: joefiesta and 38 guests