Jump to content
UBot Underground

Any Way To Pause Define Command To Wait For User Input? (Recaptcha)


Recommended Posts

Hi there,

 

So I'm working with a site that uses Google's new recaptcha.  I don't always get hit with it.

 

But I was wondering if there is a way to have a define command stop if it detects (element) for the recaptcha, let me pick the pictures, and then click a button to continue the script?

 

I have been successful in making it wait for the checkbox to be checked, but I can't seem to interact with the browser while it's waiting.

 

Does anyone have a way to solve this?

 

Thanks,

 

Cnotey

Link to post
Share on other sites

Use Alert Command so this is how it works:

 

Inside the Define use this logic somewhere in your loop:

 

if {Image Exists

Then {Alert,"Enter Recaptcha Code"

Else {$Nothing}

 

I know syntax isn't correct but that is the general idea of how it works you see When you use Alert command, Script automatically stops and waits for User Input,and then once you enter the desired text you click Ok and Script Continues....

Link to post
Share on other sites

Yea I thought about using that logic.

 

But can you click on things while before you click the alert OK button?

 

I need to manually solve the recaptcha before I continue the script.

 

It's been my previous experience you can't interact with the browser while the alert window is active.

 

Edit:

 

Just tested it and I was correct.  You cannot interact with a browser window while the alert prompt is open.

Link to post
Share on other sites

Yep, ....

 

When it detects the captcha set a variable #capdone "false"

Then enter a Loop While #capdone = "false"

 

Inside that Loop While add something like :

 

If "checkbox is checked" 

Then set #capdone "true"

Else ""

 

 

 

This way you can complete the captcha in 2 ways, 

  • Manually via the browser
  • Via UI Html window (you MUST use a Base64 string for the image AND a "Global" variable for the image)

 

If you use the browser no extra coding is needed, 

f you use a UI Html window then you have to set up some extra switches etc..

 

I have a demo video from one of my bots showing manual reCaptcha v2 image captcha's

if i find it ill post it here for you.

 

 

Cheers

CJ

Link to post
Share on other sites

Not sure if this is what you want.

The example below is waiting And automatically stop waiting
It will wait either.
1. Wait for the timeout 180 seconds.
2. Wait until the "element" that needs to disappear.

ui stat monitor("Status:",#Status)
navigate("http://www.google.com/recaptcha/api2/demo","Wait")
wait for browser event("Everything Loaded","")
wait(1)
if($exists(<class="recaptcha-checkbox-checkmark">)) {
    then {
        set(#TimeOut,180,"Global")
        loop while($both($exists(<class="recaptcha-checkbox-checkmark">),$comparison(#TimeOut,">= Greater than or equal to",0))) {
            decrement(#TimeOut)
            set(#Status,"Captcha detected/Time out: {#TimeOut}","Global")
            wait(1)
        }
    }
    else {
        set(#Status,"Undetected Captcha","Global")
    }
}
Link to post
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...