Tommy Chang Posted January 5, 2016 Share Posted January 5, 2016 (edited) I write a script by the AutoIt3 as below, but I can't run it. Anyone who can help me to solve it and correct it? THX!#RequireAdmin#NoTrayIconHotKeySet("a", "Action")HotKeySet("{Esc}", "_Exit")Func _Exit() ExitEndFuncFunc Action() Send("4") If MouseClick("left") Then Send("q") MouseClick("left") EndIfEndFunc Edited January 5, 2016 by Tommy Chang Link to comment Share on other sites More sharing options...
JohnOne Posted January 5, 2016 Share Posted January 5, 2016 (edited) but I can't run itYou're going to have to do better than that.EDIT: meanwhile, add a while loop. Edited January 5, 2016 by JohnOne AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans. Link to comment Share on other sites More sharing options...
Tommy Chang Posted January 5, 2016 Author Share Posted January 5, 2016 (edited) You're going to have to do better than that.EDIT: meanwhile, add a while loop.but add it in where? Can you add it for me, I am a new hand so I really need some help.. Edited January 5, 2016 by Tommy Chang Link to comment Share on other sites More sharing options...
JohnOne Posted January 5, 2016 Share Posted January 5, 2016 #RequireAdmin #NoTrayIcon HotKeySet("a", "Action") HotKeySet("{Esc}", "_Exit") While 3 Sleep(333) WEnd Func _Exit() Exit EndFunc Func Action() Send("4") If MouseClick("left") Then Send("q") MouseClick("left") EndIf EndFunc AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans. Link to comment Share on other sites More sharing options...
InunoTaishou Posted January 5, 2016 Share Posted January 5, 2016 It's running, in fact I wager that it's working EXACTLY how it's been written to run, it's just not working how you want it to.Breaking it down, line by line.Set a hot keySet a hot keyCreate a Function, calling this function exits the scriptCreate a Function, calling this function sends and clicksNo where in your script do you define a loop that prevents the script from closing. An infinite while loop, or a loop with a condition that causes the loop to not exit until a condition is met, will prevent the script from closing. Link to comment Share on other sites More sharing options...
water Posted January 5, 2016 Share Posted January 5, 2016 Welcome to AutoIt and the forum!Could you please give meaningful titles to your threads? Everyone on this forum is looking for help The better you describe your problem in the title the more people will read the thread and the more help you will get. My UDFs and Tutorials: Spoiler UDFs:Active Directory (NEW 2022-02-19 - Version 1.6.1.0) - Download - General Help & Support - Example Scripts - WikiExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example ScriptsOutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - WikiOutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - DownloadOutlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - WikiPowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - WikiTask Scheduler (NEW 2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs:Excel - Example Scripts - WikiWord - Wiki Tutorials:ADO - WikiWebDriver - Wiki Link to comment Share on other sites More sharing options...
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