Can you help me fix my script? Topic is solved

Ask gaming related questions (AHK v1.1 and older)
LAPIII
Posts: 668
Joined: 01 Aug 2021, 06:01

Can you help me fix my script?

Post by LAPIII » 06 Jan 2022, 23:18

This is what I have:

Code: Select all

#NoEnv  ; Recommended for performance and compatibility with future AutoHotkey releases.
; #Warn  ; Enable warnings to assist with detecting common errors.
SendMode Input  ; Recommended for new scripts due to its superior speed and reliability.
SetWorkingDir %A_ScriptDir%  ; Ensures a consistent starting directory.

#SingleInstance,Force
#IfWinActive, ahk_exe WSS.exe

^p::
Mouseclick, left, X484 Y578 ; Profile
sleep 50
Mouseclick,left, X1027 Y632 ; Do you want to select this profile?
return
And I got this:

Image

gregster
Posts: 8990
Joined: 30 Sep 2013, 06:48

Re: Can you help me fix my script?

Post by gregster » 07 Jan 2022, 00:56

Afaik, the correct syntax for MouseClick would look like this:

Code: Select all

MouseClick, left, 484, 578

LAPIII
Posts: 668
Joined: 01 Aug 2021, 06:01

Re: Can you help me fix my script?

Post by LAPIII » 19 Jan 2022, 11:54

I changed the hot key and mouse coordinates:

Code: Select all

!w::
Sleep 100
MouseClick, Left, X572, Y685 ; Profile
Sleep 100
MouseClick, Left, X1068, Y620 ; Do you want to select this profile?
Sleep 100
return
And I got this:

Image

gregster
Posts: 8990
Joined: 30 Sep 2013, 06:48

Re: Can you help me fix my script?

Post by gregster » 19 Jan 2022, 12:45

Still wrong syntax - drop the Xs and Ys...

User avatar
boiler
Posts: 16902
Joined: 21 Dec 2014, 02:44

Re: Can you help me fix my script?

Post by boiler » 19 Jan 2022, 13:03

You can also look at it as you have used correct syntax if you were wanting to click at the location stored in the variables named X572 and Y685 since those parameters can be expressions. And those variables are blank as the warning points out.

LAPIII
Posts: 668
Joined: 01 Aug 2021, 06:01

Re: Can you help me fix my script?

Post by LAPIII » 19 Jan 2022, 22:43

I thought it this time:

Code: Select all


#IfWinActive, ahk_exe WSS.exe

!w::
Sleep 100
MouseClick, Left, 572, 685 ; Profile
Sleep 100
MouseClick, Left, 1068, 620 ; Do you want to select this profile?
Sleep 100
return

LAPIII
Posts: 668
Joined: 01 Aug 2021, 06:01

Re: Can you help me fix my script?  Topic is solved

Post by LAPIII » 19 Jan 2022, 22:44

This worked:

Code: Select all

#IfWinActive, ahk_exe WSS.exe

!w::
Sleep 100
MouseClick, Left, 572, 685 ; Profile
Sleep 100
MouseClick, Left, 1068, 620 ; Do you want to select this profile?
Sleep 100
return

Post Reply

Return to “Gaming Help (v1)”