Sign in to follow this  
Followers 0

Stop, Abort, Quit, End Macro hotkey.

13 posts in this topic

#1 ·  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



#2 ·  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

[font="Comic Sans MS"]BA-LA[/font]http://ba-la.110mb.comJoin my community, CLICK HEREAlternative links to my site:http://www.ba-la.tkhttp://www.ba-la.co.nrContact me if you would like to help with some of my projects: joeythepirate@gmail.com

Share this post


Link to post
Share on other sites

#3 ·  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

#4 ·  Posted

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


[font="Comic Sans MS"]BA-LA[/font]http://ba-la.110mb.comJoin my community, CLICK HEREAlternative links to my site:http://www.ba-la.tkhttp://www.ba-la.co.nrContact me if you would like to help with some of my projects: joeythepirate@gmail.com

Share this post


Link to post
Share on other sites

#5 ·  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

#6 ·  Posted

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

Share this post


Link to post
Share on other sites

#7 ·  Posted

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


[font="Comic Sans MS"]BA-LA[/font]http://ba-la.110mb.comJoin my community, CLICK HEREAlternative links to my site:http://www.ba-la.tkhttp://www.ba-la.co.nrContact me if you would like to help with some of my projects: joeythepirate@gmail.com

Share this post


Link to post
Share on other sites

#8 ·  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

#9 ·  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 ...

Visit the SciTE4AutoIt3 Download page for the latest versions                                                                 Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites

#10 ·  Posted

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


[font="Comic Sans MS"]BA-LA[/font]http://ba-la.110mb.comJoin my community, CLICK HEREAlternative links to my site:http://www.ba-la.tkhttp://www.ba-la.co.nrContact me if you would like to help with some of my projects: joeythepirate@gmail.com

Share this post


Link to post
Share on other sites

#11 ·  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

#12 ·  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

#13 ·  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