Jump to content

PixelSearch


Recommended Posts

I know how to use pixelsearch, but i am really REALLY used to just searching the whole screen. But today i found myself coding something that required different rectangles. Now, i do not really understand how to make a rectangle with this:

PixelSearch ( left, top, right, bottom, etc...

Left: Left-Top? Left side of the rectangle? IDK!

Same for all sides...any help? :P

Link to comment
Share on other sites

Ah....thats what I was thinking it was, thanks :unsure:

Well, I don't know why this isn't working....its detecting on my desktop but not in-game...

;88FE00 - terrorist - green
;E607FF - counter terrorist - purple
global $target_Terrorist, $coord, $target_counter

HotKeySet("z", "qt")
Func qt()
    Exit
EndFunc

HotKeySet(",", "terrorist")
Func terrorist()
    $target_Terrorist = 1
    $target_counter = 0
    tooltip("Target set to terrorist", 0, 0)
EndFunc

HotKeySet(".", "counter")
Func counter()
    $target_counter = 1
    $target_Terrorist = 0
    tooltip("Target set to counter-terrorist", 0, 0)
EndFunc

HotKeySet("/", "target_off")
Func target_off()
    $target_counter = 0
    $target_Terrorist = 0
    tooltip("Target disengaged!", 0, 0)
EndFunc


while 1
    if $target_Terrorist = 1 then
   ;$coord = PixelSearch(0, 0, @DeskTopWidth, @DeskTopHeight, 0x88FE00, 7)
    $coord = PixelSearch(430, 320, 590, 440, 0x88FE00, 200)
    If @error Then
       ;Msgbox(0,'Error','Could not find the pixel')
    
        Else
        MouseMove($coord[0],$coord[1])
       ;MouseClick("left",$coord[0],$coord[1],1)
    EndIf
EndIf

    if $target_counter = 1 then
   ;$coord = PixelSearch(0, 0, @DeskTopWidth, @DeskTopHeight, 0xE607FF, 7)
    $coord = PixelSearch(430, 320, 590, 440, 0xE607FF, 200)
    If @error Then
       ;Msgbox(0,'Error','Could not find the pixel')
    
        Else
        MouseMove($coord[0],$coord[1])
       ;MouseClick("left",$coord[0],$coord[1],1)
    EndIf
EndIf
WEnd

I know the pixel-variation is extremely high, but that is because nothing is working...:P

Edited by Juggernaut
Link to comment
Share on other sites

Ah....thats what I was thinking it was, thanks :D

Well, I don't know why this isn't working....its detecting on my desktop but not in-game...

$coord = PixelSearch(0, 0, @DeskTopWidth, @DeskTopHeight, 0xE607FF, 7)
   $coord = PixelSearch(430, 320, 590, 440, 0xE607FF, 200)

I know the pixel-variation is extremely high, but that is because nothing is working... :(

The last parameter of PixelSearch is hwnd - [optional] Window handle to be used.

You have not entered a window handle of the window to search in.

WinGetHandle function should help. And, Au3Info.exe in the AutoIt3 directory to find the title of the window, being the parameter of WinGetHandle function.

Link to comment
Share on other sites

Well right now im doing something that SHOULD be very very damn simple...but i have no idea why its not working..

;tankjr bright green ------9EF042
global $coord, $aim_on

HotKeySet("z", "qt")
Func qt()
    Exit
EndFunc

HotKeySet("f", "on")
Func on()
    $aim_on = 1
    tooltip("Aimbot on!", 0, 0)
EndFunc

HotKeySet("g", "off")
Func off()
    $aim_on = 0
    tooltip("Aimbot off!", 0, 0, "", 0, 4)
EndFunc


while 1=1
    if $aim_on = 1 then
   ;$coord = PixelSearch(0, 0, @DeskTopWidth, @DeskTopHeight, 0x9EF042, 50)
    $coord = PixelSearch(300, 300, 300, 300, 0x9EF042, 25, 1, "QUAKE LIVE - Mozilla Firefox")
    If @error Then
       ;Msgbox(0,'Error','Could not find the pixel')
    Else
        MouseMove($coord[0],$coord[1])
       ;MouseClick("left",$coord[0],$coord[1],1)
    EndIf
EndIf
Wend
Link to comment
Share on other sites

Nope, still not working...=X

Silly me

$coord = PixelSearch(300, 300, 300, 300, 0x9EF042, 25, 1, WinGetHandle("QUAKE LIVE - Mozilla Firefox"))

Remember your first post "left, top, right, bottom,.."

300, 300, 300, 300 is not a rectangle

0,0,300,300 would be a square with the top left corner at point 0,0 and bottom right corner at point 300.300

So if the pixel you are searching for is in that 300x300 area at the top left corner of the window, then try

$coord = PixelSearch(0, 0, 300, 300, 0x9EF042, 25, 1, WinGetHandle("QUAKE LIVE - Mozilla Firefox"))

Link to comment
Share on other sites

I've tried that aswell.

I don't know what it is...but its not working =|

I have to set the shade variation to like 255 JUST go get my mouse to move..i've also tried recoding it from scratch a few times, but still nothing is working...

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...