tricky20001 Posted October 19, 2007 Report Share Posted October 19, 2007 Hello everyone, I'm having a few problems with a macro I have 'written' and was wondering if anyone had some ideas! here is a screen grab. macro1.bmp Essentially what I'm trying to do is this. We have automated software to post ads for us, and we use dialup to post. the posting software is automated via the scheduled tasks and every 2 mins a "captcha challenge" window appears. the macro firstly is supposed to recognize when 19 of these windows appear, when 19 have appeared, it moves on to see if another "captcha challenge" window appears after a 20 second break, it looks for this last window every second for 45 seconds (it looks for this window as sometimes the automated captcha is invalid and it tries again), if no window appears it then moves to the next step. Next, it tries to focus the window "easyAd Poster etc" 3 times. (is there a way to make the task fail if this doesnt happen?) Then, it brings the window on top, and the mouse moves to the position of the pause button in the easyad software (again I would like to retry this step 10 times and make the task fail if it doesnt happen) Then, the mouse left clicks to activate the pause (again, I would like this to try 10 times and fail the task if it doesnt happen) The macro then disconnects the dial up, reconnects and with a left click of the mouse it continues "easyad". The problems I am having are these. Firstly how to trigger the macro so it works automatically, ie triggered by the "captcha challenge" window, without EVERY "captcha challenge"window triggering the macro. Secondly, how to make taks fail if something doesnt happen, and thirdly how to end the macro. I think I'm nearly halfway there but would appreciate some help. Thanks in advance Quote Link to comment Share on other sites More sharing options...
Cory Posted October 19, 2007 Report Share Posted October 19, 2007 I’m not sure I follow all of your explanation and I don’t have a lot of time this morning but I’ll toss out a couple. From your explanation I gather that you want to do something when more than 19 of a “Captcha Challenge” appear. From what I see your first section will not accomplish this. By simply repeating 19 times and including an IF condition will not count the windows. If only one window matching the title exists the condition will be satisfied 19 times in milliseconds. I think you would rather do something like this: Repeat with Windows: Place title in %T1% If Variable %T1% = "Captcha Challenge" Variable Modify Integer: Inc (%N1%) End If Repeat End If Variable %N1% < 20 Macro Stop End If This repeat will go thru every open window, test to see if it matches, and count those that match. This happens instantly. Then if the count is less than 20 it will abort the macro. If I have time I'll write more in a bit. Quote Link to comment Share on other sites More sharing options...
Cory Posted October 19, 2007 Report Share Posted October 19, 2007 To answer your questions directly… Firstly how to trigger the macro so it works automatically, ie triggered by the "captcha challenge" window, without EVERY "captcha challenge"window triggering the macro.This is impossible as stated. If you use the macro activation of Window Title it will run whenever there is a window present that matches the condition. However one could have a macro that fires periodically and counts the number of windows as I described before and abort if the number of windows are insufficient. Secondly, how to make taks fail if something doesnt happen, and thirdly how to end the macro.Not sure I follow but in my example I use the Macro Stop command to cease the macro execution when the conditions were not right. Is this what you were asking? Quote Link to comment Share on other sites More sharing options...
tricky20001 Posted October 19, 2007 Author Report Share Posted October 19, 2007 I’m not sure I follow all of your explanation and I don’t have a lot of time this morning but I’ll toss out a couple. From your explanation I gather that you want to do something when more than 19 of a “Captcha Challenge” appear. From what I see your first section will not accomplish this. By simply repeating 19 times and including an IF condition will not count the windows. If only one window matching the title exists the condition will be satisfied 19 times in milliseconds. I think you would rather do something like this: Repeat with Windows: Place title in %T1% If Variable %T1% = "Captcha Challenge" Variable Modify Integer: Inc (%N1%) End If Repeat End If Variable %N1% < 20 Macro Stop End If This repeat will go thru every open window, test to see if it matches, and count those that match. This happens instantly. Then if the count is less than 20 it will abort the macro. If I have time I'll write more in a bit. Thanks for the speedy reply! I've been working on automate6 so its probaby just a different way here. I'll try the variable script and see what happens. All I'm trying to do really is to turn the dialup off and on again when the captcha challenge window is seen 19 times, and then repeat this ad infinitum. Chat later and thanks R Quote Link to comment Share on other sites More sharing options...
Cory Posted October 19, 2007 Report Share Posted October 19, 2007 Well don't get used to it, It's unusual that I am up at this hour on the west coast. :-) Stupid servers... To be honest I lost you there for what you are doing after the 19 windows but get that going first then if you still have questions ask again. Quote Link to comment Share on other sites More sharing options...
tricky20001 Posted October 19, 2007 Author Report Share Posted October 19, 2007 Well don't get used to it, It's unusual that I am up at this hour on the west coast. :-) Stupid servers... To be honest I lost you there for what you are doing after the 19 windows but get that going first then if you still have questions ask again. I don't know if that will work, the "captcha Challenge" window appears for 1 second every 2 mins, its filled in automatically, the macro should recognize when 19 of these have appeared (not at the same time) then disconnects the dialup and reconnects it. Maybe this might make things clearer? Thanks Quote Link to comment Share on other sites More sharing options...
Cory Posted October 19, 2007 Report Share Posted October 19, 2007 Ah, I see. So your macro is entering some data every time it opens or is something else? I would use Window activation and save the count in the registry. Some folks are afraid of using the registry but it's super simple and is more beneficial IMHO. Alternatively you could save the value in a file. So wen it launches it would read this value in and if less than 20 increment the count and write it back to the registry for next time ELSE clear the registry value and do whatever you want to do on the 20th appearance. Quote Link to comment Share on other sites More sharing options...
tricky20001 Posted October 19, 2007 Author Report Share Posted October 19, 2007 Ah, I see. So your macro is entering some data every time it opens or is something else? I would use Window activation and save the count in the registry. Some folks are afraid of using the registry but it's super simple and is more beneficial IMHO. Alternatively you could save the value in a file. So wen it launches it would read this value in and if less than 20 increment the count and write it back to the registry for next time ELSE clear the registry value and do whatever you want to do on the 20th appearance. No, sorry, the macros function is only to turn the dialup off and on again after the "Captcha challenge" window appears 19 times. The actual data entered into the window is done by the posting programme. The 19 limit is so that we dont go over an hour with our dial up. 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.