Jump to content

pixel search wierd error


ZoOrOo
 Share

Recommended Posts

sry its my third post in 1 day

but i really wanna make it work and now i think i got a soluion on how to detect places

(by searching for more than 1 pixel like a color and then take the coord + 10 to search up it by some pixels and if it was right then search for another pixel untill we are sure its the thing we want )

now the error i get when i pixel search and i take the coords like this

$check=pixelsearch(0,0,@DesktopWidth,@DesktopHeight,"0x3D5644")
while @error=1
    MouseClickDrag("right",359,314,0,311,3)
    sleep(1000)
WEnd
$ncheck=pixelsearch(0,0,@DesktopWidth,@DesktopHeight,"0x79540D")
    msgbox(1,"found","found")
    mousemove($check[0] &,$check[1])

it give me error when makeing the last step

saying "subscript used with non-array variable."

any help please :)

Link to comment
Share on other sites

I think maybe you just need to move your Pixelsearch into your loop, otherwise it will onbly search once.

Im not sure I understand what u want the script to do exactly, but this is my go at it

Do
    $check=pixelsearch(0,0,@DesktopWidth,@DesktopHeight, 0x3D5644)
    MouseClickDrag("right",359,314,0,311,3)
    sleep(1000) 
Until IsArray($check)
mousemove($check[0],$check[1])

; I am uncertain what the rest of this is supposed to be doing ???
$ncheck=pixelsearch(0,0,@DesktopWidth,@DesktopHeight, 0x79540D)
    msgbox(1,"found","found")
    mousemove($check[0],$check[1]) ;<----Is this supposed to be $check or $ncheck ???
Edited by ofLight

There is always a butthead in the crowd, no matter how hard one tries to keep them out.......Volly

Link to comment
Share on other sites

oic, this is prolly closer.

While 1 
    Do
        $check=pixelsearch(0,0,@DesktopWidth,@DesktopHeight, 0x3D5644)
        MouseClickDrag("right",359,314,0,311,3)
        sleep(1000) 
    Until IsArray($check)
    $ncheck=pixelsearch(0,0,@DesktopWidth,@DesktopHeight, 0x79540D)
    If IsArray($ncheck) Then MouseClick("Left",$check[0],$check[1])
Wend

There is always a butthead in the crowd, no matter how hard one tries to keep them out.......Volly

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