Jump to content
Macro Express Forums

There is no matching End If for the initial If.


Shinju
 Share

Recommended Posts

Unbenannt.jpg

Unbenannt2.jpg

So here is my problem, I'm trying to run this very simple macro but this error occurs.

I just dont get how the end if is not matching and how i can get it to work.

 

thx in advance for any help

The problem is that your If statement is inside the Repeat loop and its matching End If is outside the repeat.

 

You'll want to bring the Else and End If inside the loop... it will look more like this:

 

Repeat Start (Repeat 255 times)
 Text Type: %D1%
 Mouse Move Screen 865, 744
 Mouse Left Button Click
 Mouse Move Screen 794, 682
 Mouse Left Button Click
 If Online
Mouse Move Screen 180, 28
Mouse Left Button Double Click
Delay 3 Seconds
Mouse Move Screen 842, 187
Mouse Left Button Click
Mouse Move Screen 844, 211
Mouse Left Button Click
Mouse Move Screen 1188, 723
Mouse Left Button Click
 Else
Variable Modify Decimal: %D1% = %D1% + 1
Break
 End If
Repeat End

Notice the Break command. That is how you get out of the Repeat loop when dealing with If/Else situations.

 

Hope this helps!

Link to comment
Share on other sites

Thx for your help.

My last question is: How can I stop the macro with a key combination?

 

By default this is 'scroll lock' + 'pause|break' but you can change this at options > preferences > playback.

 

I changed mine to just pause|break because I hate having my scroll lock state toggled all the time.

Link to comment
Share on other sites

Hello again

I have another question, is there a way to program something like;

<if ping under 100ms>

<break>

 

i know there is a <if ping successful>

command line in the scripting editor but that doesn't work for me because if the network isn't even reachable the ping is counted as successful cous no package is lost.

 

Thx in advance

Link to comment
Share on other sites

Hello again

I have another question, is there a way to program something like;

<if ping under 100ms>

<break>

 

i know there is a <if ping successful>

command line in the scripting editor but that doesn't work for me because if the network isn't even reachable the ping is counted as successful cous no package is lost.

 

Thx in advance

The If Ping Successful command has a "Maximum Time to Wait" setting. It can't be set to less than 1 second, but that is one option.

Link to comment
Share on other sites

The If Ping Successful command has a "Maximum Time to Wait" setting. It can't be set to less than 1 second, but that is one option.

 

Yes i tried this but that is still to long. I worked around with pinging a site and evaluate. I just read the changelog

"The Wait commands no longer accept a maximum wait time of 0:00. The user must enter at least a one second wait time."

Is there a way to get around this and set under 1 second?

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

×
×
  • Create New...