HAWKZX Posted January 13, 2007 Posted January 13, 2007 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
BALA Posted January 13, 2007 Posted January 13, 2007 (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 January 13, 2007 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
HAWKZX Posted January 13, 2007 Author Posted January 13, 2007 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)
BALA Posted January 13, 2007 Posted January 13, 2007 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
HAWKZX Posted January 13, 2007 Author Posted January 13, 2007 (edited) Just the timer, adding the Second varable the "or else" / "or if" / "or until" Edited January 13, 2007 by HAWKZX
HAWKZX Posted January 13, 2007 Author Posted January 13, 2007 I guess the anwer would be the Loop with a second varable.
BALA Posted January 13, 2007 Posted January 13, 2007 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
HAWKZX Posted January 13, 2007 Author Posted January 13, 2007 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."
Developers Jos Posted January 13, 2007 Developers Posted January 13, 2007 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 ... SciTE4AutoIt3 Full installer Download page  - Beta files    Read before posting   How to post scriptsource   Forum etiquette Forum Rules  Live for the present, Dream of the future, Learn from the past.Â
BALA Posted January 13, 2007 Posted January 13, 2007 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
HAWKZX Posted January 13, 2007 Author Posted January 13, 2007 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
HAWKZX Posted January 13, 2007 Author Posted January 13, 2007 expandcollapse popupFunc 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
HAWKZX Posted January 13, 2007 Author Posted January 13, 2007 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=39404Please do any follow up discussion on the new TOPIC so others can find the final answers easier.
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now