Jump to content
Macro Express Forums

Dynamic Array - What am I doing wrong?


Recommended Posts

So, I swear I've done this before and swear I had this right yesterday, but it doesn't seem to be working. I want to prompt the user to to identify where buttons are on the web page. There will be 10 in a row and rather than identify 10 different variables, I want to use a variable with an array, use a repeat, and then increment the variable array by one each time but it isn't displaying the value of the variable.

 

Here it is -

 

<VARIABLE SET INTEGER Option="\x00" Destination="%N[1]%" Value="1"/>
<REPEAT START Start="1" Step="1" Count="10" Save="TRUE" Variable="%ICTypeRepeatCounter%"/>
<WAIT FOR KEY PRESS Key="A" Indefinite="TRUE" Hours="0" Minutes="0" Seconds="0"/>
<GET MOUSE POSITION Option="\x00" X="%MousePosX[%N[1]%]%" Y="%MousePosY[%N[1]%]%"/>
<MESSAGEBOX Caption="Mouse Coodinates" Message="%MousePosX[%N1]%]%, %MousePosY{%N1]%]%" Icon="0"/>
<VARIABLE MODIFY INTEGER Option="\x00" Destination="%N[1]%" Value1="%N[1]%" Value2="1"/>
<END REPEAT/>
<DELAY Flags="\x02" Time="500"/>
<MOUSE MOVE Option="\x01" X="%MousePosX[%N[1]%]%" Y="%MousePosY[%N[1]%]%" _PROMPT="0x000A"/>
<DELAY Flags="\x02" Time="500"/>
<MOUSE LEFT CLICK/>
I've also attached a screenshot of the macro commands in the editor if that's easier for anyone. Basically when it gets to where it moves the mouse, it goes in the upper-left hand corner. When I do a message box to display what the Mouse Move Coordinates are, it appears as this -
%MousePosX[%N1]%]%, %MousePosX[%N1]%]%
What am I doing wrong? I swear I must just be missing something really simple here.
-Doug

post-20021-0-46193200-1472685081_thumb.png

Link to comment
Share on other sites

First off you should put your code in a code block.

 

You're missing the concept her on the repeat. Delete the first and sixth line. I have no clue what you're doing here. Now when you set the array values for X and Y use the counter variable specified in the repeat command instead of the N variable. EG %MousePosX[%N[1]%]% should be %MousePosX[%ICTypeRepeatCounter%]%.

 

Later if you want to go though them and click or something you can use the same repeat.

Link to comment
Share on other sites

Oh my word, you're so right. I don't know what I was doing either. I knew I just needed a second set of eyes. Ok, going to adjust and see if that will work.

 

Yep, that worked! Thanks a ton! I think it was late and I was really tired when I was trying to use another unnecessary variable. Thanks for the help!

Edited by gryphon410
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...