Leoshin Posted August 7, 2012 Posted August 7, 2012 Hello,I created an AutoIT file to solve a sorting problem.The methodology seems to be fine, i get no error messages either, butinstead of sorting the mouse just moves to the top right screen and keeps going there.Can someone tell me what exactly i did wrong ?The goal:The code:expandcollapse popupHotKeySet("{ESC}","Quit") MsgBox(0, "Select", "Please open your Sheet ") Sleep(10000) Dim $A ; Declare variable A-F Dim $B Dim $C Dim $D Dim $E Dim $F $A = 1135 ; Assign a numeric value to the variables $B = 165 ; $C = 1135 $D = 95 $E = 1165 $F = 95 For $i = 0 to 30 ; Big loop to initiate first sorting Step MouseMove($A , $B) ;Click Row 1 Column 3 on the sheet MouseClick("right") Sleep (1000) While $A < 1346 ; Should increase "A" by 35 with every loop ( one row to the right per run and one column down if it reaches the sixt row ) $A=$A+35 WEnd If $A = 1345 Then ; When "A" reaches 1345 (Row 6) it should become 1135 again (Row 1) and the mouse cursor should shift a column deeper $B += 35 $A = 1135 EndIf For $i = 0 To 3 ; Loop in the Loop sets positions for the sorting process $C=$A ; Puts "Click 2" in the same row as "Click 1" $D=$B-70 ; "Click 2" should be always 2 columns higher than "Click 1" $E=$C+35 ; Puts Click 3 one row ahead of CLick 2 MouseMove($C , $D) MouseClick("right") Sleep (1000) MouseMove(107, 133) ; Goes to "Click 3" MouseClick("left") Sleep (4500) For $i = 0 To 12 ; Loop in the Loop in the Loop does the sorting MouseMove($C , $D) MouseClick("right") Sleep (1000) MouseMove($E , $F) MouseClick("right") Sleep (1000) MouseMove(107, 133) ; Goes to "Click 3" MouseClick("left") Sleep (4500) While $E < 1346 ; Should increase "E" by 35 with every loop $A=$A+35 WEnd If $E = 1345 Then ; When "E" reaches 1345 it should become 1135 again and "F" is increased by 35 $F += 35 $E = 1135 EndIf Next Next Next
water Posted August 7, 2012 Posted August 7, 2012 Hi Leoshin, could you please explain what kind of program you try to automate? Maybe there is an easier way to do what you want. 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
Leoshin Posted August 7, 2012 Author Posted August 7, 2012 Hello Water , Its basically a surface to put together sheet staples in the order i described , same as ordering cards or letters. I have a stand alone surface and no function to integrate AutoIt in it thats what i googled for first. I know how to manually code it ( ( it finished 3/30 routines perfectly ) ), the problem is that the script has 1400 command lines already and i was looking for a more efficient way. I went through the methodology a couple of times , there should be no flaws anymore, just the syntax is kinda screwed up for me :-/
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