Sign in to follow this  
Followers 0
Amh.p

Pixelsearch

6 posts in this topic

I am tryng to move my mouse to a colour i am not sure if this is right the mousemove works but it ceep moving to the most left side of my screen wile this test colour issend there,

Enyone got enysugestions ?

$coord = PixelSearch( 0, 0, 20, 300, 0xD4D0C8 )

If Not @error Then

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

Endif

Share this post


Link to post
Share on other sites



I am tryng to move my mouse to a colour i am not sure if this is right the mousemove works but it ceep moving to the most left side of my screen wile this test colour issend there,

Enyone got enysugestions ?

$coord = PixelSearch( 0, 0, 20, 300, 0xD4D0C8 )

If Not @error Then

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

Endif

What are the values in $coord[0] and $coord[1]?

Auto3Lib: A library of over 1200 functions for AutoIt

Share this post


Link to post
Share on other sites

#3 ·  Posted (edited)

You might want to use the correct syntax for MouseMove:

MouseMove(x, y)

...instead of what you used:

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

Edited by herewasplato

[size="1"][font="Arial"].[u].[/u][/font][/size]

Share this post


Link to post
Share on other sites

I am sorry if i am confusing sometimes

I'm trying to learn autoit scripting, slowly i wil get it

What i try to do is get the coords of a colour of pixelsearch the string of pixelsearch wil tel movemouse where to go

so what the value is of them i dont know it depents on where the colour is right ?

Lets say i take the colour white and there is a white dot in my window at "455, 605"

if i run this code

$coord = PixelSearch( 0, 0, 1000, 800, 0x000000 ) //Looks up where the white pixel is and fills the coords in the string $coord.

If Not @error Then

mousemove ( "X and Y are:", $coord[0] & "," & $coord[1]) //$coord wil tel the coords of the white pixel to mousemove.

Endif

but it dusent work right it ceep going to the left side of my screen

MouseMove(x, y) there you need to fill the coords but i want the script to find me where to move my mouse

maybe i dont understand i have tried mousemove(x == $coord[0], y == $coord[1])

but it gives me a error message "mousemove (X == $coord[0], Y == $coord[1])"

"mousemove (ÊRROR"

I also tried

mousemove ( "X, Y ", $coord[0], $coord[1])

but it gives the same effect as the old code

i had also a other code to detect colours in a window but its ferry confusing for me i wil post it also but in a other topic

I like mousemove tougt since you can clearly see whats going on i hope we can get this fixed,

Share this post


Link to post
Share on other sites

Your going to be hell bent if you don't understand how to read the parameters of standard functions to get anything done.

If IsArray($Coord) Then MouseMove($coord[0], $coord[1], 1)oÝ÷ Ú«¨µ

[center]Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.[/center]

Share this post


Link to post
Share on other sites

Yes i am new to this all but i learn fast ;)

I got the pixel search working

Thank you

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