Jump to content
Daka

Stop script and self restart

Recommended Posts

Daka

I have the script and if I hit ESC it stops running.
 

HotKeySet("{ESC}", "Terminate")
Func Terminate()
    Exit
 EndFunc

 

But that stops the whole script, I would like to just stop that working function and that is not possible on this way.
Maybe you know how to do it, but I can't find the way. Because once in the function and script is working,
but it doesn't stop the function that the is running. But the whole script.
So what I taught: exit the script but start executable again on Exit.

Is this possible?
 

Share this post


Link to post
Share on other sites
Nessie

Maybe you should change the way you are thinking on that function. But if you need to restart your script you can use that function 

 


My UDF: NetInfo UDF Play with your network, check your download/upload speed and much more! YTAPI Easy to use YouTube API, now you can easy retrive all needed info from a video. NavInfo Check if a specific browser is installed and retrive other usefull information. YWeather Easy to use Yahoo Weather API, now you can easily retrive details about the weather in a specific region. No-IP UDF Easily update your no-ip hostname(s).

My Script: Wallpaper Changer Change you wallpaper dinamically, you can also download your wallpaper from your website and share it with all!   My Snippet: _ImageSaveToBMPConvert an image to bmp format. _SciteGOTO Open a file in SciTE at specific fileline. _FileToHex Show the hex code of a specified file

Share this post


Link to post
Share on other sites
Daka

"But if you need to restart your script you can use that function"

Can you show me code of that restart, after I say exit how to say to compiled exe script to start again?

Share this post


Link to post
Share on other sites
Nessie
Posted (edited)
#NoTrayIcon

#Include <Misc.au3>
#Include <Restart.au3>

HotKeySet("{ESC}", "Terminate")

_Singleton('MyProgram')

Func Terminate()
    ;Do what you want
    _ScriptRestart()
EndFunc

Something like that.

Edited by Nessie

My UDF: NetInfo UDF Play with your network, check your download/upload speed and much more! YTAPI Easy to use YouTube API, now you can easy retrive all needed info from a video. NavInfo Check if a specific browser is installed and retrive other usefull information. YWeather Easy to use Yahoo Weather API, now you can easily retrive details about the weather in a specific region. No-IP UDF Easily update your no-ip hostname(s).

My Script: Wallpaper Changer Change you wallpaper dinamically, you can also download your wallpaper from your website and share it with all!   My Snippet: _ImageSaveToBMPConvert an image to bmp format. _SciteGOTO Open a file in SciTE at specific fileline. _FileToHex Show the hex code of a specified file

Share this post


Link to post
Share on other sites
Jos

@Daka,

Please post a working/runable script that shows what you have and where you want this Stop-Function  or restart-script implemented.

Jos 


Visit the SciTE4AutoIt3 Download page for the latest versions  - Beta files                                How to post scriptsource        Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites

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

×