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