01-12-2010, 04:34 AM
I'm trying to use decaptcha with iMacro to auto solve and fill captchas. I have everything up to the point of getting the captcha. When iMacro loads the main.php file then displays my solved captcha, it shows the captcha 3 times. So then my iMacro proceeds to copy that solved triple displayed captcha, but I only want/need it to copy that one of the three identical captchas.
Here is decaptcha's main.php file code:
If anyone has any ideas how to fix it from displaying the captcha three times rather than one, I would greatly appreciate it.
Thanks,
Here is decaptcha's main.php file code:
Code:
<?php
require( 'ccproto_client.php' );
// your connect information
define( 'HOST', "72.233.64.162" ); // YOUR HOST
define( 'PORT', 7462 ); // YOUR PORT
define( 'USERNAME', "myusername" ); // YOUR LOGIN
define( 'PASSWORD', "mypassword"); // YOUR PASSWORD
define( 'PIC_FILE_NAME', "pic.jpg" );
$ccp = new ccproto();
$ccp->init();
print( "" );
if( $ccp->login( HOST, PORT, USERNAME, PASSWORD ) < 0 ) {
print( " FAILED\n" );
return;
} else {
print( "" );
}
$system_load = 0;
if( $ccp->system_load( $system_load ) != ccERR_OK ) {
print( "" );
return;
}
print( "" );
$balance = 0;
if( $ccp->balance( $balance ) != ccERR_OK ) {
print( "" );
return;
}
print( "" );
$major_id = 0;
$minor_id = 0;
for( $i = 0; $i < 3; $i++ ) {
$pict = file_get_contents( PIC_FILE_NAME );
$text = '';
print( "" );
$pict_to = ptoDEFAULT;
$pict_type = ptUNSPECIFIED;
$res = $ccp->picture2( $pict, $pict_to, $pict_type, $text, $major_id, $minor_id );
switch( $res ) {
// most common return codes
case ccERR_OK:
print( $text );
break;
case ccERR_BALANCE:
print( "not enough funds to process a picture, balance is depleted" );
break;
case ccERR_TIMEOUT:
print( "picture has been timed out on server (payment not taken)" );
break;
case ccERR_OVERLOAD:
print( "temporarily server-side error" );
print( " server's overloaded, wait a little before sending a new picture" );
break;
// local errors
case ccERR_STATUS:
print( "local error." );
print( " either ccproto_init() or ccproto_login() has not been successfully called prior to ccproto_picture()" );
print( " need ccproto_init() and ccproto_login() to be called" );
break;
// network errors
case ccERR_NET_ERROR:
print( "network troubles, better to call ccproto_login() again" );
break;
// server-side errors
case ccERR_TEXT_SIZE:
print( "size of the text returned is too big" );
break;
case ccERR_GENERAL:
print( "server-side error, better to call ccproto_login() again" );
break;
case ccERR_UNKNOWN:
print( " unknown error, better to call ccproto_login() again" );
break;
default:
// any other known errors?
break;
}
print ( "\n" );
// process a picture and if it is badly recognized
// call picture_bad2() to name it as error.
// pictures named bad are not charged
//$ccp->picture_bad2( $major_id, $minor_id );
}
$balance = 0;
if( $ccp->balance( $balance ) != ccERR_OK ) {
print( "balance() FAILED\n" );
return;
}
print( "" );
$ccp->close();
// also you can mark picture as bad after session is closed, but you need to be logged in again
$ccp->init();
print( "" );
if( $ccp->login( HOST, PORT, USERNAME, PASSWORD ) < 0 ) {
print( "" );
return;
} else {
print( "" );
}
print( "" );
$ccp->picture_bad2( $major_id, $minor_id );
$ccp->close();
?>
If anyone has any ideas how to fix it from displaying the captcha three times rather than one, I would greatly appreciate it.
Thanks,