Anti-Afk Scripts

Ask gaming related questions (AHK v1.1 and older)
Al_x_Hunter
Posts: 8
Joined: 30 Sep 2021, 18:05

Anti-Afk Scripts

27 Oct 2021, 10:01

Dear Community,

I have a full working Afk Script but now I would like to 1. Make the script work on the background and 2. Combine two scripts into 1. At first it should press every 40 seconds some key like W,S, A and after that it should type every 30 min "Hello". Somehow its so difficult with the Control Send Script and I would like to ask you for help. Below you can see the script I wrote. I am a rookie and would aprreciate your help.

Code: Select all

#Persistent

F3::ControlSend, Edit1, test, ahk_exe WorldofWarcraft.exe

SetTimer, PressTheKey, 39000
Return

PressTheKey:
Send, {W}
Sleep 100
Send, {A}
Sleep 100
Send, {S}
Sleep 100

Return

SetTimer, PressTheKey1, 1800000

PressTheKey1:

Send, {Enter}
Send, {H}
Send, {E}
Send, {L}
Send, {L}
Send, {O}
Send, {Enter}

Return

User avatar
mikeyww
Posts: 26888
Joined: 09 Sep 2014, 18:38

Re: Anti-Afk Scripts

27 Oct 2021, 12:05

Nothing will work after line 3 because it contains an implicit Return command.

Furthermore, subsequent unlabeled code following Return is also unreachable and will never execute even after fixing line 3.

Does line 3 work by itself?

Explained: Auto-execute
Al_x_Hunter
Posts: 8
Joined: 30 Sep 2021, 18:05

Re: Anti-Afk Scripts

05 Nov 2021, 11:06

Thank you. Yeah line 3 works great. What I am trying is to combine those 2 scripts in one how does it work? My solution did not work cuz of the Return yeah? But if i put away the return it will wait 1 hour after the script restart. What I need is that the script press all 40 seconds W, A, S, D etc. and apart of that it should type every 1 hour "Hello"
User avatar
mikeyww
Posts: 26888
Joined: 09 Sep 2014, 18:38

Re: Anti-Afk Scripts

05 Nov 2021, 11:21

Here is an example. You can adjust the timer frequencies and anything else. If you read the link that I posted, you can learn about the auto-execute section.

Code: Select all

Gosub, WAS
SetTimer, WAS, 400
SetTimer, Hello, 1800
Hello:
Send `nHello`n
Return

F3::ControlSend, Edit1, test, ahk_exe WorldofWarcraft.exe

WAS:
SetKeyDelay, 100
Send was
Return

Return to “Gaming Help (v1)”

Who is online

Users browsing this forum: sofista and 148 guests