[Help] ControlClick Not Working, but ControlSend is Topic is solved

Ask gaming related questions (AHK v1.1 and older)
Caleb

[Help] ControlClick Not Working, but ControlSend is  Topic is solved

15 Oct 2017, 11:23

Hi All,

I am trying to send ControlClick in a game (Path of Exile), but facing some issues.

The ControlSend is working as inteneded using below command but Control click is not :( :(
hkey:="vk0x32"
ControlSend,,{%hkey% Down %hkey% Up}, ahk_exe PathOfExile.exe

I have tried with vk0x02 / vk0x01 / and so on but it did not work :(

Can someone please help ?
Thanks
calebrivers098
Posts: 2
Joined: 15 Oct 2017, 11:24

Re: [Help] ControlClick Not Working, but ControlSend is

16 Oct 2017, 05:04

Reloaded wrote:Try just

Code: Select all

Click
Hi, I wanted to send clicks to the game window in background. Click is working fine btw.
User avatar
Brazolek123
Posts: 187
Joined: 06 Jun 2016, 16:02

Re: [Help] ControlClick Not Working, but ControlSend is

16 Oct 2017, 05:32

Try first one key down, sleep 50ms, then key up. Also specify in controlclick options parameter NA, might help you.
If it wont help place mousemove to click point just before controlclick.
You can also check postmessage leftclick to hwnd, also set cursor position before click might be necessary, it all depends on how game handles mouse actions.
calebrivers098
Posts: 2
Joined: 15 Oct 2017, 11:24

Re: [Help] ControlClick Not Working, but ControlSend is

16 Oct 2017, 23:09

There is a bot which does this, not free, I am using Spy++ to monitor the commands send to the game which is
<00001> 001B07F2 P WM_MOUSEMOVE fwKeys:0000 xPos:459 yPos:265
<00002> 001B07F2 P WM_LBUTTONDOWN fwKeys:MK_LBUTTON xPos:459 yPos:265
<00003> 001B07F2 P WM_LBUTTONUP fwKeys:0000 xPos:459 yPos:265
<00004> 001B07F2 S WM_CAPTURECHANGED hwndNewCapture:00000000
<00005> 001B07F2 R WM_CAPTURECHANGED
<00006> 001B07F2 P WM_KEYDOWN nVirtKey:'Q' cRepeat:1 ScanCode:10 fExtended:0 fAltDown:0 fRepeat:0 fUp:0
<00007> 001B07F2 P WM_CHAR chCharCode:'113' (113) cRepeat:1 ScanCode:10 fExtended:0 fAltDown:0 fRepeat:0 fUp:0
<00008> 001B07F2 P WM_KEYUP nVirtKey:'Q' cRepeat:1 ScanCode:10 fExtended:0 fAltDown:0 fRepeat:1 fUp:1
<00009> 001B07F2 P WM_MOUSEMOVE fwKeys:0000 xPos:386 yPos:268
<00010> 001B07F2 P WM_LBUTTONDOWN fwKeys:MK_LBUTTON xPos:386 yPos:268
<00011> 001B07F2 P WM_LBUTTONUP fwKeys:0000 xPos:386 yPos:268
<00012> 001B07F2 S WM_CAPTURECHANGED hwndNewCapture:00000000
<00013> 001B07F2 R WM_CAPTURECHANGED
<00014> 001B07F2 P WM_MOUSEMOVE fwKeys:0000 xPos:386 yPos:268
<00015> 001B07F2 P WM_LBUTTONDOWN fwKeys:MK_LBUTTON xPos:386 yPos:268
<00016> 001B07F2 S WM_CAPTURECHANGED hwndNewCapture:00000000
<00017> 001B07F2 R WM_CAPTURECHANGED
<00018> 001B07F2 P WM_LBUTTONUP fwKeys:0000 xPos:386 yPos:268
<00019> 001B07F2 P WM_MOUSEMOVE fwKeys:0000 xPos:331 yPos:270
<00020> 001B07F2 P WM_LBUTTONDOWN fwKeys:MK_LBUTTON xPos:331 yPos:270
<00021> 001B07F2 P WM_LBUTTONUP fwKeys:0000 xPos:331 yPos:270
<00022> 001B07F2 S WM_CAPTURECHANGED hwndNewCapture:00000000
<00023> 001B07F2 R WM_CAPTURECHANGED
<00024> 001B07F2 P WM_MOUSEMOVE fwKeys:0000 xPos:413 yPos:268
<00025> 001B07F2 P WM_LBUTTONDOWN fwKeys:MK_LBUTTON xPos:413 yPos:268
<00026> 001B07F2 S WM_CAPTURECHANGED hwndNewCapture:00000000
<00027> 001B07F2 R WM_CAPTURECHANGED
<00028> 001B07F2 P WM_LBUTTONUP fwKeys:0000 xPos:413 yPos:268
<00029> 001B07F2 P WM_MOUSEMOVE fwKeys:0000 xPos:413 yPos:268
<00030> 001B07F2 P WM_LBUTTONDOWN fwKeys:MK_LBUTTON xPos:413 yPos:268
<00031> 001B07F2 P WM_LBUTTONUP fwKeys:0000 xPos:413 yPos:268
<00032> 001B07F2 S WM_CAPTURECHANGED hwndNewCapture:00000000
<00033> 001B07F2 R WM_CAPTURECHANGED
<00034> 001B07F2 P WM_MOUSEMOVE fwKeys:0000 xPos:413 yPos:268
<00035> 001B07F2 P WM_LBUTTONDOWN fwKeys:MK_LBUTTON xPos:413 yPos:268
<00036> 001B07F2 P WM_LBUTTONUP fwKeys:0000 xPos:413 yPos:268
<00037> 001B07F2 S WM_CAPTURECHANGED hwndNewCapture:00000000
<00038> 001B07F2 R WM_CAPTURECHANGED



I wrote the AHK as
PostLeftClick(x, y, hwnd) {
PostMessage, 0x200, , ((y<<16)^x), , ahk_id %hwnd% ;MOVE
Sleep, 100
PostMessage, 0x201, , ((y<<16)^x), , ahk_id %hwnd% ;WM_LBUTTONDOWN
Sleep, 100
PostMessage, 0x202, , ((y<<16)^x), , ahk_id %hwnd% ;WM_LBUTTONUP
Sleep, 100
SendMessage, 0x215, , , , ahk_id %hwnd% ;WM_LBUTTONUP
}

Which puts the same message, but ahk is not working :(
User avatar
evilC
Posts: 4823
Joined: 27 Feb 2014, 12:30

Re: [Help] ControlClick Not Working, but ControlSend is

18 Oct 2017, 10:52

ControlSend,,{LButton}, ahk_exe PathOfExile.exe

Also, FYI, ControlSend,,{%hkey% Down %hkey% Up}, ahk_exe PathOfExile.exe is kind of pointless. It could be written as ControlSend,,{%hkey%}, ahk_exe PathOfExile.exe
gandalfgarfield
Posts: 29
Joined: 20 Jun 2020, 22:27

Re: [Help] ControlClick Not Working, but ControlSend is

05 Aug 2020, 01:16

Hi. Im having the same issue with the game im playing [Ragnarok Online].

ControlClick, x y, ahk_exe Ragnarok.exe,,,,NA used to work but because of some issues with the lag with the server. The developers decided to downgrade the client hoping it would solve the lag. After they downgrade the client, My script stopped working.

ControlSend still works tho.

Please Help

Return to “Gaming Help (v1)”

Who is online

Users browsing this forum: peter_ahk and 78 guests