Innocuous Posted October 1, 2007 Share Posted October 1, 2007 well i just made a little test scipt and it works, but when ive paused and unpaused it once, then it doesnt work anymore... why? $pause=1 HotKeySet("{PAUSE}", "_pause") Func _pause() Select case $pause=1 pause() case $pause=2 unpause() EndSelect EndFunc Func pause() $pause=$pause+1 AdlibEnable("pause") sleep(300) EndFunc func unpause() $pause=$pause-1 AdlibDisable() EndFunc Link to comment Share on other sites More sharing options...
Zedna Posted October 1, 2007 Share Posted October 1, 2007 Try this: $pause=0 HotKeySet("{ESC}", "quit") HotKeySet("{PAUSE}", "pause") While 1 ConsoleWrite('running ...' & @CRLF) Sleep(1000) WEnd Func pause() $pause = Not $pause While $pause ConsoleWrite('paused ...' & @CRLF) Sleep(1000) WEnd EndFunc Func quit() Exit EndFunc Resources UDF ResourcesEx UDF AutoIt Forum Search Link to comment Share on other sites More sharing options...
zemen Posted October 1, 2007 Share Posted October 1, 2007 $pause=0 HotKeySet("{ESC}", "quit") HotKeySet("{PAUSE}", "pause") While 1 ConsoleWrite('running ...' & @CRLF) Sleep(1000) WEnd Func pause() $pause = Not $pause While $pause ConsoleWrite('paused ...' & @CRLF) Sleep(1000) WEnd EndFunc Func quit() Exit EndFuncis this func able to pause Adlib too? or adlib is still working when the script is paused? Link to comment Share on other sites More sharing options...
Generator Posted October 1, 2007 Share Posted October 1, 2007 Technicially you are not pausing the script, you are putting it in an idle loop which it does nothing(paused), and when you continue it goes back to your main loop and does your commands. You can only pause it if you use the default trayicon. Adlib will work throughout the entire script. Unless you use AdlibDisable() Correct me if i am wrong. Link to comment Share on other sites More sharing options...
zemen Posted October 1, 2007 Share Posted October 1, 2007 ok, so the only way is to disable and enable the adlib modding that code isnt it? $pause=0 HotKeySet("{ESC}", "quit") HotKeySet("{PAUSE}", "pause") While 1 ConsoleWrite('running ...' & @CRLF) Sleep(1000) WEnd Func pause() $pause = Not $pause While $pause AdlibDisable() ConsoleWrite('paused ...' & @CRLF) Sleep(1000) WEnd AdlibEnable("Func") EndFunc Func quit() Exit EndFunc is this correct? 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