Sign in to follow this  
Followers 0
Scuba Jesus

Move mouse to colour?

7 posts in this topic

Hello everyone, I just got this wonderful program and went through the little 'hello world' and notepad tutorials, and I was going to go onto someting a little more advanced. I was going to try to make it find a specified colour in a flash game and mouse over it. Here's what I came up with up until the point of how to tell it to mouse over the colour.

WinWaitActive("Weebls Stuff - Pumpkin - Mozilla Firefox")
MouseClick ( "left", 588, 611, 2)
MouseClick ( "left", 588, 611, 2)
PixelSearch (349, 422, 900, 821, 0xFF8000)
*MouseMove to (color)*

The part I don't know how to do is in the asterisks. I know the first 3 steps are fine, clicks to go to instructions and then to game, my box is fine, colour is orange, but I just couldn't find anything on how to tell it to mouse over a colour instead of to a point. I would be most thankful if someone could please help me on this matter.

Share this post


Link to post
Share on other sites



Look at the example for PixelSearch in the help file.


[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

Look at the example for PixelSearch in the help file.

I like to make it more idiot-proof

PixelSearch

Share this post


Link to post
Share on other sites

I already finished looking through the PixelSearch help section and giving a good few guesses before refreshing the page to get a link.

I still need more help, it can find the colour and tell me it, but I don't know how to tell it to make the mouse go there.

If Not @error Then
    MouseMove ($coord[0] & "," & $coord[1])
EndIf

That gave me an error as I thought it probably would, so I tried making it more like the message box example by changing it to '(0, $coord...' but that just made the mouse move off to the side. Thanks for the help so far it made me learn a bit more, but I still don't kno whow to move the mouse.

Share this post


Link to post
Share on other sites

#6 ·  Posted (edited)

$coord[0] = X

$coord[1] = Y

MouseMove(X,Y)... play with the puzzle :whistle:

Edit:

Note... There are 2 mandatory parameters for MouseMove()

You have made yours 1 parameter with $coord[0] & ',' & $coord[1], if you replace & "," & with just , what do you get?

Edited by SmOke_N

[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

Ah thank you very much SmOke_N, I can't believe I didn't think to do MouseMove ($coord[0],$coord[1]). I blame my lack of caffeine, time to go buy some bawls. Off to more AutoIt practicing.

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