Jump to content

Sky Slate Blueberry Blackcurrant Watermelon Strawberry Orange Banana Apple Emerald Chocolate

How do i stop a runaway script? (panic button)


  • Please log in to reply
10 replies to this topic
etyrnal_
  • Guests
  • Last active:
  • Joined: --
i'm not asking how to program in user interruption... i'm talking about what magic key combo can i press that will stop an autohotkey script -- say one that's out of control... ?

the scripts are single use scripts... so it makes no sense to me to program in exit points...

isn't there a ctrl-alt-del or some other key combo that will kill running scripts from the 'outside' ?

it's surprisingly difficult to find this info in the docs or forum

sinkfaze
  • Moderators
  • 6367 posts
  • Last active: Nov 30 2018 08:50 PM
  • Joined: 18 Mar 2008
Assign a hotkey like Esc to Pause, Reload or ExitApp.

ThumpieBunnyEve
  • Members
  • 219 posts
  • Last active: Nov 17 2014 04:23 PM
  • Joined: 18 Jul 2009
<!-- m -->http://www.autohotke...nds/ExitApp.htm<!-- m -->
see the "Example" provided.


Since hotkeys occur as threads, a pressed hotkey -should- be recognizable even if your long busy script is stuck in a recursif loop. If it's not being noticed, try thread-manipulation.

Thread, interrupt, 50, 2000
<!-- m -->http://www.autohotke...ands/Thread.htm<!-- m -->

also if you use #include
<!-- m -->http://www.autohotke...ds/_Include.htm<!-- m -->
You should only need to write one AppKiller.ahk then call it at the top of all your user scripts. #include %pathToIT%/AppKiller.ahk

Weee! \o/
Code I write is free to use under 2 Conditions.
1: Do Not indicate me as responsible for the code, in any way!
2: Do Not willingly inconvenience anyone using code originated by me, period!
Violation of the above voids your eligibility to use my code.

hungrydave
  • Members
  • 2 posts
  • Last active: May 25 2010 03:44 PM
  • Joined: 25 May 2010
Sorry to be a noob, but can someone answer the question in a more idiotproof way.
I don't know how to edit scripts, i followed the links provided and got nowhere.
I'm simply recording scripts and playing them back and need to know what key to press to stop them when they start doing something unintended. If this means i have to program something additional into the script to make this possible (as you seem to be saying), can someone tell me what to add to the script and where to add it. I just wanna press escape and cancel the script running. Should be simple, but it's not.
I know how to 'edit script' but i have no idea what i'm looking at when i do it.

please help. Thanks
hungrydave

None
  • Members
  • 3199 posts
  • Last active: Nov 05 2015 09:55 PM
  • Joined: 28 Nov 2009
Edit the script then scroll to the bottom and on a new line enter
Esc::ExitApp
That creates a hotkey within the script to exit when you press the escape key.

  • Guests
  • Last active:
  • Joined: --
thankyou none :-)

While i'm at it do you know how i can make my scripts run in real time as well, rather than running really fast? I'd like them to run just the way i recorded them as sometime the internet can be slow to catch up and the script has jumped on 6 stages by the time the page loads etc

MasterFocus
  • Moderators
  • 4323 posts
  • Last active: Jan 28 2016 01:38 AM
  • Joined: 08 Apr 2009
Sleep command.

-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

Antonio França -- git.io -- github.com -- ahk4.net -- sites.google.com -- ahkscript.org

Member of the AHK community since 08/Apr/2009. Moderator since mid-2012.


hungrydave
  • Members
  • 2 posts
  • Last active: May 25 2010 03:44 PM
  • Joined: 25 May 2010
thanks.
There seems to be an automatic sleep message inserted on every other line. it sets it at 100, i have to go through the script and up each sleep message to 1,000 to make it work, is there any way to make the inserted sleep messages automatically 1,000 instead of 100?

MasterFocus
  • Moderators
  • 4323 posts
  • Last active: Jan 28 2016 01:38 AM
  • Joined: 08 Apr 2009
<!-- m -->http://www.autohotke... ... hLines.htm<!-- m -->

-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

Antonio França -- git.io -- github.com -- ahk4.net -- sites.google.com -- ahkscript.org

Member of the AHK community since 08/Apr/2009. Moderator since mid-2012.


  • Guests
  • Last active:
  • Joined: --
For some reason my include function aren't working. This is my master script:

#Include E:\My Documents\Scripts\********.ahk
Sleep, 1010
#Include E:\My Documents\Scripts\*******.ahk
sleep, 1010
#Include E:\My Documents\Scripts\********.ahk
sleep, 1010

etc.

It runs the first one, then just stops? Any thoughts on why? i don't get error messages, it just stops. The other scripts work fine as individuals

None
  • Members
  • 3199 posts
  • Last active: Nov 05 2015 09:55 PM
  • Joined: 28 Nov 2009

#Include ensures that FileName is included only once, even if multiple inclusions are encountered for it. By contrast, #IncludeAgain allows multiple inclusions of the same file, while being the same as #Include in all other respects.

If they are the same script you need to use #IncludeAgain.