venussoftop Posted March 23, 2004 Share Posted March 23, 2004 Hi all I have this script(s) which has a lot of mouse clicking and keyboard typing. I had generated this script on a W2K machine and it really works but very slow especially the keyboard with spurts of speed in between (I have used only defaults) The mouse clicking on X-Y co-ords also had quirks in W2K I was giving window co-ords and it would do screen co-ord click and I had to modify accordingly, but nevertheless got it working on the W2K and PIV machine. Yesterday I tried the same script same screen resolution on a W98 and Celeron500 machine and this same script execution and typing speed improved dramatically but the mouse click on screen co-ord went off sync. What did I do wrong? Please advise. RegardsBhavbhuti Link to comment Share on other sites More sharing options...
venussoftop Posted March 23, 2004 Author Share Posted March 23, 2004 need a script example... PCs have different keypress rates and such. Also mouse settings can vary... but an example script will be most telling... Lar.Thanks for your interest. Here is the script. This is working well in W2K. Please advise. expandcollapse popup;Include file for special file handling #include <File.au3> ;Get the Project Code If $CmdLine[0] = 1 then $ProjCode = $CmdLine[1] Else $ProjCode = StringUpper( InputBox ( 'Update VSO3.fdb DBComparer', 'Please enter the project code (C04)' ) ) EndIf if $ProjCode <> '' then ;Match found exit match() else exit 0 endif Func match() SplashTextOn( 'Creating Empty FDB', CHR(13) & CHR(13) & 'Till you see this messsage' & CHR(13) &_ CHR(13) & 'please do not touch the keyboard / mouse.' & CHR(13), 250, 200, 50, 50, -1, 'Arial', 12, 1000 ) if Not RunWait ( 'C:\Program Files\AutoIt3\AutoIt3.exe C:\AutoIt\StartDBComparer.au3 ' & $ProjCode ) then return 0 endif ;Create Flag File _FileCreate( StringReplace(StringLower(@scriptfullpath), '.au3', '.upr') ) ;Determine if user has swapped right and left mouse buttons Dim $primary Dim $secondary $k = RegRead("HKEY_CURRENT_USER\Control Panel\Mouse", "SwapMouseButtons") ; It's okay to NOT check the success of the RegRead operation If $k = 1 Then $primary = "right" $secondary = "left" Else ;normal (also case if could not read registry key) $primary = "left" $secondary = "right" EndIf ;Wait till Marathon is active WinWaitActive ( 'Database Comparer v. 2.4. For non-commercial use only.' ) ;Send Keystrokes Send ( '!DN' ) WinWaitActive ( 'Register alias...' ) Send ( 'D:\VSO3\Projects\' & $ProjCode & '\Data\Original\VSO3.FDB{Tab}' ) Send ( '_Empty' & $ProjCode & '{Tab 7}{Enter}' ) ;Target DB selection If Not ControlCommand ( "Database Comparer v. 2.4. For non-commercial use only.", _ "", "TWideComboEdit.UnicodeClass1", "ISEnabled", "" ) Then ControlFocus( "Database Comparer v. 2.4. For non-commercial use only.", _ "", "TCheckBox5") Send ("{SPACE}") EndIf ControlFocus( "Database Comparer v. 2.4. For non-commercial use only.", _ "", "TVirtualComboTree2") ControlClick( "Database Comparer v. 2.4. For non-commercial use only.", _ "", "TVirtualComboTree2", $primary, 1) Send( "!{DOWN}" ) MouseMove( 450, 250, 0) MouseClick( $primary) ;Master DB selection If ControlCommand ( "Database Comparer v. 2.4. For non-commercial use only.", _ "", "TWideComboEdit.UnicodeClass2", "ISEnabled", "" ) Then ControlFocus( "Database Comparer v. 2.4. For non-commercial use only.", _ "", "TCheckBox4") Send ("{SPACE}{TAB}") Else ControlFocus( "Database Comparer v. 2.4. For non-commercial use only.", _ "", "TCheckBox4") Send ("{SPACE 2}{TAB}") EndIf Send( "D:\VSO3\Projects\" & $ProjCode & "\Data\ReGenFDbVSO3.SQL" ) ;Click check and update SplashOff() MouseMove( 260, 165, 0) Sleep ( 500 ) MouseClick( $primary) SplashTextOn( 'Creating Empty FDB', CHR(13) & CHR(13) & 'Till you see this messsage' & CHR(13) &_ CHR(13) & 'please do not touch the keyboard / mouse.' & CHR(13), 250, 200, 50, 50, -1, 'Arial', 12, 1000 ) ;Wait for process to complete Do Until ControlCommand ( "Database Comparer v. 2.4. For non-commercial use only.", _ "", "TWideComboEdit.UnicodeClass1", "ISEnabled", "" ) MouseClick( $primary, 45, 110, 1, 0) ;Delete the alias Send ( '{Del}Y' ) ;Close Send ( '!{F4}' ) ;Wait till Marathon is active WinWaitClose ( 'Database Comparer v. 2.4. For non-commercial use only.' ) ;Delete Flag File FileDelete( StringReplace(StringLower(@scriptfullpath), '.au3', '.upr') ) SplashOff() endFunc RegardsBhavbhuti 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