Blasphemy Posted August 18, 2007 Share Posted August 18, 2007 How would I start the script paused? So i open it, I can do other things for a while. Hit a certain key, The script unpauses and at the end returns to start (Paused) If you understand me, Cheers. Link to comment Share on other sites More sharing options...
martin Posted August 18, 2007 Share Posted August 18, 2007 How would I start the script paused?So i open it, I can do other things for a while. Hit a certain key, The script unpauses and at the end returns to start (Paused)If you understand me, Cheers.Maybe use HotKeyset? Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script. Link to comment Share on other sites More sharing options...
Delta01 Posted August 18, 2007 Share Posted August 18, 2007 HotKeySet("{PAUSE}", "TogglePause"); This goes at the beginning of the code ;===> Everything before while 1 here. TogglePause() While 1 [...] Wend Func TogglePause() Func TogglePause() $Paused = NOT $Paused While $Paused sleep(100) WEnd EndFunc;Goes at the end Link to comment Share on other sites More sharing options...
Blasphemy Posted August 18, 2007 Author Share Posted August 18, 2007 (edited) Cheers, I'll search for that and probably post again If i can't figure out Edit: Thanks delta I'll try that. Edited August 18, 2007 by Blasphemy Link to comment Share on other sites More sharing options...
Delta01 Posted August 18, 2007 Share Posted August 18, 2007 (edited) Np Edited August 18, 2007 by Delta01 Link to comment Share on other sites More sharing options...
Blasphemy Posted August 18, 2007 Author Share Posted August 18, 2007 (edited) Edit: I got it working.. Now I have it so it can come up with a message when i hit pause. But not move mouse/Keyboard key. Code is: Global $Paused HotKeySet("{PAUSE}", "TogglePause") While 1 Wend Func TogglePause() $Paused = $Paused While $Paused sleep(100) WEnd MsgBox(0, "Hai", "Hai") EndFunc Edited August 18, 2007 by Blasphemy Link to comment Share on other sites More sharing options...
xwinterx Posted September 16, 2007 Share Posted September 16, 2007 I've tried that script. It doesn't pause the script imediately when started, a user has to intervene by pressing the keboard's 'Pause' button. is there any way to pause the script automatically on its own when it starts but also allows other functions to run, like 'start' and 'exit'(assuming I made those in tray icon menu using TrayCreateItem()) You can try this: Global $Paused HotKeySet("{PAUSE}", "TogglePause") ; this pauses your script Send("{PAUSE}") ; insert your code after the above line ; modified pause function to allow reading tray messages Func TogglePause() $Paused = $Paused While $Paused sleep(10) $msg = TrayGetMsg() Select Case $msg = $exit Exit Case $msg = $start ;; place whatever here EndSelect WEnd EndFunc I use a modified pause function frequently for some of the scripts I build. Lemme know if this helps. Link to comment Share on other sites More sharing options...
xwinterx Posted September 16, 2007 Share Posted September 16, 2007 what about allowing other functions to work while the script is paused? Is that possible?as in???you can add functions before or after the select/endselect or you can use an Adlib command. depends on the desired effect. all the pause script is is just a loop that normally does nothing so your script does nothing but loop. It isnt any different than any while/wend script. 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