Greasy Fork is available in English.
input Email for automate faucet interactions
当前为
// ==UserScript==
// @name Keran and Bagi auto faucet
// @namespace auto faucet
// @version 0.2
// @description input Email for automate faucet interactions
// @author Ojo Ngono
// @match *://bagi.co.in/*
// @match *://keran.co/*
// @grant unsafeWindow
// @grant GM_getValue
// @grant GM_setValue
// @grant GM_addStyle
// @grant GM_xmlhttpRequest
// @grant window.onurlchange
// @grant GM_registerMenuCommand
// @require https://update.greasyfork.icu/scripts/439099/1203718/MonkeyConfig%20Modern%20Reloaded.js
// @license Copyright OjoNgono
// ==/UserScript==
(function() {
'use strict';
const cfg = new MonkeyConfig({
title: 'Bagi Keran Configuration',
menuCommand: true,
params: {
Email: {
label: "EmailFaucetpay",
type: "text",
default: ''
},
}
});
const email = cfg.get('Email');
let currentReferralId = '';
function determineSiteAndReferralId() {
if (window.location.href.includes('bagi.co.in')) {
currentReferralId = '65307';
} else if (window.location.href.includes('keran.co')) {
currentReferralId = '69657';
}
}
function onDocumentReady(fn) {
if (document.readyState !== "loading") {
fn();
} else {
document.addEventListener("DOMContentLoaded", fn);
}
}
function isAltchaChecked() {
const altchaCheckbox = document.getElementById('altcha_checkbox');
return altchaCheckbox && altchaCheckbox.checked;
}
function isReCAPTCHAChecked() {
const recaptchaCheckbox = document.querySelector('.g-recaptcha-response');
return recaptchaCheckbox && recaptchaCheckbox.value.trim().length > 0;
}
function clickCheckbox() {
const checkbox = document.querySelector('input[type="checkbox"]');
if (checkbox && !checkbox.checked) {
checkbox.click();
}
}
const interval = setInterval(() => {
if (document.querySelector('input[type="checkbox"]') !== null) {
clickCheckbox();
clearInterval(interval);
}
}, 2000);
function clickModalButton() {
let modalButton = document.querySelector("button[data-target='#myModal']");
if (modalButton) {
modalButton.click();
}
}
function clickSubmitButton() {
let submitButton = document.querySelector("button[type='submit']");
if (submitButton && isAltchaChecked()) {
submitButton.click();
}
}
function clickClaimNowButton() {
let buttons = document.querySelectorAll("button.button.is-info[type='submit']");
for (let button of buttons) {
if (button.textContent.trim() === 'Claim Now!') {
button.click();
return true;
}
}
return false;
}
function redirectToAlternateSite() {
if (window.location.href.includes('bagi.co.in')) {
window.location.href = 'https://keran.co';
} else if (window.location.href.includes('keran.co')) {
window.location.href = 'https://bagi.co.in';
}
}
onDocumentReady(function() {
determineSiteAndReferralId();
let login = setInterval(function() {
let card_md = document.querySelector("#myModal.is-active");
let emailfield = document.querySelector("input[type='email']");
let button = document.querySelector("button[type='submit']");
if (card_md && emailfield && emailfield.value !== email) {
emailfield.value = email;
}
if (emailfield.value === email && isReCAPTCHAChecked()) {
button.click();
clearInterval(login);
}
}, 5000);
if (window.location.href.includes('captha')) {
let claim = setInterval(function() {
clickModalButton();
clickSubmitButton();
if (document.querySelector("button[type='submit']")) {
setTimeout(function() { window.location.reload(); }, 50000);
clearInterval(claim);
}
}, 5000);
let claim2 = setInterval(function() {
let altcha = document.querySelector("input[name='cf-altcha-response']");
clickModalButton();
clickSubmitButton();
if (document.querySelector("button[type='submit']") && altcha && altcha.value.length > 0) {
setTimeout(function() { window.location.reload(); }, 60000);
clearInterval(claim2);
}
}, 5000);
}
if (window.location.href.includes('faucet')) {
setTimeout(function() {
if (!clickClaimNowButton()) {
redirectToAlternateSite();
}
setTimeout(function() { window.location.reload(); }, 60000);
}, 5000);
setTimeout(function refresh() {
window.location.reload();
}, 600000 + Math.floor(Math.random() * 60000) + 20000); // Set a fixed interval of 10 minutes
}
if (window.location.href.includes('dashboard')) {
setTimeout(function() {
location.href = 'faucet.php';
}, 5000);
}
if (window.location.href === 'https://bagi.co.in' || window.location.href === 'https://bagi.co.in/' || window.location.href === 'https://bagi.co.in/index.php') {
setTimeout(function() {
if (location.search !== `?ref=65307`) {
location.search = `?ref=65307`;
}
}, 2000);
} else if (window.location.href === 'https://keran.co' || window.location.href === 'https://keran.co/' || window.location.href === 'https://keran.co/index.php') {
setTimeout(function() {
if (location.search !== `?ref=69657`) {
location.search = `?ref=69657`;
}
}, 2000);
}
setTimeout(function() {
let alertMsg = document.querySelector("div.message-body");
if (alertMsg && alertMsg.innerText.includes("was sent")) {
location.reload();
}
}, 5000);
});
})();