1

I want to the following script work like this: I press number 7 on the numpad and it shows me coordinates of some red pixel in the current window.

#SingleInstance force
Numpad7::
{
    PixelSearch Px, Py,  0, 0, 300, 250, 0x241ced
    MsgBox %Px% %Py%
    return
}

Tested in mspaint with a red dot in the upper-left corner on Windows 8.1

After pressing key 7 it doesn't do anything - after right-clicking on its taskbar icon nothing is displayed. When running the script again, the prompt "Could not close the previous instance of this script, keep waiting?" is displayed.

Probably some infinite loop, I need to kill the ahk process.

Any ideas how to make such a simple task work?

However, this script does work without any problem on my windows 7 machine.

  • Dis you put this exact color? `241CED` – Joe DF Oct 05 '14 at 20:44
  • Yes, I checked it by Window Spy, I also tried 0xffffff and 0x000000, it doesn't make any difference. Sometimes after 10 seconds of clicking between other windows the msgbox finally appears - with numbers like 9 61 - but no red dot is there. – Jan Ptáčník Oct 06 '14 at 01:08
  • what version of authotkey are you using? what is the value of `errorlevel` ? – Joe DF Oct 06 '14 at 01:10
  • version 1.1.16.05, `MsgBox %Px% %Py% %ErrorLevel% `shows me after about 10 second of clicking ErrorLevel as 0. (trying 0x000000 color) – Jan Ptáčník Oct 06 '14 at 01:25

1 Answers1

1

I tried to add one additional parameter - fast mode

changed

PixelSearch Px, Py,  0, 0, 300, 250, 0x241ced 

to:

PixelSearch Px, Py,  0, 0, 300, 250, 0x241ced , , fast

Now it works on my Windows 8.1 machine, too.