Jump to content

PixelSearch Error value question (Script included)


Recommended Posts

Hello!

I try to make a short macro for a game. My char looks on the ground and waits for a spawn. When the spawn comes up over its figure there is in WHITE his name.

So I do a pixelsearch for 0x000000. As long the search is without success the @error should be not 1. For any reason he ignores that and so the macro comes to an end and stop. Do you have any idea what I made wrong?

Thanx a lot, cheers,

Sleep(3000)

while 1 = 1

Do

; Find a pure white pixel in the range

$coord = PixelSearch( 698, 319, 1045, 653, 0x000000 )

;as long as the pixel cant be found jump to sleep(10000)

If Not @error Then

MouseClick("right",867,585)

EndIf

until @error = 1

;FROM HERE IT WORKS

sleep(10000)

; Find a blue pixel in the range 0,0-20,300

$coord = PixelSearch( 645, 500, 1100, 960, 0x010514 )

If Not @error Then

;MsgBox(0, "X and Y are:", $coord[0] & "," & $coord[1])

MouseMove($coord[0],$coord[1],0)

sleep(2000)

MouseClick("left")

EndIf

WEnd

Edited by aprisma
Link to comment
Share on other sites

Hi,

I think you are getting your colours mixed up.

0x000000 = BLACK

0xFFFFFF = WHITE

Hope this is what yor looking for.

Dave

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------"I don't need to know everything, I just need to know where to find it when I need it"....EinsteinAnd in our case... That's the AutoIT helpfile ;) Please read before posting!!!

Link to comment
Share on other sites

Hi,

I think you are getting your colours mixed up.

0x000000 = BLACK

0xFFFFFF = WHITE

Hope this is what yor looking for.

Dave

lol true!!

and next time use Autoit quotes (aprisma)

Link to comment
Share on other sites

lol true!!

and next time use Autoit quotes (aprisma)

Ok what a shame - I used the Windows-Info-Tool and that gave me back that color. Or I should sleep more ... ok thanx a lot. Hope this helps.

cheers and have a nice weekend

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...