Jump to content
Sign in to follow this  
bigassmuffin

MouseClick...Scrollclick?

Recommended Posts

bigassmuffin

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

Share this post


Link to post
Share on other sites
SmOke_N

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.

Share this post


Link to post
Share on other sites
BigDod

#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


Get Beta versions Here Get latest SciTE editor Here AutoIt 1-2-3 by Valuater - A great starting point.

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

Share this post


Link to post
Share on other sites
bigassmuffin

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

Edited by bigassmuffin

Share this post


Link to post
Share on other sites
BigDod

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.


Get Beta versions Here Get latest SciTE editor Here AutoIt 1-2-3 by Valuater - A great starting point.

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

Share this post


Link to post
Share on other sites
bigassmuffin

i think mine is the laterst (not beta) its the version rite b4 they added the play sound function thing..

Oh..i have v3

Share this post


Link to post
Share on other sites
GaryFrost

i think mine is the laterst (not beta) its the version rite b4 they added the play sound function thing..

Oh..i have v3

v3.2.0.1 is the latest


SciTE for AutoItDirections for Submitting Standard UDFs

 

Don't argue with an idiot; people watching may not be able to tell the difference.

 

Share this post


Link to post
Share on other sites
bigassmuffin

Alrgiht, thanks everyone, works great!

Share this post


Link to post
Share on other sites
bigassmuffin

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!

Share this post


Link to post
Share on other sites
Bundy

$pos = MouseGetPos()

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

Share this post


Link to post
Share on other sites
bigassmuffin

$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

Share this post


Link to post
Share on other sites
bigassmuffin

I still need hep trying to use the pixel search within 50 pixels of the spot where I clicked using the scroller

Thank you for your time and help

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  

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.