Jump to content

Recommended Posts

Posted

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.

Posted (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 by Mast3rpyr0
Posted (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 by Piano_Man
My Programs[list][*]Knight Media Player[*]Multiple Desktops[*]Daily Comics[*]Journal[/list]
Posted

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 :)

Posted

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)

NEWHeader1.png

Posted

But my story is very long, so I have to make like 100000000 lines with Send() ?

That seems quite... unprofessional :)

Posted

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.

 

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
×
×
  • Create New...