Jump to content
Sign in to follow this  
XInFisk

Need help with the PixelSearch

Recommended Posts

XInFisk

Hey... i got a little problem. I'm trying to make a script that can see when there is a pixel that isn't "0x8E000E". And then it should do something.. But my problem is, how do i find a pixel on my screen? As i can see in the Help file the command should be like this: "PixelSearch ( left, top, right, bottom, color [, shade-variation] [, step]] )" But how do i find the left, top, right and bottom :)?

I'd be very happy if anyone could help me out here.

-XInFisk

Share this post


Link to post
Share on other sites
jokke

Hiya, here you go a litle script.

$badcolor = 0x8E000E

While 1
$search = pixelsearch(0,0,1024,768,$badcolor)
If Not @error Then
    MsgBox(0, "Badcolor found at X:", $search [0] & " Y:" & $search [1])
    ; Do whatever you want here.
    Exitloop 
EndIf
;Unable to find $badcolor looping for a new search.
WEnd

Note this script searches the whole screen might not be effective at all. (EDIT: If you use 1024x768 resolution that is.)

Edited by jokke

UDF:Crypter a file encrypt / decrypt tool with no need to remember a password again. Based on Caesar cipher using entire ASCII Table.Script's: PixelSearch Helper, quick and simple way to create a PixelSeach.Chatserver - simplified, not so complicated multi-socket server.AutoIT - Firewall, simple example on howto create a firewall with AutoIt.

Share this post


Link to post
Share on other sites
XInFisk

Hiya, here you go a litle script.

$badcolor = 0x8E000E

While 1
$search = pixelsearch(0,0,1024,768,$badcolor)
If Not @error Then
    MsgBox(0, "Badcolor found at X:", $search [0] & " Y:" & $search [1])
    ; Do whatever you want here.
    Exitloop 
EndIf
;Unable to find $badcolor looping for a new search.
WEnd

Note this script searches the whole screen might not be effective at all. (EDIT: If you use 1024x768 resolution that is.)

Thanks for trying.. But it wasn't what i meant :) I'll use this for a game.. I'll makei trigger when my life bar goes under 40%. And then i'll search for the life color at the 40% and if it gives @error then it should press Send("0") .. That's what i mean. And then i ask for how to figure out where a pixel is ? Can i ex. use Window Info for it? I've tried but i can't really see where the info is i need :/ I hope someone can understand and help me :D

-XInFisk

Share this post


Link to post
Share on other sites
jokke

well you would not want to use pixelsearch then, if you are creating a hp-meter, id suggent using pixelgetcolor


UDF:Crypter a file encrypt / decrypt tool with no need to remember a password again. Based on Caesar cipher using entire ASCII Table.Script's: PixelSearch Helper, quick and simple way to create a PixelSeach.Chatserver - simplified, not so complicated multi-socket server.AutoIT - Firewall, simple example on howto create a firewall with AutoIt.

Share this post


Link to post
Share on other sites
XInFisk

well you would not want to use pixelsearch then, if you are creating a hp-meter, id suggent using pixelgetcolor

Ohhh ! I just forgot that :) But thank you for all the help !

Share this post


Link to post
Share on other sites
jokke

Here you go a script that i allways use fo my bots when doing hp and those other bar searches.

Dim $search[4] = [0,200,100,0x000000] ;[X-Start,X-End,Y,Color]

Func Gethealth()
    For $x = $search[0] to $search[1]
        If PixelGetColor($x,$search[2]) == $search[3] Then
            ExitLoop
        EndIf
    Next
    Return Int(($x-$search[0])/($search[1]-$search[0])*100) ;Will return % health left.
EndFunc

And script is fairly simple to edit to do vertical searches to.

I cat take full credit for i though since it was not me who wrote the original (Manadar did), i rewrote it abit though.

Edited by jokke

UDF:Crypter a file encrypt / decrypt tool with no need to remember a password again. Based on Caesar cipher using entire ASCII Table.Script's: PixelSearch Helper, quick and simple way to create a PixelSeach.Chatserver - simplified, not so complicated multi-socket server.AutoIT - Firewall, simple example on howto create a firewall with AutoIt.

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  

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.