tom13 Posted June 10, 2007 Share Posted June 10, 2007 Hi, I want to let my script stop and exit immediately when I press the pause button... so I made this and bound it to the pause key: Func Quit() Exit EndFunc But when a piece of code/script is still in the "queue" it first executes it and then exits, but I want it to stop all actions immediately and quit immediately, without completing the current action... is this possible? Thanks in advance. Link to comment Share on other sites More sharing options...
Mast3rpyr0 Posted June 10, 2007 Share Posted June 10, 2007 (edited) dont make it a function but in a switch $Quit = {Pause} ; How ever you check for hotkeys While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $Quit Exit EndSwitch WEnd not sure if this will work any differently but thats all i can think of. EDIT: maybe this will work? Edited June 10, 2007 by Mast3rpyr0 My UDF's : _INetUpdateCheck() My Programs : GameLauncher vAlpha, InfoCrypt, WindowDesigner, ScreenCap, DailyRemindersPick3GeneratorBackupUtility! Other : Bored? Click Here! Link to comment Share on other sites More sharing options...
tom13 Posted June 10, 2007 Author Share Posted June 10, 2007 that way I can't bind it to the <pause> key, can I? Link to comment Share on other sites More sharing options...
Achilles Posted June 10, 2007 Share Posted June 10, 2007 (edited) Hi, I want to let my script stop and exit immediately when I press the pause button... so I made this and bound it to the pause key: Func Quit() Exit EndFunc Using GuiEventMode is more efficient (or so I've heard) then a normal loop, and also actions are taken immediately when an event happens. Also, the part I like, is that this mode keeps buttons and other changes out of the main loop which can let you put other things in there that aren't on event. Edited June 10, 2007 by Piano_Man My Programs[list][*]Knight Media Player[*]Multiple Desktops[*]Daily Comics[*]Journal[/list] Link to comment Share on other sites More sharing options...
Busti Posted June 10, 2007 Share Posted June 10, 2007 hotkeyset( "{esc}" , "Quit" ) func Quit() exit endfunc My UDF's : Startet on : 06.06.2006_CaseSearchOrReplaceStr();~> Searches OR Replaces a String,;~> With or Without Casesensivity Link to comment Share on other sites More sharing options...
Valuater Posted June 10, 2007 Share Posted June 10, 2007 hotkeyset( "{esc}" , "Quit" )func Quit()exitendfuncIf you are using GUIGetMsg(), the above should work almost immediately8) Link to comment Share on other sites More sharing options...
Busti Posted June 10, 2007 Share Posted June 10, 2007 if a messagebox or smt. is running, the hotkeyset will still be executet My UDF's : Startet on : 06.06.2006_CaseSearchOrReplaceStr();~> Searches OR Replaces a String,;~> With or Without Casesensivity Link to comment Share on other sites More sharing options...
tom13 Posted June 10, 2007 Author Share Posted June 10, 2007 Alot of people are talking about improving it with GUI options, this is not what I want because my script is more some kind of a daemon which runs in the background, without a interface (gui).. Also, for those who say that it should exit immediately: When it is sending a long story with Send("long story here....") and you give it the command to exit, it first sends the full story and then exits. What I want is that it cancels the current action (sending the story) and immediately exit, without a GUI Link to comment Share on other sites More sharing options...
Valuater Posted June 10, 2007 Share Posted June 10, 2007 Then maybe you, as this scripts designer, need to rewrite how the send() is handled, Just as an idea, how about sending 1 line at a time? Then the script may quit immediately 8) Link to comment Share on other sites More sharing options...
GaryFrost Posted June 10, 2007 Share Posted June 10, 2007 Send 1 character at a time in a loop, that way the most that should get sent when exit is sent is 1 character. SciTE for AutoItDirections for Submitting Standard UDFs Don't argue with an idiot; people watching may not be able to tell the difference. Link to comment Share on other sites More sharing options...
tom13 Posted June 10, 2007 Author Share Posted June 10, 2007 But my story is very long, so I have to make like 100000000 lines with Send() ? That seems quite... unprofessional Link to comment Share on other sites More sharing options...
NELyon Posted June 10, 2007 Share Posted June 10, 2007 You can ProcessKill the autoit3.exe process Link to comment Share on other sites More sharing options...
GaryFrost Posted June 10, 2007 Share Posted June 10, 2007 But my story is very long, so I have to make like 100000000 lines with Send() ?That seems quite... unprofessional Unprofessional is not reading the help and finding functions like "StringSplit" and "For....Next" and arrays SciTE for AutoItDirections for Submitting Standard UDFs Don't argue with an idiot; people watching may not be able to tell the difference. 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