Jump to content
Macro Express Forums

website wait


kiteg2

Recommended Posts

I have a macro on my computer which has a setting for a three second delay in firefox. That is enough time for the website to op.

However I tested this macro on two other computers and had someone esle test it. And it failed every time.

 

So I want to set a delay. Problem is when I set wait for website, the macro just stops and the website login does not get filled in.

If I set it for a time value it is specific to this computer only.

 

I am trying to get this to run in opera on a slower computer and a slower internet speed.

 

Can someone please tell me a work around so opera and firefox will wait until the page loads and then continue on.

Thanks

Graham

Link to comment
Share on other sites

I attach "code" that you should use to create a macro that finishes only when Firefox's toolbar X reverts to its normal loaded state (or after 100 iterations in case the site never loads). You'll probably have to change the pixel values in lines 8 and 12, and perhaps the location too in line 7.

You should be aware that in some circumstances Firefox is still not ready to continue even when the X has reverted. This explains the code from line 19 onwards: if the calling macro needs this macro to wait extra time, it specifies the number of seconds to wait in the allocated registry value. If you want to use this feature, you'll need to allocate a value at an appropriate location in the registry, and change the code in lines 19 and 23 to reflect that revised location.

If Not Program "FIREFOX.EXE" is running
 Macro Stop
End If
Window Activate: Mozilla Firefox
// Check X, wait until not red
Repeat Start (Repeat 100 times)
 Get Pixel Color at (140, 66) Relative to Current Window into %N99%
 If Variable %N99% Equals "13128728"
   Delay: 250 milliseconds
   Continue
 Else
   If Variable %N99% Equals "10791339"
     Repeat Exit
   End If
 End If
 Macro Stop
End Repeat
Delay: 1 seconds
Read Registry Value "HKEY_CURRENT_USER\Software\Professional Grade Macros\PhtData\FirefoxAfterLoadDelay" into %N99%
If Variable %N99% Is Greater Than "0"
 Delay: %N99% seconds
 Variable Set Integer %N99% to 0
 Write Registry Value "%N99%" into HKEY_CURRENT_USER\Software\Professional Grade Macros\PhtData\FirefoxAfterLoadDelay
End If

Link to comment
Share on other sites

Where do I find the continue command?

In Macro Express 3 the command is Break. In Macro Express Pro either Break or Continue will work.

 

To search for a command, with the Scripting Editor open, either click in the 'Search for Command' box or press Alt-Down Arrow. Type all or part of the command, for example 'Break'.

Link to comment
Share on other sites

The sample macro Paul provided was written for Macro Express Pro, not Macro Express 3. There are differences. A macro written in Macro Express 3 will be converted when read into Macro Express Pro. However, you have to manually convert a Macro Express Pro macro to run in Macro Express 3.

 

I could not find continue anywhere.

Continue is available in Macro Express Pro, not Macro Express 3.

 

I do not have read registry value, I have decimal, integer, string. Which of these three should I use?

Since Paul's example shows the Read/Write Registry commands reading and writing to an integer value (%N99%), it stands to reason that you need to use Read Registry Integer.

Link to comment
Share on other sites

Also this comand is a problem: Delay: %N99% seconds

as I can't see a delay that will let me set an N value, they all want a number only.

Anywhere you can enter a value into a command you can enter a variable. Just type %N99% in the 'Delay Time' field of the Delay command.

Link to comment
Share on other sites

Thanks for the % in the %n99% so I have gone through it step by stap and checked everything as per the post but when the macro runs it logs in to hostgator crashes the program, open the find box and types / Check X, wait until not redRepeat Start (Repeat 100 times) Get Pixel Color at (140, 66) Relative to Current Window into 0 If Variable 0 Equals "13128728" Delay: 250 milliseconds Continue Else If Variable 0 Equals "10791339""

 

I have gone through every line very carfully as best I can in v3 I don't evan know where the (140 , 66) is coming from as I can't see it in the macro! wait until not redRepeat? I can't see any of this in the macro.

I would appreciate someone having a look at this and telling me what I have done wrong.error macro.mex

Link to comment
Share on other sites

If I take out lines 1 - 4 the program stops crashing.

What does tha mean???

 

Also The macro stops somewhere and I have no idea where. It should do a "control f" and open the firefox find command and then enter test and do a search. It doesn't do that, and no matter what I disable nothing runs the entire macro.

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