Sign in to follow this  
Followers 0
Leoshin

Syntax Check

3 posts in this topic

Hello,

I created an AutoIT file to solve a sorting problem.

The methodology seems to be fine, i get no error messages either, but

instead 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:

Posted Image

The code:

HotKeySet("{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



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 2017-04-18 - Version 1.4.8.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2017-02-27 - Version 1.3.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2015-04-01 - Version 0.4.0.0) - Download - General Help & Support - Example Scripts
Excel - Example Scripts - Wiki
Word - Wiki
PowerPoint (2015-06-06 - Version 0.0.5.0) - Download - General Help & Support

Tutorials:
ADO - Wiki

 

Share this post


Link to post
Share on other sites

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

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 account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0