Jump to content
Sign in to follow this  
KillingEye

How to stop/pause my script during action?

Recommended Posts

KillingEye

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

Share this post


Link to post
Share on other sites
FireFox

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


 

OS : Win XP SP2 (32 bits) / Win 7 SP1 (64 bits) / Win 8 (64 bits) | Autoit version: latest stable / beta.
Hardware : Intel(R) Core(TM) i5-2400 CPU @ 3.10Ghz / 8 GiB RAM DDR3.

My UDFs : Skype UDF | TrayIconEx UDF | GUI Panel UDF | Excel XML UDF | Is_Pressed_UDF

My Projects : YouTube Multi-downloader | FTP Easy-UP | Lock'n | WinKill | AVICapture | Skype TM | Tap Maker | ShellNew | Scriptner | Const Replacer | FT_Pocket | Chrome theme maker

My Examples : Capture toolIP Camera | Crosshair | Draw Captured Region | Picture Screensaver | Jscreenfix | Drivetemp | Picture viewer

My Snippets : Basic TCP | Systray_GetIconIndex | Intercept End task | Winpcap various | Advanced HotKeySet | Transparent Edit control

 

Share this post


Link to post
Share on other sites
KillingEye

Thank you!

It works!

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  

×