Jump to content

_ispressed


ashley
 Share

Recommended Posts

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
Link to comment
Share on other sites

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]

Link to comment
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

Edited by JBeef
Link to comment
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

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