Why this dosent work.

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
Myacc2017

Why this dosent work.

29 Mar 2017, 17:15

hello everyone.
s::
PixelGetColor
if (color != 0x3A201E)

Sleep, 500
Send {Rbutton}
Sleep, 500
Send {Lbutton}
Return


i want this script,on that pixel to start for some reason this script dosent work.
maybe im doing something wrong.
hope someone can fix that for me.
A_AhkUser
Posts: 1147
Joined: 06 Mar 2017, 16:18
Location: France
Contact:

Re: Why this dosent work.

29 Mar 2017, 19:54

PixelGetColor command requieres at least 3 parameters
(see: https://www.autohotkey.com/docs/command ... tColor.htm)
A pixel is a part of your screen so it is necessary that AutoHotkey know which pixel, in other words at which coordinates (x, y) you want it to check for the screen color.
Note also that coordinates retieved by the command are relative to the active window unless CoordMode was used to change that.
Besides, it is also necessary to store the result in some variable:

for exemple:

Code: Select all

CoordMode, Pixel, Screen ; coordinates are relative to top-left corner of the screen

PixelGetColor, ColorOfMyPixelAtCoords100_100, 100, 100

if (ColorOfMyPixelAtCoords100_100 != 0x3A201E)
{
MsgBox % "La couleur aux coordonées x=100,y=100 n'est pas 0x3A201E mais " . ColorOfMyPixelAtCoords100_100
}
my scripts

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: No registered users and 253 guests