Sign in to follow this  
Followers 0

Stop, Abort, Quit, End Macro hotkey.

13 posts in this topic

Posted

Sup all,

Your friendly Troll here, after two hours in the forums doing searching decided to post the question.

Just need the seeking the code to form a hot key to kill autoit.

ie "pause/ break key" and autoit shuts down the current macro.

Great program TWO :) to you all!!

HAWKZX

Share this post


Link to post
Share on other sites



Posted (edited)

A simple solution is to create a HotKey then have the command inside the function to be Exit

#include <Misc.au3>

HotKeySet("{F1}", "Exit") ; HotKey set to F1

Func Exit()
	Exit ; Code for action here, in this case to exit the script (i.e. close the program)
EndFunc
Edited by BALA

Share this post


Link to post
Share on other sites

Posted

Sweet, after 5 mins of playing it got it to work. Thanks for getting me over the hump.

My only other idea, which i am not sure where to look, or how to do it is ....

"DO" ABC

"UNTIL" DEF

"OR UNTIL" X timer (ie 10 mins expires)

Share this post


Link to post
Share on other sites

Posted

What part are you having trouble with? The Do loop or the timer?

Share this post


Link to post
Share on other sites

Posted (edited)

Just the timer, adding the Second varable

the "or else" / "or if" / "or until"

Edited by HAWKZX

Share this post


Link to post
Share on other sites

Posted

I guess the anwer would be the Loop with a second varable.

Share this post


Link to post
Share on other sites

Posted

Wait, I'm confused now. Where's your problem again? :)

Share this post


Link to post
Share on other sites

Posted

I think I can handle the timer, just adding the timer as the second variable i am a bit unsure about.

SO the answer is... need help with the "Do loop."

Share this post


Link to post
Share on other sites

Posted

I think I can handle the timer, just adding the timer as the second variable i am a bit unsure about.

SO the answer is... need help with the "Do loop."

if you just want to exit after the timer expired it should be easy ... put the exit in the Adlib func ...

Share this post


Link to post
Share on other sites

Posted

What's the code for the timer? Since you could just set the value of the timer as a variable and use that.

Share this post


Link to post
Share on other sites

Posted

Honestly I have not written the timer code yet.

All i want to do it, run a cycle which I have already, and if 10 minutes pass by even if the cycle does not "finish" then break out. I am just iffy on the code to do it.

give me 45 secs and i ll copy up the code I have from the other PC

Share this post


Link to post
Share on other sites

Posted

Func cycle()
Sleep(90000)
Send("{F1}");turn off then back on
Sleep(1000)
If (PixelGetColor(1509, 62) = 0) Then target()
	MouseMove(1704,82) ; target 1
	MouseDown("left")
	MouseUp("left")
Sleep(5000)
	Send("{F1}")
MouseMove(851, 647)
Sleep (5000)
If (PixelGetColor(851, 647) > 10000000) Then empty()

	Sleep(11000)
		
	Send("{F2}");turn off then back on
	MouseMove(1591,70)
	MouseDown("left")
	MouseUp("left")
If (PixelGetColor(1509, 62) = 0) Then target()
	Sleep(5000)
	Send("{F2}")
MouseMove(851, 647)
Sleep (5000)
If (PixelGetColor(847, 648) > 10000000) Then empty()

Sleep(11000)

	Send("{F3}");turn off then back on
	MouseMove(1493,77)
	MouseDown("left")
	MouseUp("left")
If (PixelGetColor(1509, 62) = 0) Then target()
	Sleep(5000)
	Send("{F3}")
MouseMove(851, 647)
Sleep (5000)
If (PixelGetColor(847, 648) > 10000000) Then empty()


cycle()
EndFunc

Share this post


Link to post
Share on other sites

Posted

To help with keeping titles and topics the same I created a new thread with the correct title.

http://www.autoitscript.com/forum/index.php?showtopic=39404

Please do any follow up discussion on the new TOPIC so others can find the final answers easier.

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
Sign in to follow this  
Followers 0