Jump to content
Macro Express Forums

If two minutes passes, then click refresh icon, but then keep going....


Recommended Posts

Below is code presently used:

 

<REPEAT UNTIL Variable="%N2%" Condition="\x00" Value="15790320"/>
<DELAY Flags="\x00" Time="10"/>
<GET PIXEL COLOR Option="\x01" Rel_To_Screen="TRUE" X="879" Y="772" Destination="%N2%"/>
<END REPEAT/>
This code waits for a particular color (blue) to appear at a certain pixel.
Normally goes great. Colored pixel appears. Macro goes on to next steps.
HOWEVER, sometimes server error occurs at other end. Where color is expected is just white only. Macro hangs, waiting, waiting....
What I would like is a way to say: If color does not appear in 2 minutes, then go up and click on refresh button. But continue as before. Hopefully the colored pixel will materialize this time around. If it still does not, go up and click that refresh button again. And wait, once again for colored pixel to come up. Etc.
I have this macro running on a computer off to the side. Things generally go smoothly. But sometimes I look over, and server error has occurred. Macro is simply waiting, forever. So I have to reach over and manually click the refresh button. That usually does the trick. Colored pixel shows up. Macro continues as if all is well.
Any help greatly appreciated.
Nicholas Kormanik
Link to comment
Share on other sites

Increment an integer counter each time through the Repeat loop. Then test the counter value. For example, if your delay command specifies 1 second delay after checking pixel value, then when the counter reaches 120 the macro has been waiting about two minutes. If you use a half-second delay, check counter for 240 rather than 120; etc.

 

When the counter reaches 120, click on the refresh button and reset the counter to zero to wait some more. You may be able to press the F5 key to refresh rather than using the mouse.

 

Get pixel color

Set counter = 0

Repeat until pixel color

Wait 1 second

Increment counter

If counter >= 120

Click refresh

Set counter = 0

End if

Get pixel color

Repeat End

  • Like 1
Link to comment
Share on other sites

Thank you, rberq. Appears to be working. Here is the actual code:

 

<GET PIXEL COLOR Option="\x01" Rel_To_Screen="TRUE" X="879" Y="772" Destination="%N2%"/>
<VARIABLE SET INTEGER Option="\x00" Destination="%Counter%" Value="0"/>
<REPEAT UNTIL Variable="%N2%" Condition="\x00" Value="15790320"/>
<WAIT FOR TIME TO ELAPSE Hours="0" Minutes="0" Seconds="1"/>
<VARIABLE MODIFY INTEGER Option="\x07" Destination="%Counter%"/>
<IF VARIABLE Variable="%Counter%" Condition="\x04" Value="300" IgnoreCase="FALSE"/>
<MOUSE MOVE Option="\x01" X="991" Y="579" _PROMPT="0x000A"/>
<MOUSE LEFT BUTTON DOWN/>
<MOUSE LEFT BUTTON UP/>
<VARIABLE SET INTEGER Option="\x00" Destination="%Counter%" Value="0"/>
<END IF/>
<GET PIXEL COLOR Option="\x01" Rel_To_Screen="TRUE" X="879" Y="772" Destination="%N2%"/>
<END REPEAT/>
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...