Jump to content

How to stop/pause my script during action?


Recommended Posts

Hi my following script should stop clicking/close/pause when F4 is pressed.

How can i do this?

Global Const $Dev = "Me, Myself and I!"

$click = Inputbox("Click's", "How many times should it click?")

HotkeySet("{F3}", "Start")
HotkeySet("{F4}", "Stop")

TrayTip("HotKey's", "F3 = Start; F4 = Stop"&@CRLF&"Clicks: "&$click&@CRLF&"Attention: during clicks HotKey 'F4' will not work."&@CRLF&"Version: "&$V&@CRLF&"Developer: "&$Dev, 20, 1)


While 1
    Sleep(100)
WEnd

Func Stop()
    Exit 0
EndFunc

Func Start()
     MouseClick("left", MouseGetPos(0), MouseGetPos(1), $click)
While 1
    Stop()
WEnd
 EndFunc
Link to comment
Share on other sites

@KillingEye

CODE

Local $Dev = "Me, Myself and I!"

Local $V = @AutoItVersion

Local $Stop = False

$click = InputBox("Click's", "How many times should it click?")

HotKeySet("{F3}", "Start")

HotKeySet("{F4}", "Stop")

TrayTip("HotKey's", "F3 = Start; F4 = Stop" & @CRLF & "Clicks: " & $click & @CRLF & "Attention: during clicks HotKey 'F4' will not work." & @CRLF & "Version: " & $V & @CRLF & "Developer: " & $Dev, 1, 1)

While 1

Sleep(100)

WEnd

Func Stop( )

$Stop = True

EndFunc ;==>Stop

Func Start( )

For $i_Click = 1 to $click

If $Stop = True Then ExitLoop

MouseClick("left", MouseGetPos(0), MouseGetPos(1), 1, 0)

Next

$Stop = False

EndFunc ;==>Start

Cheers, FireFox.

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