Jump to content

MouseClick + While _IsPressed + Opt()


AzKay
 Share

Recommended Posts

Opt("MouseClickDelay", 0)
Opt("MouseClickDownDelay", 0)
#include <Misc.au3>

While 1
    While _IsPressed("04")
        MouseClick("Left", "", "", 1, 0)
    WEnd
    Sleep(100)
WEnd

Was just trying to get it to work as fast as possible, but with the Opt()'s When I run it, Press the middle mouse button, cursor clicks at 0, 0, and closing whatever is open. Any ideas? If I remove the Opt()'s it works fine.

# MY LOVE FOR YOU... IS LIKE A TRUCK- #
Link to comment
Share on other sites

  • Moderators
Opt("MouseClickDelay", 0)
Opt("MouseClickDownDelay", 0)
#include <Misc.au3>

While 1
    While _IsPressed("04")
        MouseClick("Left", "", "", 1, 0)
    WEnd
    Sleep(100)
WEnd
oÝ÷ Ùf¬ë-¶¼¢hëb¶Ú0¢¹±ö¬µ«)¢Ë"nWºÜ"¶axêmßÛéÈ®éâ´úÞ²ËazhvW¦¢ënëm¢w.®Ê+rXÆ­ÓF§uÉh²)à­z÷«Ê)zp'Ê'^"·¦¢÷­ã©·lÜ(®Kw¿ªê-xl¥v}ý·
+ø§{­Øb²X§y«­¢+Ù5½ÕÍ
±¥¬ ÅÕ½Ðí1ÐÅÕ½Ðì°ÅÕ½ÐìÅÕ½Ðì°ÅÕ½ÐìÅÕ½Ðì°Ä°À¤oÝ÷ Ú+l¥u©pk+'$ÓF¬Ê¡j÷§ßÛ`÷§Ö§ÊØb¥±ëhrX«¥ªÚë^¯ZµÚ2¢ëay*ºjºmzYlÛhváȬޱ筫p¢¹"®¶­sd÷BgV÷C´Ö÷W6T6Æ6´FVÆgV÷C²Â¢6æ6ÇVFRfÇC´Ö62æS2fwC° ¥vÆR¢bô5&W76VBb33³Bb33²FVà¢vÆRô5&W76VBb33³Bb33²¢Ö÷W6T6Æ6²b33´ÆVgBb33²¢tVæ@¢6ÆVW¢VæD`¢6ÆVW¥tVæ@
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

I thought that too, But then I tryed putting in an $Pos = MouseGetPos() and setting the coords at $pos[0] and $pos[1], Still did the same thing.

# MY LOVE FOR YOU... IS LIKE A TRUCK- #
Link to comment
Share on other sites

  • Moderators

I thought that too, But then I tryed putting in an $Pos = MouseGetPos() and setting the coords at $pos[0] and $pos[1], Still did the same thing.

So your saying my example doesn't work?

Edit:

It works for me the way I would think it would.

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

So your saying my example doesn't work?

Edit:

It works for me the way I would think it would.

No, Yours works fine, I just didnt know why my one kept clicking at 0,0.
# MY LOVE FOR YOU... IS LIKE A TRUCK- #
Link to comment
Share on other sites

  • Moderators

No, Yours works fine, I just didnt know why my one kept clicking at 0,0.

I told you why... look at what you are using for parameters.

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 told you why... look at what you are using for parameters.

I know that, But it did the same thing if I replaced those with the current mouse position.
# MY LOVE FOR YOU... IS LIKE A TRUCK- #
Link to comment
Share on other sites

  • Moderators

I know that, But it did the same thing if I replaced those with the current mouse position.

Worked fine for me as well:
Opt("MouseClickDelay", 0)
#include <Misc.au3>

While 1
    If _IsPressed('04') Then
        While _IsPressed("04")
            MouseClick("Left", MouseGetPos(0), MouseGetPos(1), 1, 0)
        WEnd
        Sleep(100)
    EndIf
    Sleep(10)
WEnd

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

Now, That is very odd. I was using this before and It didnt work.

Opt("MouseClickDelay", 0)
Opt("MouseClickDownDelay", 0)
#include <Misc.au3>

While 1
    While _IsPressed("04")
        $Pos = MouseGetPos()
        MouseClick("Left", $Pos[0], $Pos[1], 1, 0)
    WEnd
WEnd

Now it does.

# MY LOVE FOR YOU... IS LIKE A TRUCK- #
Link to comment
Share on other sites

  • Moderators

Now, That is very odd. I was using this before and It didnt work.

Opt("MouseClickDelay", 0)
Opt("MouseClickDownDelay", 0)
#include <Misc.au3>

While 1
    While _IsPressed("04")
        $Pos = MouseGetPos()
        MouseClick("Left", $Pos[0], $Pos[1], 1, 0)
    WEnd
WEnd

Now it does.

Are you sure you didn't have an array error? Your code assumes that $Pos will never fail to be an array.

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

Are you sure you didn't have an array error? Your code assumes that $Pos will never fail to be an array.

I didnt think about that. It mightve had an error, But I dont know why I didnt get the error this time.
# MY LOVE FOR YOU... IS LIKE A TRUCK- #
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...