How to make a script that opens by clicking on the picture?

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
lolihax
Posts: 28
Joined: 30 Oct 2020, 16:18

How to make a script that opens by clicking on the picture?

Post by lolihax » 18 May 2022, 04:49

How to make a script that opens by clicking on the picture?
I have an image that needs to be clicked once,but first you need to press the UP button.
image.png
image.png (15.34 KiB) Viewed 521 times
picture of such a plan

Rohwedder
Posts: 7616
Joined: 04 Jun 2014, 08:33
Location: Germany

Re: How to make a script that opens by clicking on the picture?

Post by Rohwedder » 18 May 2022, 06:46

Hallo,
perhaps?:

Code: Select all

$LButton::
MouseGetPos, X, Y
PixelGetColor, Color, X, Y
IF Color = 0xE3
	SendInput, {Up} ;first press the UP button
SendInput, {LButton Down} 
Return
~LButton Up::Return
Click on the red color not on the white writing in it.

lolihax
Posts: 28
Joined: 30 Oct 2020, 16:18

Re: How to make a script that opens by clicking on the picture?

Post by lolihax » 18 May 2022, 07:03

Rohwedder wrote:
18 May 2022, 06:46
Hallo,
perhaps?:

Code: Select all

$LButton::
MouseGetPos, X, Y
PixelGetColor, Color, X, Y
IF Color = 0xE3
	SendInput, {Up} ;first press the UP button
SendInput, {LButton Down} 
Return
~LButton Up::Return
Click on the red color not on the white writing in it.

you don’t understand, you need me to press the up arrow, and then the mouse itself points to the red color and presses the left button

BoBo
Posts: 6564
Joined: 13 May 2014, 17:15

Re: How to make a script that opens by clicking on the picture?

Post by BoBo » 18 May 2022, 07:07

So the Up-key should become your hotkey?

lolihax
Posts: 28
Joined: 30 Oct 2020, 16:18

Re: How to make a script that opens by clicking on the picture?

Post by lolihax » 21 May 2022, 02:11

BoBo wrote:
18 May 2022, 07:07
So the Up-key should become your hotkey?
Yes

lolihax
Posts: 28
Joined: 30 Oct 2020, 16:18

Re: How to make a script that opens by clicking on the picture?

Post by lolihax » 23 May 2022, 05:44

I click on the up arrow, and then the mouse should itself click on the red banner

BoBo
Posts: 6564
Joined: 13 May 2014, 17:15

Re: How to make a script that opens by clicking on the picture?

Post by BoBo » 23 May 2022, 06:23

You haven't said if the mouse is already hovering over that red button and you simply want to use the Up-key instead of the mouse button to trigger it, or if the red button's position should be detected in the first place, and then clicked afterward :eh:

lolihax
Posts: 28
Joined: 30 Oct 2020, 16:18

Re: How to make a script that opens by clicking on the picture?

Post by lolihax » 23 May 2022, 06:34

Look, I press the up arrow, and then the mouse should automatically hover over the red button

Post Reply

Return to “Ask for Help (v1)”