Jump to content
Sign in to follow this  
h3nno

_IsPressed

Recommended Posts

h3nno

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

Share this post


Link to post
Share on other sites
Generator

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

Share this post


Link to post
Share on other sites
enaiman

:whistle: I'm puzzled ...

Sleep (1) ... Sleep(3) between mouse clicks?

Is your mouse so fast? (can windows react to clicks at 3 msec interval?)

I guess you've missed 00


SNMP_UDF ... for SNMPv1 and v2c so far, GetBulk and a new example script

wannabe "Unbeatable" Tic-Tac-Toe

Paper-Scissor-Rock ... try to beat it anyway :)

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.