Sign in to follow this  
Followers 0
langthang084

help about pixelsearch

11 posts in this topic

how to check a rectangle of pixels for pixel color (dont depend on levels of color). Example if the color is blue --> it's correct

Share this post


Link to post
Share on other sites



Look under PixelSearch in the help file


0x576520616C6C206469652C206C697665206C69666520617320696620796F75207765726520696E20746865206C617374207365636F6E642E

Share this post


Link to post
Share on other sites

Can U give me an example about it???, i'm newbie and i dont understand it clearly

Share this post


Link to post
Share on other sites

I made it quickly, you can also paste your source here or game/program name.

I hope this help u abit.

;Search blue pixel from left upper corner of scren
$var = PixelSearch ( 0, 0, 1, 1, 0x0000ff )
If Not $var = 1 Then
    ;if blue pixel found OK
    MsgBox(0,"","Found")
EndIf

edited

Share this post


Link to post
Share on other sites

#5 ·  Posted (edited)

This is my pic:

Posted Image

I want to check the color at "KLH84" position, but this pic can see through the blue background, so i dont know to define the color pixel :D

Edited by langthang084

Share this post


Link to post
Share on other sites

edit a box around the KLH84 if the search find the color white then you have got the text


0x576520616C6C206469652C206C697665206C69666520617320696620796F75207765726520696E20746865206C617374207365636F6E642E

Share this post


Link to post
Share on other sites

the position I want to check isnt alway KLH84, it can be unforeseeable. So I think should check the blue background.

Share this post


Link to post
Share on other sites

Check the whole screen, as long as you choose a color that is only in the wording your fine.


0x576520616C6C206469652C206C697665206C69666520617320696620796F75207765726520696E20746865206C617374207365636F6E642E

Share this post


Link to post
Share on other sites

#9 ·  Posted (edited)

I use this code to check a white character on the line at KLH84 position:

if PixelSearch(90,148,90,148,0xffffff) <> @error Then 
         msgbox(0,"","CORRECT")
endif

but however KHL84 appears or not, the msgbox always show

Edited by langthang084

Share this post


Link to post
Share on other sites

#10 ·  Posted

Your logic is wrong.

$coords = PixelSearch (...)
If Not @error Then
;Correct;
Else
;Incorrect
EndIf

Christ even the helpfile has and example of what you want! READ IT!

Share this post


Link to post
Share on other sites

#11 ·  Posted

No, I thinks if @error then nothing appear. But error or not, the msgbox CORRECT always show Posted Image

In this pic I check the red line and its alway show INCORRECT

Share this post


Link to post
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
Sign in to follow this  
Followers 0