Jump to content
Macro Express Forums

Corresponding Repeat End Not Found


CWD

Recommended Posts

I've run into a problem where ME is complaining that a Repeat End is not found for a corresponding Repeat Start. I've verified on screen that each Repeat Start has a Repeat End. I've printing out the script and highlighted each start and end. It appears to be correct.

 

Originally I used a Repeat Variable. One thing I noticed was that Repeat End was highlighted green. So, I just changed Repeat Variable to Repeat Start after encountering the error. I still get the error every time the script runs. Could someone help me understand what is going one?

 

The Macro Runs have been tested individually and are working. The problem occurs sometime after the bolded repeat command. I've bolded it here to make it more apparent.

 

// Detects NPCs
Macro Run: Set overview NPC
Mouse Move Window 1187, 217
Delay 750 Milliseconds
Mouse Left Button Click
Delay 750 Milliseconds
Get Pixel: Under Mouse into %N70%
If Variable %N70% > 0
 Macro Run: Checks if light on. If yes, turns them off.
 Macro Run: Window up
 Macro Run: Deploys items
 Macro Run: Detect numbers of NPC
 // Moves mouse to first, then second, third, so on.
 Variable Set Integer %N73% to 217
 Variable Set Integer %N75% to 1
[b] Repeat Start (Repeat 20 times)[/b]
   Mouse Move Window 1187, %N73%
   Delay 750 Milliseconds
   Mouse Left Button Click
   Delay 750 Milliseconds
   Mouse Move Window 1314, 117
   Delay 750 Milliseconds
   Mouse Left Button Click
   Delay 750 Milliseconds
   Mouse Move Window 1294, 531
   Delay 750 Milliseconds
   Mouse Right Button Click
   Delay 750 Milliseconds
   Mouse Move Window 1355, 560
   Delay 750 Milliseconds
   Mouse Left Button Click
   Delay 750 Milliseconds
   Mouse Move Window 1187, %N73%
   Delay 750 Milliseconds
   Mouse Left Button Click
   Delay 1 Milliseconds
   Get Pixel: Under Mouse into %N76%
   // Waits for first to be destroyed.
   Repeat Start (Repeat 20 times)
     If Variable %N76% > 0
       Break
     End If
     Wait Time Delay 5 Seconds
     Delay 750 Milliseconds
   Repeat End
 End If
 Delay 750 Milliseconds
 Variable Modify Integer: %N75% = %N75% + 1
Repeat End

Link to comment
Share on other sites

The inner Repeat Start - Repeat End is OK.

The outer (first) Repeat Start is after the main IF, but its Repeat End is after the END IF.

So, logically your code may reach the Repeat End without having executed the Repeat Start.

I think that is the problem.

Link to comment
Share on other sites

The inner Repeat Start - Repeat End is OK.

The outer (first) Repeat Start is after the main IF, but its Repeat End is after the END IF.

So, logically your code may reach the Repeat End without having executed the Repeat Start.

I think that is the problem.

 

 

That was it. Thanks. I never worked with ME on this level before last week. It was always just recording mouse clicks and movements. Again thanks.

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