hclonelyConnect

ConnectFuc

This script should not be not be installed directly. It is a library for other scripts to include with the meta directive // @require https://greasyfork.org/scripts/381004-hclonelyconnect/code/hclonelyConnect.js?version=683945

//prys.ga

function $_checkStep(step,captcha){
    if(!captcha)captcha=null;
    if(step!=="captcha")$jq("#check"+step).replaceWith('<span id="check'+step+'"><i class="fa fa-refresh fa-spin fa-fw"></i> Checking...</span>');
    $jq.post("/api/check_step",{step:step,id:getURLParameter("id"),"g-recaptcha-response":captcha},function(json){
        if(json.success&&step!=="captcha"){
            $jq("#check"+step).replaceWith('<span class="text-success" id="check'+step+'"><i class="fa fa-check"></i> Success</span>');
            $_showAlert("success",'Check passed successfully! Thank you for completing this step. <i class="fa fa-smile-o"></i>');
        }else if(step!=="captcha"){
            $jq("#check"+step).replaceWith('<a id="check'+step+'" href="javascript:checkStep('+step+')"><i class="fa fa-question"></i> Check</a>');
            var msg="Please complete the step and then check again.";
            $_showAlert("warning",(json.response?json.response.error?json.response.error:msg:msg));
        }
        if(json.response){
            if(json.response.captcha&&json.success){
                $_showAlert("info",json.response.captcha);
                $_captchaCheck();
            }else if(json.response.captcha){
                $_showAlert("warning",json.response.captcha);
                $_captchaCheck();
            }
            if(json.response.prize){
                $_showAlert("success",'Here is your prize:<h1 role="button" align="middle" style="word-wrap: break-word;">'+json.response.prize+'</h2>');
            }
        }
    }).fail(function(){
        $jq("#check"+step).replaceWith('<a id="check'+step+'" href="javascript:checkStep('+step+')"><i class="fa fa-question"></i> Check</a>');
        $_showAlert("danger","Failed to check this step. Please try again later. Spamming it may make it worse.");
    });
}
function $_checkClick(step){
    $jq("#step"+step).find("td").last().html('<a id="check'+step+'" href="javascript:checkStep('+step+')"><i class="fa fa-question"></i> Check</a>');
}
function $_showAlert(type,msg){
    $jq(".alert").addClass("hidden");
    $jq(".alert-"+type).removeClass("hidden");
    $jq("#"+type+"-msg").html(msg);
}
function $_captchaCheck(){
    var solveCheck=setInterval(function(){
        if(grecaptcha.getResponse().length>0){
            clearInterval(solveCheck);
            $_checkStep("captcha",grecaptcha.getResponse());
        }
    },100);
}