juvan Posted September 18, 2011 Share Posted September 18, 2011 (edited) Hi everybody, firstly I am very excited with this new scripting language can't seem to tear myself away from it and as with every new thing, you stumble upon new and mysterious problems, mine has to do with the very nice tool AU3Recorder which I am learning to use. I am using "SciTE Version 2.27 Jun 24 2011 17:46:25" and I seem to be having some weird issues with it. What it does is firstly generate a buggy code (so it would seem) and secondly not even come close to my actions on the mouse (it just clicks all over the place) in some random cases it doesn't even move when running the script (just sits there still). Well... this is what it would generate on a simple mouse movement and notepad opening: #region --- Au3Recorder generated code Start --- _WinWaitActivate("Start menu","All Programs") MouseClick("left",27,577,1) MouseClick("left",355,364,1) _WinWaitActivate("Run","Type the name of a p") MouseClick("left",183,239,1) _WinWaitActivate("Untitled - Notepad","") MouseClick("left",350,121,1) Send("zrtutdugudgf") MouseClick("left",867,17,1) _WinWaitActivate("Notepad","Do&n't Save") MouseClick("left",305,133,1) ") <--- THIS FELLA IS KINDA STRANGE AND THIS IS THE SYNTAX ERROR IT REPORTS (why is it there, is the software buggy like that?) #region --- Internal functions Au3Recorder Start --- Func _WinWaitActivate($title,$text,$timeout=0) WinWait($title,$text,$timeout) If Not WinActive($title,$text) Then WinActivate($title,$text) WinWaitActive($title,$text,$timeout) EndFunc #endregion --- Internal functions Au3Recorder End --- #endregion --- Au3Recorder generated code End --- #endregion --- Au3Recorder generated code End --- Thank you very much for all and any help. Cheers. PS: I've checked the search and came close to my problem, but in the end the topic didn't resolve itlink: Edited September 18, 2011 by juvan Link to comment Share on other sites More sharing options...
justt Posted September 18, 2011 Share Posted September 18, 2011 (edited) I've give you what limited advice I have, I've gotten Au3Recorder to work perfectly this way for the times I need it. My method is very basic as essentially I only grab basic commands, MouseClick, Send, etc., and the code I get assumes that any new windows must be in the exact same spot as when the recorder was first run. First I delete all code before the first action I know is right, in your case it looks like it would be : MouseClick("left",27,577,1) Second like I said I basically delete any line that starts with _WinWaitActivate Third, I delete everything after that ") you mentioned was strange, along with the ") itself Lastly I found on my laptop the MouseClick position are off by just a few pixels each and every time when using Au3Recorder, this doesn't happen on my desktop. If you need exact positions and you find they are off a bit I used this line of code at the beginning of the script to correct it. Opt("MouseCoordMode", 0) Also if the script is running too fast for programs to load/receive input just change the speed of MouseClick or add a sleep command inbetween lines, as AutoIt doesn't keep track of delays between commands (wish it would). Edited September 18, 2011 by justt Link to comment Share on other sites More sharing options...
juvan Posted September 18, 2011 Author Share Posted September 18, 2011 Thank you, you gave me something to work with. As for the ") part I guess the program is at fault here, secondly I deleted the unnecessary _WinWaitActivate functions, and at the first run it worked, but then at the second one when I put in Opt("MouseCoordMode", 0), he was way off with the first click, which is weird since in the program the coordinates are actually very much correct. I don't get the miss-firing then. Hmmmm, there is a bit of a funny thing going on here, cuz now I removed the "Opt" code and works like a charm, I guess the solution to the whole problem was, firstly deleting the bugish code that was generated (although it seems a bit silly to have such an obvious bug in there), and lastly deleting the first line that says "_WinWaitActivate("Start menu","All Programs")" I will try it again a couple of more times and report back if the problem is solved. Thanks Link to comment Share on other sites More sharing options...
juvan Posted September 18, 2011 Author Share Posted September 18, 2011 (edited) Well the bottom line after testing it out a bit is this: 1. The " ") " line added at the end is a mystery, but without a doubt a syntax error so therefor a weird bug 2. The lines __WinWaitActivate at the beginning and the ones in the middle with odd text in them -> _WinWaitActivate("classname=Shell_TrayWnd","User Promoted Notifi") are best to be deleted 3. for some unknown most probably compatibility issues the program can't lock on to my start button at the bottom left corner (he comes up with some odd random coordinates), so best to just avoid that, or manually tweek it. Otherwise it somewhat works OK. In the end I am still left a bit confused but I'm guessing these are some compatibility issues and so will try again tomorrow on another computer. Thank you justt for your help. Edited September 18, 2011 by juvan Link to comment Share on other sites More sharing options...
justt Posted September 18, 2011 Share Posted September 18, 2011 No problem, I think I had all your problems first time I used Au3Record too. Weird about it not clicking the windows button, maybe it is a compatibility issues, like I said I get different results on my laptop compared to desktop. If all else fails use Send ("{LWIN}") 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