Jump to content

Recommended Posts

Posted

I want to make a scrip that does a simple action in excel, by clicking on each unit, doing a simple action and then moving to the higher/lower unit, I came up with that idea, but don't know how to multiply variable $moveY x+1 time every time loop runs

$OriginalX = MouseGetPos(0)
    $OriginalY = MouseGetPos(1)
    $MoveX = 0
    $MoveY = -73
Dim $i=1
While $i<=10
  ;Action
   MouseMove(403,964) ;starting unit coords
    MouseMove($OriginalX + $MoveX, $OriginalY + $MoveY)
   WEnd

 

Posted

Sure, you just change $MoveY each time you click, but wouldn't recommend this method for Excel, in fact I rarely recommend mouseclick or send for anything.

Posted
9 minutes ago, beekeeper222 said:

But i'd have to write the script all over again, that one is almost completed

I agree with @Subz !
Your script may seem almost completed to you, but you are using a rather unreliable approach. It should not take too much effort to rebuild the script using the Excel UDF. On the long run, you will probably even save time if, for example, extensions are required.

Musashi-C64.png

"In the beginning the Universe was created. This has made a lot of people very angry and been widely regarded as a bad move."

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...