AutoHotkey Community

It is currently May 27th, 2012, 12:02 pm

All times are UTC [ DST ]




Post new topic Reply to topic  [ 22 posts ]  Go to page Previous  1, 2
Author Message
 Post subject:
PostPosted: December 26th, 2010, 5:23 pm 
Offline

Joined: May 13th, 2010, 10:11 am
Posts: 352
Location: Houston, Tx.
tank wrote:
so again i ask the same question Ace_coder implied
is there somer eason not to use pause?
Because the point of stop-all is to exit the thread, not pause it.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: January 15th, 2011, 9:29 am 
I achieve the same thing in my single simple script using Reload, as it stops all threads in my script.
Code:
F10::
loop
{
send a
}
Return

Esc::
Reload

I'm not sure whether this is bad practice or dangerous, as I am a complete novice, but it works for me.


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: January 15th, 2011, 12:55 pm 
Offline

Joined: March 26th, 2010, 5:55 pm
Posts: 129
I too use Reload, usually to recover from a misbehaving script. Even if it's not stuck in an infinite loop, it might be going down a wrong path and I want to stop it.

The downside to Reload is that it wipes the global variables and re-executes the autoexecute section. For me this is not a big deal but I can imagine scenarios where this would be a problem and Reload would not work.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: January 16th, 2011, 2:06 pm 
Offline

Joined: May 13th, 2010, 10:11 am
Posts: 352
Location: Houston, Tx.
It also desrtoys all the guis. So if you have one that is active, it will flash, which is not very appealing.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: October 27th, 2011, 12:56 pm 
+1 for the wishlist. Reload is a workaround, Pause is a workaround.

There should be a command that kills all running threads.


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: October 28th, 2011, 2:05 am 
Offline

Joined: March 27th, 2008, 2:14 pm
Posts: 700
How about change Exit to take a parameter which is the number of threads to exit, including the current one.

E.g.
Code:
loop
    send hi `

Esc::Exit 2
Pressing Esc would exit the current (interrupting) thread (the one started by the Esc key) and the one directly underneath it (the one it interrupted), i.e. the loop.

_________________
Scripts - License


Report this post
Top
 Profile  
Reply with quote  
 Post subject: Re: StopAll
PostPosted: April 12th, 2012, 6:08 am 
Offline

Joined: August 3rd, 2007, 8:01 am
Posts: 555
Location: Houston, TX
+1 for this wish.
I need this functionality for my ahksandbox.
ahksandbox already prevents all insecure commands and functions, but is still vulnerable to denial of service via infinite loops.
the ability to kill all threads would allow the host script to do that after a time out for misbehaving scripts in the sandbox.
Will probably butcher the source to make it work one way or another...


Report this post
Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 22 posts ]  Go to page Previous  1, 2

All times are UTC [ DST ]


Who is online

Users browsing this forum: No registered users and 31 guests


You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Powered by phpBB® Forum Software © phpBB Group