LiLShinta Posted April 27, 2008 Share Posted April 27, 2008 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 More sharing options...
d4rk Posted April 27, 2008 Share Posted April 27, 2008 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 More sharing options...
monoceres Posted April 27, 2008 Share Posted April 27, 2008 (edited) 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 Edited April 27, 2008 by monoceres Broken link? PM me and I'll send you the file! Link to comment Share on other sites More sharing options...
LiLShinta Posted April 27, 2008 Author Share Posted April 27, 2008 how bout that... if i will terminate the working script to start it again with changed value of $Ini1?? Link to comment Share on other sites More sharing options...
rasim Posted April 27, 2008 Share Posted April 27, 2008 how bout that... if i will terminate the working script to start it again with changed value of $Ini1??Use InputBox() function. Link to comment Share on other sites More sharing options...
LiLShinta Posted April 27, 2008 Author Share Posted April 27, 2008 nope, i mean i would like to start the whole script again without exiting... Link to comment Share on other sites More sharing options...
monoceres Posted April 27, 2008 Share Posted April 27, 2008 nope, i mean i would like to start the whole script again without exiting...Test pausing my example with F9, then press F9 again and be amazed Broken link? PM me and I'll send you the file! Link to comment Share on other sites More sharing options...
LiLShinta Posted April 27, 2008 Author Share Posted April 27, 2008 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 More sharing options...
d4rk Posted April 27, 2008 Share Posted April 27, 2008 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 More sharing options...
LiLShinta Posted April 27, 2008 Author Share Posted April 27, 2008 nope but i did declare $init as default value of 101.. Global $init = IniRead($ConfigFile, "Main Prefs", "bpm", 101) isnt it right? Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now