// ==UserScript==
// @name Instant Ourcoin Faucet Rotator
// @namespace Instant Ourcoin Faucet Rotator
// @version 1.0
// @description Zero Timer Claim
// @author lotocamion
// @match https://ourcoin.xyz/faucet/*
// @match https://ourcoinfaucet.xyz/doge-faucet/*
// @connect ourcoinfaucet.xyz
// @connect ourcoin.xyz
// @grant GM_setValue
// @grant GM_getValue
// @grant GM_xmlhttpRequest
// ==/UserScript==
(function() {
'use strict';
var doge ="ENTER_YOUR_FAUCETPAY_DOGECOIN_ADDRESS";
var ltc="ENTER_YOUR_FAUCETPAY_LITECOIN_ADDRESS";
var websiteData = [
{url : "https://ourcoinfaucet.xyz/doge-faucet/?r=DGNRvwyYSMYKjxFDm8BHTcD23kWesLg5i1", address: doge},
{url : "https://ourcoin.xyz/faucet/?r=MThidmDerYdNaDw1QAdF1c2Xe3fbuaJ5ZD", address: ltc},
];
var websiteMap = [{website : ["ourcoin.xyz/faucet","ourcoinfaucet.xyz"],
inputTextSelector: "#wpbf_address",captchaButtonSubmitSelector: "#wpbf-claim-form",
allMessageSelectors: [".alert.alert-success",".alert.alert-danger",".alert.alert-info", "h1"],
messagesToCheckBeforeMovingToNextUrl: ["Recharg", "You have to wait","was sent","sufficient","successfully","wrong","system","network", "Sorry"],formSubmit: true},];
function triggerEvent(el, type) {
try{
var e = document.createEvent('HTMLEvents');
e.initEvent(type, false, true);
el.dispatchEvent(e);
}catch(exception){
console.log(exception);
}
}
String.prototype.includesOneOf = function(arrayOfStrings) {
if (!Array.isArray(arrayOfStrings)) {
return this.toLowerCase().includes(arrayOfStrings.toLowerCase());
}
for (var i = 0; i < arrayOfStrings.length; i++) {
if (this.toLowerCase().includes(arrayOfStrings[i].toLowerCase())) {
return true;
}
}
return false;
}
var websiteDataValues = {};
for (let value of Object.values(websiteMap)) {
if(window.location.href.includesOneOf(value.website)){
websiteDataValues.inputTextSelector= value.inputTextSelector;
websiteDataValues.inputTextSelectorButton = value.inputTextSelectorButton;
websiteDataValues.defaultButtonSelectors = value.defaultButtonSelectors;
websiteDataValues.claimButtonSelector = value.claimButtonSelector;
websiteDataValues.captchaButtonSubmitSelector = value.captchaButtonSubmitSelector;
websiteDataValues.allMessageSelectors = value.allMessageSelectors;
websiteDataValues.messagesToCheckBeforeMovingToNextUrl = value.messagesToCheckBeforeMovingToNextUrl;
websiteDataValues.balanceSelector = value.balanceSelector;
websiteDataValues.successMessageSelectors = value.successMessageSelectors;
websiteDataValues.additionalFunctions = value.additionalFunctions;
websiteDataValues.timeoutbeforeMovingToNextUrl = value.timeoutbeforeMovingToNextUrl;
websiteDataValues.formSubmit = value.formSubmit;
break;
}
}
var count = 0;
var addressAssigned = false;
for (let value of Object.values(websiteData)) {
count = count + 1;
if(value.url.includes(window.location.hostname) && (window.location.href.includes("/" + value.coin + "/") || window.location.href.includes("/" + value.coin + "-"))){
websiteDataValues.address = value.address;
addressAssigned = true;
break;
}
}
if(!addressAssigned){
count = 0;
for (let value of Object.values(websiteData)) {
count = count + 1;
if(value.url.includes(window.location.hostname)){
if(value.regex){
if(GM_getValue("UrlRegex")){
if(GM_getValue("UrlRegex") == value.regex){
websiteDataValues.address = value.address;
break;
}
}else{
GM_setValue("UrlRegex",value.regex);
websiteDataValues.address = value.address;
break;
}
}else{
websiteDataValues.address = value.address;
break;
}
}
}
}
async function getNextUrl(){
if(count >= websiteData.length){
count = 0;
websiteDataValues.nextUrl = websiteData[count].url;
websiteDataValues.regex = websiteData[count].regex;
}else{
websiteDataValues.nextUrl = websiteData[count].url;
websiteDataValues.regex = websiteData[count].regex;
}
pingTest(websiteDataValues.nextUrl);
}
var isNextUrlReachable = false;
function pingTest(websiteUrl) {
console.log(websiteUrl);
GM_xmlhttpRequest({
method: "GET",
url: websiteUrl,
headers: {
"Content-Type": "application/x-www-form-urlencoded"
},
timeout: 8000,
onload: function(response) {
isNextUrlReachable = true;
},
onerror: function(e) {
count=count+1;
getNextUrl();
},
ontimeout: function() {
count=count+1;
getNextUrl();
},
});
}
async function delay(ms) {
return new Promise(resolve => setTimeout(resolve, ms))
}
var movingToNextUrl = false;
async function goToNextUrl() {
if(!movingToNextUrl){
movingToNextUrl = true;
getNextUrl();
while (!isNextUrlReachable) {
await delay(3000);
}
if( websiteDataValues.regex){
GM_setValue("UrlRegex", websiteDataValues.regex);
}
window.location.href = websiteDataValues.nextUrl;
movingToNextUrl = true;
}
}
async function goToWithdrawPage() {
if(!movingToNextUrl){
movingToNextUrl = true;
window.location.href = websiteDataValues.withdrawPageUrl;
}
}
var delayBeforeMovingToNextUrl = 120000;
if(websiteDataValues.timeoutbeforeMovingToNextUrl){
delayBeforeMovingToNextUrl = websiteDataValues.timeoutbeforeMovingToNextUrl;
}
setTimeout(function(){
movingToNextUrl = false;
goToNextUrl();
},delayBeforeMovingToNextUrl);
if (window.location.href.includes("to=FaucetPay") || websiteDataValues.address.length < 5 || websiteDataValues.address.includes("YOUR_")){
goToNextUrl();
}
function messageSelectorsPresent(){
if(websiteDataValues.allMessageSelectors){
for(var j=0;j<websiteDataValues.allMessageSelectors.length;j++){
for(var k=0; k< document.querySelectorAll(websiteDataValues.allMessageSelectors[j]).length;k++){
if(document.querySelectorAll(websiteDataValues.allMessageSelectors[j])[k] &&
(document.querySelectorAll(websiteDataValues.allMessageSelectors[j])[k].innerText.includesOneOf(websiteDataValues.messagesToCheckBeforeMovingToNextUrl) ||
(document.querySelectorAll(websiteDataValues.allMessageSelectors[j])[k].value &&
document.querySelectorAll(websiteDataValues.allMessageSelectors[j])[k].value.includesOneOf(websiteDataValues.messagesToCheckBeforeMovingToNextUrl)))){
return true;
}
}
}
}
return false;
}
function checkMessageSelectorsLength(){
if(websiteDataValues.allMessageSelectors){
for(var j=0;j<websiteDataValues.allMessageSelectors.length;j++){
for(var k=0; k< document.querySelectorAll(websiteDataValues.allMessageSelectors[j]).length;k++){
if(document.querySelectorAll(websiteDataValues.allMessageSelectors[j])[k] &&
(document.querySelectorAll(websiteDataValues.allMessageSelectors[j])[k].innerText.length > 0) ||
(document.querySelectorAll(websiteDataValues.allMessageSelectors[j])[k].value &&
document.querySelectorAll(websiteDataValues.allMessageSelectors[j])[k].value.length > 0)){
return true;
}
}
}
}
return false;
}
function successMessageSelectorsPresent(){
if(websiteDataValues.successMessageSelectors){
for(var j=0;j<websiteDataValues.successMessageSelectors.length;j++){
for(var k=0; k< document.querySelectorAll(websiteDataValues.successMessageSelectors[j]).length;k++){
if(document.querySelectorAll(websiteDataValues.successMessageSelectors[j])[k] && document.querySelectorAll(websiteDataValues.successMessageSelectors[j])[k].innerText.includesOneOf(websiteDataValues.messagesToCheckBeforeMovingToNextUrl)){
return true;
}
}
}
}
return false;
}
function freePerfectMoneyCaptcha(){
if(document.querySelector("#captcha") && document.querySelector("#user_input")){
document.querySelector("#user_input").value = document.querySelector("#captcha").value ;
}
}
function faucetTop() {
if(!movingToNextUrl && checkMessageSelectorsLength()){
goToNextUrl();
}
if(document.querySelectorAll(websiteDataValues.inputTextSelectorButton).length >=2 ){
movingToNextUrl = true;
return;
}
if(document.querySelector(".h-captcha")) {
movingToNextUrl = true;
return;
}
for(var hc=0; hc < document.querySelectorAll("iframe").length; hc++){
if(document.querySelectorAll("iframe")[hc] &&
document.querySelectorAll("iframe")[hc].hasAttribute("data-hcaptcha-response")) {
movingToNextUrl = true;
}
}
}
setTimeout(function(){
if( websiteDataValues.additionalFunctions){
websiteDataValues.additionalFunctions();
}
if(websiteDataValues.withdrawEnabled){
if(websiteDataValues.balanceSelector && document.querySelector(websiteDataValues.balanceSelector)){
var currentBalance = document.querySelector(websiteDataValues.balanceSelector).innerText;
if(currentBalance > websiteDataValues.withdrawMinAmount && !window.location.href.includes(websiteDataValues.withdrawPageUrl)) {
goToWithdrawPage();
}
}else{
if(successMessageSelectorsPresent()){
goToWithdrawPage();
}
}
}
if(!movingToNextUrl && messageSelectorsPresent()){
goToNextUrl();
}
if(!movingToNextUrl && websiteDataValues.defaultButtonSelectors){
for(var i=0;i<websiteDataValues.defaultButtonSelectors.length ;i++){
if(document.querySelector(websiteDataValues.defaultButtonSelectors[i])){
triggerEvent(document.querySelector(websiteDataValues.defaultButtonSelectors[i]), 'mousedown');
triggerEvent(document.querySelector(websiteDataValues.defaultButtonSelectors[i]), 'mouseup');
document.querySelector(websiteDataValues.defaultButtonSelectors[i]).click();
break;
}
}
}
if(!movingToNextUrl && document.querySelector(websiteDataValues.inputTextSelector)){
document.querySelector(websiteDataValues.inputTextSelector).value = websiteDataValues.address;
setTimeout(function(){
if(websiteDataValues.inputTextSelectorButton && document.querySelector(websiteDataValues.inputTextSelectorButton)){
document.querySelector(websiteDataValues.inputTextSelectorButton).click();
}
},5000);
}
var clicked = false;
var captchaInterval = setInterval(function(){
try{
if(!clicked && unsafeWindow.grecaptcha && unsafeWindow.grecaptcha.getResponse().length > 0){
if(websiteDataValues.formSubmit){
document.querySelector(websiteDataValues.captchaButtonSubmitSelector).submit();
}else{
document.querySelector(websiteDataValues.captchaButtonSubmitSelector).click();
}
clicked = true;
clearInterval(captchaInterval);
setTimeout(function(){
if(messageSelectorsPresent()){
goToNextUrl();
}
},5000);
}
}catch(e){
}
for(var hc=0; hc < document.querySelectorAll("iframe").length; hc++){
if(! clicked && document.querySelectorAll("iframe")[hc] &&
document.querySelectorAll("iframe")[hc].hasAttribute("data-hcaptcha-response") &&
document.querySelectorAll("iframe")[hc].getAttribute("data-hcaptcha-response").length > 0) {
if(websiteDataValues.formSubmit){
document.querySelector(websiteDataValues.captchaButtonSubmitSelector).submit();
}else{
document.querySelector(websiteDataValues.captchaButtonSubmitSelector).click();
}
clicked = true;
clearInterval(captchaInterval);
setTimeout(function(){
if(messageSelectorsPresent()){
goToNextUrl();
}
},5000);
}
}
},5000);
},5000);
})();
/*
////////////////////////////////////////////////////////////////////////////////////
// ==UserScript==
// @name Recaptcha Solver (Automatically solves Recaptcha in browser)
// @namespace Recaptcha Solver
// @version 2.1
// @description Recaptcha Solver in Browser | Automatically solves Recaptcha in browser
// @author Banned
// @match *://*/recaptcha/*
// @connect engageub.pythonanywhere.com
// @connect engageub1.pythonanywhere.com
// @grant GM_xmlhttpRequest
// ==/UserScript==
(function() {
'use strict';
var solved = false;
var checkBoxClicked = false;
var waitingForAudioResponse = false;
//Node Selectors
const CHECK_BOX = ".recaptcha-checkbox-border";
const AUDIO_BUTTON = "#recaptcha-audio-button";
const PLAY_BUTTON = ".rc-audiochallenge-play-button .rc-button-default";
const AUDIO_SOURCE = "#audio-source";
const IMAGE_SELECT = "#rc-imageselect";
const RESPONSE_FIELD = ".rc-audiochallenge-response-field";
const AUDIO_ERROR_MESSAGE = ".rc-audiochallenge-error-message";
const AUDIO_RESPONSE = "#audio-response";
const RELOAD_BUTTON = "#recaptcha-reload-button";
const RECAPTCHA_STATUS = "#recaptcha-accessible-status";
const DOSCAPTCHA = ".rc-doscaptcha-body";
const VERIFY_BUTTON = "#recaptcha-verify-button";
const MAX_ATTEMPTS = 5;
var requestCount = 0;
var recaptchaLanguage = qSelector("html").getAttribute("lang");
var audioUrl = "";
var recaptchaInitialStatus = qSelector(RECAPTCHA_STATUS) ? qSelector(RECAPTCHA_STATUS).innerText : ""
var serversList = ["https://engageub.pythonanywhere.com","https://engageub1.pythonanywhere.com"];
var latencyList = Array(serversList.length).fill(10000);
//Check for visibility && Click the check box
function isHidden(el) {
return(el.offsetParent === null)
}
async function getTextFromAudio(URL) {
var minLatency = 100000;
var url = "";
//Selecting the last/latest server by default if latencies are equal
for(let k=0; k< latencyList.length;k++){
if(latencyList[k] <= minLatency){
minLatency = latencyList[k];
url = serversList[k];
}
}
requestCount = requestCount + 1;
URL = URL.replace("recaptcha.net", "google.com");
if(recaptchaLanguage.length < 1) {
console.log("Recaptcha Language is not recognized");
recaptchaLanguage = "en-US";
}
console.log("Recaptcha Language is " + recaptchaLanguage);
GM_xmlhttpRequest({
method: "POST",
url: url,
headers: {
"Content-Type": "application/x-www-form-urlencoded"
},
data: "input=" + encodeURIComponent(URL) + "&lang=" + recaptchaLanguage,
timeout: 60000,
onload: function(response) {
console.log("Response::" + response.responseText);
try {
if(response && response.responseText) {
var responseText = response.responseText;
//Validate Response for error messages or html elements
if(responseText == "0" || responseText.includes("<") || responseText.includes(">") || responseText.length < 2 || responseText.length > 50) {
//Invalid Response, Reload the captcha
console.log("Invalid Response. Retrying..");
} else if(qSelector(AUDIO_SOURCE) && qSelector(AUDIO_SOURCE).src && audioUrl == qSelector(AUDIO_SOURCE).src && qSelector(AUDIO_RESPONSE)
&& !qSelector(AUDIO_RESPONSE).value && qSelector(AUDIO_BUTTON).style.display == "none" && qSelector(VERIFY_BUTTON)) {
qSelector(AUDIO_RESPONSE).value = responseText;
qSelector(VERIFY_BUTTON).click();
} else {
console.log("Could not locate text input box")
}
waitingForAudioResponse = false;
}
} catch(err) {
console.log(err.message);
console.log("Exception handling response. Retrying..");
waitingForAudioResponse = false;
}
},
onerror: function(e) {
console.log(e);
waitingForAudioResponse = false;
},
ontimeout: function() {
console.log("Response Timed out. Retrying..");
waitingForAudioResponse = false;
},
});
}
async function pingTest(url) {
var start = new Date().getTime();
GM_xmlhttpRequest({
method: "GET",
url: url,
headers: {
"Content-Type": "application/x-www-form-urlencoded"
},
data: "",
timeout: 8000,
onload: function(response) {
if(response && response.responseText && response.responseText=="0") {
var end = new Date().getTime();
var milliseconds = end - start;
// For large values use Hashmap
for(let i=0; i< serversList.length;i++){
if (url == serversList[i]) {
latencyList[i] = milliseconds;
}
}
}
},
onerror: function(e) {
console.log(e);
},
ontimeout: function() {
console.log("Ping Test Response Timed out for " + url);
},
});
}
function qSelectorAll(selector) {
return document.querySelectorAll(selector);
}
function qSelector(selector) {
return document.querySelector(selector);
}
if(qSelector(CHECK_BOX)){
qSelector(CHECK_BOX).click();
} else if(window.location.href.includes("bframe")){
for(let i=0; i< serversList.length;i++){
pingTest(serversList[i]);
}
}
//Solve the captcha using audio
var startInterval = setInterval(function() {
try {
if(!checkBoxClicked && qSelector(CHECK_BOX) && !isHidden(qSelector(CHECK_BOX))) {
//console.log("checkbox clicked");
qSelector(CHECK_BOX).click();
checkBoxClicked = true;
}
//Check if the captcha is solved
if(qSelector(RECAPTCHA_STATUS) && (qSelector(RECAPTCHA_STATUS).innerText != recaptchaInitialStatus)) {
solved = true;
console.log("SOLVED");
clearInterval(startInterval);
}
if(requestCount > MAX_ATTEMPTS) {
console.log("Attempted Max Retries. Stopping the solver");
solved = true;
clearInterval(startInterval);
}
if(!solved) {
if(qSelector(AUDIO_BUTTON) && !isHidden(qSelector(AUDIO_BUTTON)) && qSelector(IMAGE_SELECT)) {
// console.log("Audio button clicked");
qSelector(AUDIO_BUTTON).click();
}
if((!waitingForAudioResponse && qSelector(AUDIO_SOURCE) && qSelector(AUDIO_SOURCE).src
&& qSelector(AUDIO_SOURCE).src.length > 0 && audioUrl == qSelector(AUDIO_SOURCE).src
&& qSelector(RELOAD_BUTTON)) ||
(qSelector(AUDIO_ERROR_MESSAGE) && qSelector(AUDIO_ERROR_MESSAGE).innerText.length > 0 && qSelector(RELOAD_BUTTON) &&
!qSelector(RELOAD_BUTTON).disabled)){
qSelector(RELOAD_BUTTON).click();
} else if(!waitingForAudioResponse && qSelector(RESPONSE_FIELD) && !isHidden(qSelector(RESPONSE_FIELD))
&& !qSelector(AUDIO_RESPONSE).value && qSelector(AUDIO_SOURCE) && qSelector(AUDIO_SOURCE).src
&& qSelector(AUDIO_SOURCE).src.length > 0 && audioUrl != qSelector(AUDIO_SOURCE).src
&& requestCount <= MAX_ATTEMPTS) {
waitingForAudioResponse = true;
audioUrl = qSelector(AUDIO_SOURCE).src
getTextFromAudio(audioUrl);
}else {
//Waiting
}
}
//Stop solving when Automated queries message is shown
if(qSelector(DOSCAPTCHA) && qSelector(DOSCAPTCHA).innerText.length > 0) {
console.log("Automated Queries Detected");
clearInterval(startInterval);
}
} catch(err) {
console.log(err.message);
console.log("An error occurred while solving. Stopping the solver.");
clearInterval(startInterval);
}
}, 5000);
})();
//////////////////////////////////////////////////////////////////////
*/