Hello! Looking for a little assistance please.

Ask gaming related questions (AHK v1.1 and older)
MikeS611
Posts: 2
Joined: 07 Apr 2024, 13:22

Hello! Looking for a little assistance please.

07 Apr 2024, 13:28

Hello and thanks in advance on any help anyone is willing to give.

I am trying to learn and to make a script to get my mouse to move and do a series of clicks on my screen to get into a server that is usually full with no auto-join feature.

So far I have this, trying to key bind it to my f1 key to run and stop the script and then loop itself to keep running. Its supposed to click 3 different spots then ESC button twice and it's final click. My problem is that the mouse is actually moving on my screen, and it does it very slowly. Is this a correct way I should be doing this, or any insight / help anyone can give me would be awesome.

heres what ive gotten so far

Code: Select all

F1::
CoordMode, MouseClick
SetMouseDelay, 240
Loop, 100 {
Click, 251 -249
Click, 685 160
Click, 663 307
send {esc}
send {esc}
Click, 240 890
}

[Mod edit: Added [code][/code] tags. Please use them yourself when posting code.]

[Mod action: Moved topic to the v1 section since this is v1 code. The main section is for v2.]
User avatar
mikeyww
Posts: 27010
Joined: 09 Sep 2014, 18:38

Re: Hello! Looking for a little assistance please.

08 Apr 2024, 07:28

Welcome to this AutoHotkey forum!

The :arrow: CoordMode command works only with a valid target type. Most subroutines end in a Return command. Without it, the script will proceed to the next statement.

An example is below.

Code: Select all

#Requires AutoHotkey v1.1.33.11
#MaxThreadsPerHotkey 2

F1::
CoordMode Mouse
on := !on
While on {
 MouseClick,, 685, 160, on
 MouseClick,, 663, 307, on
 If on
  Send {Esc 2}
 MouseClick,, 240, 890, on
}
Return
If you are new to AHK, I recommend using its current version, which is v2, instead of this older deprecated version that is no longer developed.
MikeS611
Posts: 2
Joined: 07 Apr 2024, 13:22

Re: Hello! Looking for a little assistance please.

11 Apr 2024, 12:41

Thank you for the reply!

What would it look like if it was written for ver2? I will find some time this weekend to look up some of this information but if you had some time to guide me in the right direction i would greatly appreciate it.
User avatar
mikeyww
Posts: 27010
Joined: 09 Sep 2014, 18:38

Re: Hello! Looking for a little assistance please.

11 Apr 2024, 13:15

Code: Select all

#Requires AutoHotkey v2.0
#MaxThreadsPerHotkey 2

F1:: {
 Static on := False
 CoordMode 'Mouse'
 on := !on
 While on {
  MouseClick , 685, 160, on
  MouseClick , 663, 307, on
  If on
   Send '{Esc 2}'
  MouseClick , 240, 890, on
 }
}

Return to “Gaming Help (v1)”

Who is online

Users browsing this forum: No registered users and 60 guests