Jump to content

Pause script


Recommended Posts

i have script working...what code should i attach to my hotkey to pause the woking function??

$HK = "{F9}"

HotKeySet($HK, "pause")

; i have function start() and its is currently working...

Func pause()

;what should be my code here to terminate or pause the function start???

endfunc

I also have these codes...

Switch @HotKeyPressed
        Case $HK3
            $Ini1 = $Init + 1
            IniWrite($ConfigFile, "Main Prefs", "bpm", $Ini1)
        Case $HK4
            $Ini1 = $Init - 1
            IniWrite($ConfigFile, "Main Prefs", "bpm", $Ini1)
EndSwitch

my target there is to run my function start() with corresponding changes with $Ini1...I like it to be, everytime the $HK3 is pressed, the value of $Ini1 will increase by 1... help me please...

Link to comment
Share on other sites

Global $Paused

HotKeySet("{delete}","pause")
Func pause()
    $Paused = NOT $Paused
    While $Paused
        sleep(100)
    WEnd

EndFunc

[quote]Don't expect for a perfect life ... Expect a least troubles ones[/quote]Contact me : ass@kiss.toWhat I Have Done :Favorites Manager Mangage your favorite's folder, that's coolPC Waker For those who want to save stickersWebScipts Supporter For those who've just started with Web and WebScriptsTemporary Looker Simple but powerful to manage your Temporary folder, you know what you downloaded[UDF] _NumberFormat() Better performance on number display[UDF] _DirGet() What a folder contain [how many (hidden,normal,...) files], with one line of code[UDF] _IsPressEs() Just like _IsPress() but for a group of keys

Link to comment
Share on other sites

Here's a quick example how to pause/unpause your script with a hotkey:

HotKeySet("{F9}","pause")
Global $bool=False
while 1
    sleep(100)
WEnd


Func pause()
    $bool=Not $bool
    while $bool
        sleep(10)
        ConsoleWrite("Paused!"&@CRLF)
    WEnd
EndFunc

Edit: Wow, cool d4rk and I thought almost exactly the same :D

Edited by monoceres

Broken link? PM me and I'll send you the file!

Link to comment
Share on other sites

yup i got it... but how about this one??

I also have these codes...

Switch @HotKeyPressed
        Case $HK3
            $Ini1 = $Init + 1
            IniWrite($ConfigFile, "Main Prefs", "bpm", $Ini1)
        Case $HK4
            $Ini1 = $Init - 1
            IniWrite($ConfigFile, "Main Prefs", "bpm", $Ini1)
EndSwitch

my target there is to run my function start() with corresponding changes with $Ini1...I like it to be, everytime the $HK3 is pressed, the value of $Ini1 will increase by 1... help me please...

Link to comment
Share on other sites

did you declare the $Ini1 at first ?

$Ini1=0
...

[quote]Don't expect for a perfect life ... Expect a least troubles ones[/quote]Contact me : ass@kiss.toWhat I Have Done :Favorites Manager Mangage your favorite's folder, that's coolPC Waker For those who want to save stickersWebScipts Supporter For those who've just started with Web and WebScriptsTemporary Looker Simple but powerful to manage your Temporary folder, you know what you downloaded[UDF] _NumberFormat() Better performance on number display[UDF] _DirGet() What a folder contain [how many (hidden,normal,...) files], with one line of code[UDF] _IsPressEs() Just like _IsPress() but for a group of keys

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