Sign in to follow this  
Followers 0
ashley

_ispressed

6 posts in this topic

#1 ·  Posted (edited)

i want to so it will constantly click but if ESC is pressed i want it to exit.

#include <GUIConstants.au3>
#include <Misc.au3>

$dll = DllOpen("user32.dll")

#Region ### START Koda GUI section ### Form=
$GUI = GUICreate("AutoClicker - AGRORS", 229, 56, 303, 219)
GUISetIcon("D:05.ico")
$Input1 = GUICtrlCreateInput("Click every", 8, 16, 65, 21, BitOR($ES_AUTOHSCROLL,$ES_READONLY))
$Input2 = GUICtrlCreateInput("1000", 80, 16, 41, 21)
$Input3 = GUICtrlCreateInput("ms", 128, 16, 33, 21, BitOR($ES_AUTOHSCROLL,$ES_READONLY))
$Start = GUICtrlCreateButton("Start", 168, 8, 51, 41, 0)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###

While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $GUI_EVENT_CLOSE
            DllClose($dll)
            Exit
        Case $Start
            While 1
                If _IsPressed("{esc}", $dll) Then
                Exit
                EndIf
                $read = GUICtrlRead($Input2)
                MouseClick("Left")
                Sleep($read)
            Wend
EndSwitch
WEnd
Edited by ashley

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

i want to so it will constantly click but if ESC is pressed i want it to exit.

#include <GUIConstants.au3>
#include <Misc.au3>

$dll = DllOpen("user32.dll")

#Region ### START Koda GUI section ### Form=
$GUI = GUICreate("AutoClicker - AGRORS", 229, 56, 303, 219)
GUISetIcon("D:05.ico")
$Input1 = GUICtrlCreateInput("Click every", 8, 16, 65, 21, BitOR($ES_AUTOHSCROLL,$ES_READONLY))
$Input2 = GUICtrlCreateInput("1000", 80, 16, 41, 21)
$Input3 = GUICtrlCreateInput("ms", 128, 16, 33, 21, BitOR($ES_AUTOHSCROLL,$ES_READONLY))
$Start = GUICtrlCreateButton("Start", 168, 8, 51, 41, 0)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###

While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $GUI_EVENT_CLOSE
            DllClose($dll)
            Exit
        Case $Start
            While 1
                If _IsPressed("{esc}", $dll) Then
                Exit
                EndIf
                $read = GUICtrlRead($Input2)
                MouseClick("Left")
                Sleep($read)
            Wend
EndSwitch
WEnd

Two things:

1st, _IsPressed should be looking for "1B" (the value that matches the ESC key).

2nd, I think it's just a matter of the Sleep() delay... If you set the 1B and then hit the key like mad, it will stop - but basically you're trying to fit your keypress within that micro-moment between Sleep() cycles.

I'd suggest using HotKeySet() instead.

Hope that helps

Edited by Monamo

- MoChr(77)& Chr(97)& Chr(100)& Chr(101)& Chr(32)& Chr(121)& Chr(97)& Chr(32)& Chr(108)& Chr(111)& Chr(111)& Chr(107)-------I've told you 100,000 times not to exaggerate!-------Don't make me hit you with my cigarette hand...-------My scripts:Random Episode Selector, Keyboard MouseMover, CopyPath v2.1, SmartRename for XP,Window Tracer[sup]New![/sup]

Share this post


Link to post
Share on other sites

#3 ·  Posted (edited)

okey smokey. this with "uh oh" written on it. maybe -

#include <GUIConstants.au3>

HotKeySet("{ESC}","goobye")

$GUI = GUICreate("AutoClicker - AGRORS", 229, 56, 303, 219)
GUISetIcon("D:05.ico")
$Input1 = GUICtrlCreateInput("Click every", 8, 16, 65, 21, BitOR($ES_AUTOHSCROLL,$ES_READONLY))
$Input2 = GUICtrlCreateInput("1000", 80, 16, 41, 21)
$Input3 = GUICtrlCreateInput("ms", 128, 16, 33, 21, BitOR($ES_AUTOHSCROLL,$ES_READONLY))
$Start = GUICtrlCreateButton("Start", 168, 8, 51, 41, 0)
GUISetState(@SW_SHOW)

While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $GUI_EVENT_CLOSE
            Exit
        Case $Start
            While 1
                $read = GUICtrlRead($Input2)
                MouseClick("Left")
                Sleep($read)
            Wend
    EndSwitch
WEnd

Func goobye()
    Exit
EndFunc
but watch out for crazy. ~Jap

Edited by JBeef

Share this post


Link to post
Share on other sites

okey smokey. this with "uh oh" written on it. maybe -

#include <GUIConstants.au3>

HotKeySet("{ESC}","goobye")

$GUI = GUICreate("AutoClicker - AGRORS", 229, 56, 303, 219)
GUISetIcon("D:05.ico")
$Input1 = GUICtrlCreateInput("Click every", 8, 16, 65, 21, BitOR($ES_AUTOHSCROLL,$ES_READONLY))
$Input2 = GUICtrlCreateInput("1000", 80, 16, 41, 21)
$Input3 = GUICtrlCreateInput("ms", 128, 16, 33, 21, BitOR($ES_AUTOHSCROLL,$ES_READONLY))
$Start = GUICtrlCreateButton("Start", 168, 8, 51, 41, 0)
GUISetState(@SW_SHOW)

While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $GUI_EVENT_CLOSE
            Exit
        Case $Start
            While 1
                $read = GUICtrlRead($Input2)
                MouseClick("Left")
                Sleep($read)
            Wend
    EndSwitch
WEnd

Func goobye()
    Exit
EndFunc
but watch out for crazy. ~Jap

thanks m8

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  
Followers 0