kiteg2 Posted November 7, 2010 Report Share Posted November 7, 2010 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 Quote Link to comment Share on other sites More sharing options...
paul Posted November 7, 2010 Report Share Posted November 7, 2010 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 Quote Link to comment Share on other sites More sharing options...
kiteg2 Posted November 8, 2010 Author Report Share Posted November 8, 2010 Thanks Paul, I will test it tonight. I really appreciate your help. Quote Link to comment Share on other sites More sharing options...
kiteg2 Posted November 8, 2010 Author Report Share Posted November 8, 2010 No such luck, it is not working, I have changed the mouse positions and colors. When I run the macro with this it does not stop, so I am not sure what I am doing wrong. Any sugestions? Quote Link to comment Share on other sites More sharing options...
kiteg2 Posted November 8, 2010 Author Report Share Posted November 8, 2010 Going to assume I messed up Is there anyway I can copy the script and add it in the direct editor? Quote Link to comment Share on other sites More sharing options...
kiteg2 Posted November 8, 2010 Author Report Share Posted November 8, 2010 Where do I find the continue command? Quote Link to comment Share on other sites More sharing options...
kevin Posted November 8, 2010 Report Share Posted November 8, 2010 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'. Quote Link to comment Share on other sites More sharing options...
kiteg2 Posted November 9, 2010 Author Report Share Posted November 9, 2010 Hi Kevin, thanks I could not find continue anywhere. One more question on this. in v3 I do not have read registry value, I have decimal, integer, string. Which of these three should I use? Quote Link to comment Share on other sites More sharing options...
kiteg2 Posted November 9, 2010 Author Report Share Posted November 9, 2010 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. Here is the macro I have attempted, could someone look at it and tell me how to do the delay and what else might be wrong with it.test macro.mex Quote Link to comment Share on other sites More sharing options...
kevin Posted November 9, 2010 Report Share Posted November 9, 2010 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. Quote Link to comment Share on other sites More sharing options...
kevin Posted November 9, 2010 Report Share Posted November 9, 2010 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. Quote Link to comment Share on other sites More sharing options...
kiteg2 Posted November 9, 2010 Author Report Share Posted November 9, 2010 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 Quote Link to comment Share on other sites More sharing options...
kiteg2 Posted November 9, 2010 Author Report Share Posted November 9, 2010 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. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.