Titortian Posted June 11, 2020 Share Posted June 11, 2020 I know there are a number of issues posted about #Include however I am not finding any that mirror what I am seeing.The Scenario: I have a program that has a number of these types of functions and they all seem to be acting oddly. (Note: I have isolated this small example to have executable code for people to test with) #Include <reset_view.au3> $x = WinActivate("MyWindow") reset_view() The contents of Reset_View.au3 are as follows. Func reset_view() MouseClick("left",3075+Random(1,7),77+Random(1,7),1,1) Sleep(200) MouseClick("left",3075+Random(1,7),77+Random(1,7),1,1) Send("{PGDN down}") Send("{UP down}") Sleep(Random(2000,2500)) Send("{Up up}") Sleep(Random(500,750)) Send("{PGDN up}") EndFunc The function works fine on my primary computer, even as described above with the #Include method. Windows 10 Pro 64-bit (10.0,Build 18363) I moved my AutoIT scripts from my PC to a VM and now I am having my issue. Windows 7 Ultimate 64-bit (6.1,Build 7601) The Issue: If I call reset_view() from within Reset_View.au3 it works exactly as expected. If I call reset_view() from within Test.au3 using the #Include method it 'wigs out' on me. If I put the full Function into Test.au3 and run I get an error indicating the function already exists. Test Scripts\Test.au3"(5,18) : error: reset_view() already defined. Definitions: 'wigs out': Mouse movement does not occur Mouse click does occur outside of ("MyWindow") Mouse click does not occur inside of ("MyWindow") PGDN and UP do not work inside of ("MyWindow") Notes: I know I already said it but I believe it bears repeating; This is ONLY an issue when I do it from an #Include call. I DO NOT have the issue when I call the function directly from with Reset_View.au3 This is happening to all of my "Universal_Functions" that are in the full program, I have just isolated reset_view() as it is a good simple example. There are about 30 total Universal_Functions. Yes, I have created new files outside of "Universal_Functions" and done isolated testing, reset_view() was one such test. I have tried $x = WinAct... with and without the $x =. Yes, I have uninstalled and reinstalled AutoIT. There is a weird thing that happens when the script finishes, I have included a screen cap of this. It shows up about 1/2 way up and about 1/5 from the left side of the screen. This only happens at the end of the script and only on the VM.Conclusion: TL:DR, #Include is called but the functions do not work properly. Finally, I would like to thank anyone who can provide any useful assistance. Link to comment Share on other sites More sharing options...
abberration Posted June 11, 2020 Share Posted June 11, 2020 I haven't tried this, but maybe check out this one: #include-once Easy MP3 | Software Installer | Password Manager Link to comment Share on other sites More sharing options...
Titortian Posted June 11, 2020 Author Share Posted June 11, 2020 abberration, I just tried this and unfortunately it did the same thing. Link to comment Share on other sites More sharing options...
Titortian Posted June 11, 2020 Author Share Posted June 11, 2020 I can be an idiot... most of the functions have coordinates. When moving from a 4k PC to a 720 VM it helps if you adjust the coordinate system to match. argumentum 1 Link to comment Share on other sites More sharing options...
argumentum Posted June 11, 2020 Share Posted June 11, 2020 (edited) ..it can happen to the best of us Edited June 11, 2020 by argumentum Follow the link to my code contribution ( and other things too ). FAQ - Please Read Before Posting. 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