Jump to content

How can i simplify my code?


Recommended Posts

Hi, I started using AUTOIT 3 days ago and encountered a problem. Well, I wanted to test different applications using autoit. I have 20 different "pages" in this program and in order to go to the next one you have to select it from the drop-down list.  The problem is how to create a "counter" that would change the variable to the next one after each executed script/for loop, at a given point.


Func stop()

Global $Var1 = MouseClick("left",162, 353,1,10)
Global $Var2 = MouseClick("left",285, 395,1,10)
Global $var3 = MouseClick("left",287, 430,1,10)
Global $Var4 = MouseClick("left",293, 460,1,10)

#region Click on the drop-down list and select the next page
MouseClick("left", random(806,819,1),Random(421,501,1),1,10) ;starting click
MouseClick("left", random(169,400,1),Random(230,240,1),1,10) ;click on drop-down list

;Here "counter" $var1 +1
MouseClick("left" ,random(173,445,1),Random(325,343,1),10) ;Click on next page  
;MouseClickDrag("left",255, 583,295, 210,10) Moving drop-down list by ten pages.

MouseClick("left", random(337,437,1),Random(942,956,1),1,10) ;ending selecting next page

Best regards, Norbii

Link to comment
Share on other sites

Hello Norbiii,


welcome to the forum.


I have no clue what you want to do. I cannot immagine, what it should be good for placing mouse clicks on random coordinates.


What are you trying to do?

Earth is flat, pigs can fly, and Nuclear Power is SAFE!

Link to comment
Share on other sites

is this automation software? Your AutoIt script is used to automatically scroll through a set of data presented in some other software? And you don't know how to stop when you get to the end?

~ or something like that?


Why is the snake in the sky?

Link to comment
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

  • Recently Browsing   0 members

    • No registered users viewing this page.
  • Create New...