PixelGetColor stopped working.

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
ry3ks3u_m4dd0ns
Posts: 18
Joined: 29 Mar 2017, 09:23

PixelGetColor stopped working.

10 Apr 2017, 05:35

I've been using the script below to automate a mini-game on a site. The script worked a few days back, but now it suddenly started malfunctioning.

Keep in mind, I have not changed anything from the time I made it and from today.

Code: Select all

5::
PixelGetColor, currentsym, 907, 255 , RGB
If currentsym = 0x9F2A2A
{
	ControlClick, x479 y551, ahk_exe nothing.exe
} else if currentsym = 0xFFFC7E
{
	ControlClick, x614 y551, ahk_exe nothing.exe
} else if currentsym = 0x4A40D4
{
	ControlClick, x745 y551, ahk_exe nothing.exe
}
User avatar
evilC
Posts: 4824
Joined: 27 Feb 2014, 12:30

Re: PixelGetColor stopped working.

10 Apr 2017, 09:24

You say that now it malfunctions, but not in what way.

Did they maybe change the color of the pixel on the site?
Is the code now failing to get the color of the pixel?
Did they maybe change the coordinates of the thing that you click on?
ry3ks3u_m4dd0ns
Posts: 18
Joined: 29 Mar 2017, 09:23

Re: PixelGetColor stopped working.

10 Apr 2017, 12:46

evilC wrote:You say that now it malfunctions, but not in what way.

Did they maybe change the color of the pixel on the site?
Is the code now failing to get the color of the pixel?
Did they maybe change the coordinates of the thing that you click on?

Sorry about that. I made this post in the middle of the morning, and the server time is different from the time where I am.

The coordinates stayed the same, they didn't change the color, and I don't think it fails to get the colors, because when the script is initialized, and I press the hotkey, it works for the first two times I press it, then *poof* Dead.

EDIT: I moved the target coordinates a bit, and they still don't work.
User avatar
evilC
Posts: 4824
Joined: 27 Feb 2014, 12:30

Re: PixelGetColor stopped working.

10 Apr 2017, 13:43

You ideally need to debug the script and work out what is failing.

Seeing as the script uses pixel detection, printing stuff on the screen (eg Tooltip) is maybe not the best debugging method.

I would maybe advise installing DebugView, then adding lines like this to your script:

OutputDebug % "The value of currentsym is: " currentsym
This will show info in the log, so you can hopefully work out where it is getting to for each run of the script.

So check that currentsym gets populated, also check that the hotkey triggers every time, and finally check which of the IF clauses is triggering.

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: dra3th, Google [Bot], Mateusz53, Rohwedder, Spawnova and 226 guests