Jump to content

MouseClick...Scrollclick?


Recommended Posts

I am wanting to make a program (I jsut started, so nothing to really show) where it starts a pixel search once the mouse scroll is pressed.

The one other problem I am going to have is I awnt the pixel search to be within 50 pixels of where the mouse scroll was clicked, from there I can do the rest.

$color = hex color

While 1

If Scroll Click Then

$coord = PixelSearch( within 50 pixels of mouse click, $color, 10, 20 )

If IsArray($coord) = 1 Then

MouseClick('right', $coord[0], $coord[1], 1, 0)

Wend

Somehtig like above, but clearly that doesnt work

THANK YOU FOR YOUR TIME AND HELP!

Edited by bigassmuffin
Link to comment
Share on other sites

  • Moderators

I am wanting to make a program (I jsut started, so nothing to really show) where it starts a pixel search once the mouse scroll is pressed.

The one other problem I am going to have is I awnt the pixel search to be within 50 pixels of where the mouse scroll was clicked, from there I can do the rest.

While 1

If Scroll Click Then

MouseGetPos() + 50?

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

#include <Misc.au3>

$dll = DllOpen("user32.dll")

While 1
    Sleep ( 250 )
    If _IsPressed("04", $dll) Then
        MsgBox(0,"_IsPressed", "Scroll wheel pressed")
        ExitLoop
    EndIf
WEnd
DllClose($dll)

Edit - You can use MouseGetPos to get the mouse position

Edited by BigDod


Time you enjoyed wasting is not wasted time ......T.S. Elliot
Suspense is worse than disappointment................Robert Burns
God help the man who won't help himself, because no-one else will...........My Grandmother

Link to comment
Share on other sites

wow, thanks for the fast replys, let me try this out and see how it goes, thanks !

edit:

If _IsPressed("04", $dll) Then

returns an error??

Which version of AutoIt are you using, this needs latest release or Beta.


Time you enjoyed wasting is not wasted time ......T.S. Elliot
Suspense is worse than disappointment................Robert Burns
God help the man who won't help himself, because no-one else will...........My Grandmother

Link to comment
Share on other sites

One more quick thing:

the coe is now this:

$color = _ _ _ _ _ _

#include <Misc.au3>

$dll = DllOpen("user32.dll")

While 1
    Sleep ( 250 )
    If _IsPressed("04", $dll) Then
        $coord = PixelSearch( 0, 0, 1023, 651, $color, 10, 20)
        If IsArray($coord) = 1 Then
            MouseClick('right', $coord[0], $coord[1], 1, 0)
    EndIf
WEnd
DllClose($dll)

For the pixel search, I want it to search within an area of 50 pixels of when the scroll key was clicked, how do I do this?

$coord = PixelSearch( 50 pixels around the click, $color, 10, 20)

THANKS AGAIN FOR ALL YOUR TIME AND HELP!

Link to comment
Share on other sites

$pos = MouseGetPos()

$coord = PixelSearch($pos[0]-50, $pos[1]-50,$color, 10, 20)

$color = 0xA52C29

#include <Misc.au3>

$dll = DllOpen("user32.dll")

While 1
    Sleep ( 250 )
    If _IsPressed("04", $dll) Then
        $pos = MouseGetPos()
        $coord = PixelSearch($pos[0]-50, $pos[1]-50,$color, 5, 2)
        If IsArray($coord) = 1 Then
            MouseClick('right', $coord[0], $coord[1], 1, 0)
        EndIf
    EndIf
WEnd
DllClose($dll)

Does not work...?

Edited by bigassmuffin
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...