Leoshin 0 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 Share this post Link to post Share on other sites
water 2,387 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 2020-10-10 - Version 1.5.2.1) - Download - General Help & Support - Example Scripts - WikiOutlookEX (NEW 2020-12-15 - Version 1.6.3.1) - Download - General Help & Support - Example Scripts - WikiOutlookEX_GUI (2020-06-27 - Version 1.3.2.0) - DownloadOutlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - WikiExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example ScriptsPowerPoint (2017-06-06 - Version 0.0.5.0) - Download - General Help & SupportExcel - Example Scripts - WikiWord - WikiTask Scheduler (2019-12-03 - Version 1.5.1.0) - Download - General Help & Support - WikiTutorials:ADO - Wiki, WebDriver - Wiki Share this post Link to post Share on other sites
Leoshin 0 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 :-/ Share this post Link to post Share on other sites