thatboy Posted May 6, 2022 Share Posted May 6, 2022 HotKeySet('h', 'Hotkey1') Func Hotkey1() ConsoleWrite('The Hotkey was pressed' & @CRLF) EndFunc ;==>Hotkey1 While 1 Sleep(50) WEnd Func MC() Sleep(10) MouseClick("LEFT", 702. 953, 1, 1) EndFunc When I hit the Hotkey, it confirms that I pressed the Hotkey, but it does not Mouseclick. I'm new to this. What have I done wrong? Thanks! Link to comment Share on other sites More sharing options...
water Posted May 6, 2022 Share Posted May 6, 2022 Where in your code do you call function MC? thatboy 1 My UDFs and Tutorials: Spoiler UDFs: Active Directory (NEW 2024-07-28 - Version 1.6.3.0) - Download - General Help & Support - Example Scripts - Wiki ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki Task Scheduler (2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs: Excel - Example Scripts - Wiki Word - Wiki Tutorials: ADO - Wiki WebDriver - Wiki Link to comment Share on other sites More sharing options...
jchd Posted May 6, 2022 Share Posted May 6, 2022 41 minutes ago, thatboy said: but it does not Mouseclick. Why should it? You don't ask for that. BTW do you realize that discussing automating games is forbidden here? thatboy 1 This wonderful site allows debugging and testing regular expressions (many flavors available). An absolute must have in your bookmarks.Another excellent RegExp tutorial. Don't forget downloading your copy of up-to-date pcretest.exe and pcregrep.exe hereRegExp tutorial: enough to get startedPCRE v8.33 regexp documentation latest available release and currently implemented in AutoIt beta. SQLitespeed is another feature-rich premier SQLite manager (includes import/export). Well worth a try.SQLite Expert (freeware Personal Edition or payware Pro version) is a very useful SQLite database manager.An excellent eBook covering almost every aspect of SQLite3: a must-read for anyone doing serious work.SQL tutorial (covers "generic" SQL, but most of it applies to SQLite as well)A work-in-progress SQLite3 tutorial. Don't miss other LxyzTHW pages!SQLite official website with full documentation (may be newer than the SQLite library that comes standard with AutoIt) Link to comment Share on other sites More sharing options...
thatboy Posted May 6, 2022 Author Share Posted May 6, 2022 9 minutes ago, water said: Where in your code do you call function MC? Am I supposed to do "Func Mouseclick" Instead? Link to comment Share on other sites More sharing options...
thatboy Posted May 6, 2022 Author Share Posted May 6, 2022 10 minutes ago, jchd said: Why should it? You don't ask for that. BTW do you realize that discussing automating games is forbidden here? I'm not using it to play Video Games, but I appreciate your very helpful input, bud. Link to comment Share on other sites More sharing options...
water Posted May 6, 2022 Share Posted May 6, 2022 18 minutes ago, thatboy said: Am I supposed to do "Func Mouseclick" Instead? Did you try? If yes, does it work? thatboy 1 My UDFs and Tutorials: Spoiler UDFs: Active Directory (NEW 2024-07-28 - Version 1.6.3.0) - Download - General Help & Support - Example Scripts - Wiki ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki Task Scheduler (2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs: Excel - Example Scripts - Wiki Word - Wiki Tutorials: ADO - Wiki WebDriver - Wiki Link to comment Share on other sites More sharing options...
thatboy Posted May 6, 2022 Author Share Posted May 6, 2022 1 minute ago, water said: Did you try? If yes, does it work? I actually took out the "Hotkeyset" line. And I took out "Func" My goal is for it to do it on its own on an infinite loop. This is just a small fraction of the code. I'm trying to run this script successfully, before I add anything else. And I've yet to successfully run a script. Now I Just have this: #include <AutoItConstants.au3> While 1 Sleep(50) WEnd $mouse_Speed(10) MouseClick("LEFT", 702. 953, 1, 1) I Run this script and nothing happens. Link to comment Share on other sites More sharing options...
Developers Jos Posted May 6, 2022 Developers Share Posted May 6, 2022 Read that source again and try to understand when you will encounter the MouseClick() function. thatboy 1 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. Link to comment Share on other sites More sharing options...
water Posted May 6, 2022 Share Posted May 6, 2022 Grab your original script and update the name of the function that should be called when you press the hotkey. thatboy 1 My UDFs and Tutorials: Spoiler UDFs: Active Directory (NEW 2024-07-28 - Version 1.6.3.0) - Download - General Help & Support - Example Scripts - Wiki ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki Task Scheduler (2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs: Excel - Example Scripts - Wiki Word - Wiki Tutorials: ADO - Wiki WebDriver - Wiki Link to comment Share on other sites More sharing options...
Solution jchd Posted May 6, 2022 Solution Share Posted May 6, 2022 (edited) If you insist on invoking function MC, then you need to invoke it by yourself, like in: HotKeySet('h', Hotkey1) ; no quote needed since functions are first-class citizens Func Hotkey1() ConsoleWrite('The Hotkey was pressed' & @CRLF) MC() ; invoke this holly function EndFunc ;==>Hotkey1 While 1 Sleep(50) WEnd Func MC() Sleep(10) MouseClick("LEFT", 702, 953, 1, 1) ; typo fixed EndFunc Edited May 6, 2022 by jchd thatboy 1 This wonderful site allows debugging and testing regular expressions (many flavors available). An absolute must have in your bookmarks.Another excellent RegExp tutorial. Don't forget downloading your copy of up-to-date pcretest.exe and pcregrep.exe hereRegExp tutorial: enough to get startedPCRE v8.33 regexp documentation latest available release and currently implemented in AutoIt beta. SQLitespeed is another feature-rich premier SQLite manager (includes import/export). Well worth a try.SQLite Expert (freeware Personal Edition or payware Pro version) is a very useful SQLite database manager.An excellent eBook covering almost every aspect of SQLite3: a must-read for anyone doing serious work.SQL tutorial (covers "generic" SQL, but most of it applies to SQLite as well)A work-in-progress SQLite3 tutorial. Don't miss other LxyzTHW pages!SQLite official website with full documentation (may be newer than the SQLite library that comes standard with AutoIt) Link to comment Share on other sites More sharing options...
thatboy Posted May 6, 2022 Author Share Posted May 6, 2022 27 minutes ago, jchd said: If you insist on invoking function MC, then you need to invoke it by yourself, like in: HotKeySet('h', Hotkey1) ; no quote needed since functions are first-class citizens Func Hotkey1() ConsoleWrite('The Hotkey was pressed' & @CRLF) MC() ; invoke this holly function EndFunc ;==>Hotkey1 While 1 Sleep(50) WEnd Func MC() Sleep(10) MouseClick("LEFT", 702. 953, 1, 1) EndFunc Thanks a lot. However, this code returns an error: HotKeySet('h', Hotkey1) Func Hotkey1() ConsoleWrite('The Hotkey was pressed' & @CRLF) MC() EndFunc ;==>Hotkey1 While 1 Sleep(50) WEnd Func MC() Sleep(10) MouseClick("LEFT", 702. 953, 1, 1) EndFunc Error: The Hotkey was pressed MouseClick("LEFT", 702. 953, 1, 1) MouseClick("LEFT", ^ ERROR >Exit code: 1 Link to comment Share on other sites More sharing options...
Musashi Posted May 6, 2022 Share Posted May 6, 2022 (edited) MouseClick("LEFT", 702. 953, 1, 1) Just a small typo by @jchd (dot instead of comma). @thatboy : You could have easily spotted this yourself if you took a look at the help or the error message in the console output . Use Func MC() Sleep(10) MouseClick("LEFT", 702, 953, 1, 1) EndFunc Edited May 6, 2022 by Musashi thatboy 1 "In the beginning the Universe was created. This has made a lot of people very angry and been widely regarded as a bad move." Link to comment Share on other sites More sharing options...
Musashi Posted May 6, 2022 Share Posted May 6, 2022 By the way: A hotkey to terminate the script would be beneficial : HotKeySet('h', Hotkey1) ; no quote needed since functions are first-class citizens HotKeySet("{ESC}", _Terminate) Func Hotkey1() ConsoleWrite('The Hotkey was pressed' & @CRLF) MC() ; invoke this holly function EndFunc ;==>Hotkey1 While 1 Sleep(50) WEnd Func MC() Sleep(10) MouseClick("LEFT", 702, 953, 1, 1) EndFunc Func _Terminate() MsgBox(BitOR(4096, 64), "Message :", "Script terminated" & @CRLF) Exit EndFunc thatboy 1 "In the beginning the Universe was created. This has made a lot of people very angry and been widely regarded as a bad move." Link to comment Share on other sites More sharing options...
jchd Posted May 6, 2022 Share Posted May 6, 2022 18 minutes ago, Musashi said: Just a small typo by @jchd (dot instead of comma) Not mine: it comes verbatim from the OP, I was aware but was distracted before posting and forgot to fix it. TheDcoder and thatboy 1 1 This wonderful site allows debugging and testing regular expressions (many flavors available). An absolute must have in your bookmarks.Another excellent RegExp tutorial. Don't forget downloading your copy of up-to-date pcretest.exe and pcregrep.exe hereRegExp tutorial: enough to get startedPCRE v8.33 regexp documentation latest available release and currently implemented in AutoIt beta. SQLitespeed is another feature-rich premier SQLite manager (includes import/export). Well worth a try.SQLite Expert (freeware Personal Edition or payware Pro version) is a very useful SQLite database manager.An excellent eBook covering almost every aspect of SQLite3: a must-read for anyone doing serious work.SQL tutorial (covers "generic" SQL, but most of it applies to SQLite as well)A work-in-progress SQLite3 tutorial. Don't miss other LxyzTHW pages!SQLite official website with full documentation (may be newer than the SQLite library that comes standard with AutoIt) Link to comment Share on other sites More sharing options...
thatboy Posted May 6, 2022 Author Share Posted May 6, 2022 Yeah, that's my dumb ass who did the typo. Thanks Guys! Finally got my first script to work! Musashi and TheDcoder 1 1 Link to comment Share on other sites More sharing options...
Musashi Posted May 6, 2022 Share Posted May 6, 2022 59 minutes ago, jchd said: 1 hour ago, Musashi said: Just a small typo by @jchd (dot instead of comma) Not mine: it comes verbatim from the OP, I was aware but was distracted before posting and forgot to fix it. True, I hope you accept my sincere apology . @thatboy : Why did you mark your buggy script from your initial question as the Solution? You should mark the one from @jchd (he could still edit the typo though ). thatboy 1 "In the beginning the Universe was created. This has made a lot of people very angry and been widely regarded as a bad move." Link to comment Share on other sites More sharing options...
thatboy Posted May 6, 2022 Author Share Posted May 6, 2022 16 minutes ago, Musashi said: True, I hope you accept my sincere apology . @thatboy : Why did you mark your buggy script from your initial question as the Solution? You should mark the one from @jchd (he could still edit the typo though ). Was an accident. My first time using this site. How do I change it? Link to comment Share on other sites More sharing options...
jchd Posted May 6, 2022 Share Posted May 6, 2022 20 minutes ago, Musashi said: (he could still edit the typo though ). Done. thatboy 1 This wonderful site allows debugging and testing regular expressions (many flavors available). An absolute must have in your bookmarks.Another excellent RegExp tutorial. Don't forget downloading your copy of up-to-date pcretest.exe and pcregrep.exe hereRegExp tutorial: enough to get startedPCRE v8.33 regexp documentation latest available release and currently implemented in AutoIt beta. SQLitespeed is another feature-rich premier SQLite manager (includes import/export). Well worth a try.SQLite Expert (freeware Personal Edition or payware Pro version) is a very useful SQLite database manager.An excellent eBook covering almost every aspect of SQLite3: a must-read for anyone doing serious work.SQL tutorial (covers "generic" SQL, but most of it applies to SQLite as well)A work-in-progress SQLite3 tutorial. Don't miss other LxyzTHW pages!SQLite official website with full documentation (may be newer than the SQLite library that comes standard with AutoIt) Link to comment Share on other sites More sharing options...
thatboy Posted May 6, 2022 Author Share Posted May 6, 2022 Fixed the Solution Marking. Thanks again mfs Link to comment Share on other sites More sharing options...
Werty Posted May 6, 2022 Share Posted May 6, 2022 (edited) 8 minutes ago, thatboy said: mfs I had to google that one, and it didnt turn out good, google says either... "M*therf*ckers" or "Middle Finger Salute", but maybe google is wrong. 😛 Edited May 6, 2022 by Werty TheDcoder 1 Some guy's script + some other guy's script = my script! 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