Jump to content

_IsPressed


Recommended Posts

I am trying to make a bot, that fires multi pal time on the one click. but i am having trouble with the _IsPressed statement.

#Include <Misc.au3>
Dim $primary
Dim $secondary
;Determine if user has swapped rightand left mouse buttons
$k = RegRead("HKEY_CURRENT_USER\Control Panel\Mouse", "SwapMouseButtons")

; It's okay to NOT check the success of the RegRead operation
If $k = 1 Then
    $primary = "right"
    $secondary = "left"
Else;normal (also case if could not read registry key)
    $primary = "left"
    $secondary = "right"
EndIf

Global  $Paused
HotKeySet("{PAUSE}", "Pause")
HotKeySet(_IsPressed("01") , "Click")   <------------ I think my problem is here.
HotKeySet("{End}",  "Terminate")

While 1
     Sleep(100)
     
WEnd

Func Click()
    
    MouseClick ($primary)
    Sleep(3)
    MouseClick ($primary)
    Sleep(3)
    MouseClick ($primary)
    Sleep(3)
    MouseClick ($primary)
    Sleep(3)

EndFunc

Func Pause()
    $Paused = NOT  $Paused
    While $Paused
        sleep(100)
        ToolTip('Script is  "Paused"')
    WEnd
    ToolTip("")
EndFunc

Func  Terminate()
    Exit 0
EndFunc
Link to comment
Share on other sites

I am trying to make a bot, that fires multi pal time on the one click. but i am having trouble with the _IsPressed statement.

#Include <Misc.au3>
Dim $primary
Dim $secondary
;Determine if user has swapped rightand left mouse buttons
$k = RegRead("HKEY_CURRENT_USER\Control Panel\Mouse", "SwapMouseButtons")

; It's okay to NOT check the success of the RegRead operation
If $k = 1 Then
    $primary = "right"
    $secondary = "left"
Else;normal (also case if could not read registry key)
    $primary = "left"
    $secondary = "right"
EndIf

Global  $Paused
HotKeySet("{PAUSE}", "Pause")
HotKeySet("{End}",  "Terminate")

While 1
         If _IsPressed("01") Then
             Do
             Sleep(1)
             Until Not _IsPressed("01")
         Click()
EndIf
     Sleep(1)
     
WEnd

Func Click()
    
    MouseClick ($primary)
    Sleep(3)
    MouseClick ($primary)
    Sleep(3)
    MouseClick ($primary)
    Sleep(3)
    MouseClick ($primary)
    Sleep(3)

EndFunc

Func Pause()
    $Paused = NOT  $Paused
    While $Paused
        sleep(100)
        ToolTip('Script is  "Paused"')
    WEnd
    ToolTip("")
EndFunc

Func  Terminate()
    Exit 0
EndFunc
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...