Ries Posted September 2, 2012 Share Posted September 2, 2012 Ive created this script, and having small(BIG) problems to make it work like i want it. What im trying to do, is when i press 8, it runs the script once. And reruns it every time i press 8. I can only get it to run once, and it wont run again when i press 8 What are i'm doing wrong? Thanks a lot to whomever gonna help me. HotKeySet("8", "Main") While 1 Sleep(100) WEnd Func Main() HotKeySet("8") Send("{ESC}") Sleep(500) send("{ESC}") sleep(550) MouseClick("left",1390,765,1) Sleep(14000) MouseClick("left",394,637,1) sleep(900) MouseClick("left",671,809,1) sleep(900) MouseClick("left",1515,1133,1) sleep(900) MouseClick("left",1106,850,1) sleep(800) MouseClick("left",324,552,1) sleep(4000) MouseClick("left",425,151,1) sleep(2800) MouseClick("left",425,151,1) sleep(2800) MouseClick("left",425,151,1) sleep(2800) Send("{SPACE}") sleep(200) send("{SPACE}") sleep(200) send("{SPACE}") sleep(200) send("{SPACE}") sleep(1500) MouseClick("left",1265,482,1) Send("{SPACE}") sleep(200) Send("{SPACE}") sleep(200) Send("{SPACE}") sleep(200) Send("{SPACE}") sleep(200) Send("{SPACE}") sleep(200) Send("{SPACE}") sleep(400) Send("{SPACE}") MouseClick("left",649,175,1) sleep(3500) Send("{SPACE}") sleep(1000) MouseClick("left",1096,489,1) Soundplay(@WindowsDir & "\media\tada.wav",1) EndFunc Link to comment Share on other sites More sharing options...
water Posted September 2, 2012 Share Posted September 2, 2012 You have to set the HotKey again because you un-set it at the start of function main. FireFox 1 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...
FireFox Posted September 2, 2012 Share Posted September 2, 2012 @Ries Please use autoit tags to insert your code. When your function main is called, you kill the HotKey with this code : HotKeySet("8") You have to remove it, then the HotKey will work everytime you press the 8 key. Br, FireFox. 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