Jump to content

Pause while mouse clicked


 Share

Recommended Posts

Here is my script so far

Global $Paused
HotKeySet("{PAUSE}", "TogglePause")

While 1
    Sleep(300)
    $mousedata = MouseGetPos()
    $var = PixelGetColor( 637, 446 )
    If $var = 0x300A07 Then MouseClick("left", 571, 757, 1, 0) 
    If $var = 0x55291B Then MouseClick("left", 605, 757, 1, 0)
    If $var = 0xA3832A Then MouseClick("left", 588, 791, 1, 0) 
    If $var = 0x7B0000 Then MouseClick("left", 725, 772, 1, 0)
    If $var = 0x260700 Then MouseClick("left", 555, 772, 1, 0)
    If $var = 0xF1CC7B Then MouseClick("left", 603, 791, 1, 0)
    If $var = 0x411E22 Then MouseClick("left", 688, 772, 1, 0)
    If $var = 0xC44711 Then MouseClick("left", 587, 757, 1, 0)
    If $var = 0xBBA2E5 Then MouseClick("left", 622, 757, 1, 0)
    MouseMove($mousedata[0], $mousedata[1], 0) 
WEnd

Func TogglePause()
    $Paused = NOT $Paused
    While $Paused
        sleep(100)
        ToolTip('Script is "Paused"',1150,0)
    WEnd
    ToolTip("")
EndFunc

Basically I want the script to momentarily pause or not click if I left or right click manually. How can I accomplish this?

I was thinking something like:

If $var = 0x300A07 And (Mouse = not clicked) Then MouseClick("left", 571, 757, 1, 0)

I just do not know exactly what code you would use.

TIA

Edited by jmoney
Link to comment
Share on other sites

#include <Misc.au3>

$dll = DllOpen("user32.dll")

While 1
    Sleep ( 250  )
    If [color="#ffffff"]_IsPressed[/color]("23", $dll) Then
         MsgBox(0,"_IsPressed", "End Key  Pressed")
        ExitLoop
    EndIf
WEnd
DllClose($dll)

See _IsPressed UDF in AutoIt docs

- Bruce /*somdcomputerguy */  If you change the way you look at things, the things you look at change.

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