Clicking a position without releasing rightclick

Ask gaming related questions
Stardust
Posts: 4
Joined: 08 May 2024, 03:04

Clicking a position without releasing rightclick

08 May 2024, 03:11

Basically I am trying to make an auto healer in a game. It requires to click on multiple health bars but the game requires holding down right click to move. What ends up happening is everything is good when standing still, but once I hold right click to move, the camera starts to jiggle. I tried postmessage and had no luck.
Anyone know anything about this?

Thanks so much!


[Mod action: Moved topic to the “Gaming” section.]
Rohwedder
Posts: 7710
Joined: 04 Jun 2014, 08:33
Location: Germany

Re: Clicking a position without releasing rightclick

09 May 2024, 01:38

Hallo,
instead of using PostMessage, I would have tried clicking with ControlClick first!
Stardust
Posts: 4
Joined: 08 May 2024, 03:04

Re: Clicking a position without releasing rightclick

10 May 2024, 03:44

This is the original script

Code: Select all

$XButton1:: 
{
    While GetKeyState("XButton1", "P") 
	{
        MouseGetPos &xpos, &ypos
        If PixelSearch(&Px, &Py, 1370, 1069, 2080, 1390, 0xff00af, 3) 
			MouseClick "Middle", Px+5, Py+5, 1, 0
		Sleep 100
    }
}
I tries to use controlclick, but it does not work, any ideas?

Code: Select all

$XButton1:: 
{
    While GetKeyState("XButton1", "P") 
	{
        MouseGetPos &xpos, &ypos
        If PixelSearch(&Px, &Py, 1370, 1069, 2080, 1390, 0xff00af, 3) 
			ControlClick "Px+5 Py+5", "World of Warcraft", "Middle", 1
		Sleep 100
    }
}
User avatar
boiler
Posts: 17184
Joined: 21 Dec 2014, 02:44

Re: Clicking a position without releasing rightclick

10 May 2024, 03:58

You haven’t used the correct syntax. You just put a string of text with no values of your variables where it’s expecting x and a number followed by y and a number (with a space between them). That is accomplished by concatenating the literal string parts and your variables (with 5 added to each).

You also didn’t put the parameters in the right place, failing to leave a spot for the WinText parameter.

Code: Select all

			ControlClick "x" Px+5 " y" Py+5, "World of Warcraft",, "Middle", 1

Whether the approach works or not is a separate issue, but you have to have the syntax right in order to give it a chance.
Stardust
Posts: 4
Joined: 08 May 2024, 03:04

Re: Clicking a position without releasing rightclick

12 May 2024, 22:15

boiler wrote:
10 May 2024, 03:58
You haven’t used the correct syntax. You just put a string of text with no values of your variables where it’s expecting x and a number followed by y and a number (with a space between them). That is accomplished by concatenating the literal string parts and your variables (with 5 added to each).

You also didn’t put the parameters in the right place, failing to leave a spot for the WinText parameter.

Code: Select all

			ControlClick "x" Px+5 " y" Py+5, "World of Warcraft",, "Middle", 1

Whether the approach works or not is a separate issue, but you have to have the syntax right in order to give it a chance.
Thanks a lot! I am such a noob, but is willing to learn and do whatever it takes.
Stardust
Posts: 4
Joined: 08 May 2024, 03:04

Re: Clicking a position without releasing rightclick

13 May 2024, 21:44

Unfortunately the controlclick method does not work for this situation.
The script works, but it still stops camara movement for a split second, which send your character camera into chaos.

I will keep trying other method, or just use in 25 in game macros to target instead of using mouse at all.

Return to “Gaming”

Who is online

Users browsing this forum: No registered users and 5 guests