Jump to content

Move mouse to colour?


Recommended Posts

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.

Link to comment
Share on other sites

  • Moderators

Look at the example for PixelSearch in the help file.

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.

Link to comment
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.

Link to comment
Share on other sites

  • Moderators

$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

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.

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