Last active
August 31, 2024 00:33
-
-
Save bernaction/2018b751209bc246e1a177129ec25aa5 to your computer and use it in GitHub Desktop.
auto claim faucet
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // ==UserScript== | |
| // @name Autoclaim Faucet Nonkyc | |
| // @version 0.58 | |
| // @match https://nonkyc.io/faucet* | |
| // @author BernaCripto.com.br | |
| // @require http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js | |
| // @require https://gist.github.com/raw/2625891/waitForKeyElements.js | |
| // @grant none | |
| // @description Auto clicker faucet button on xeggex.com and nonkyc.io | |
| // ==/UserScript== | |
| (function () { | |
| 'use strict'; | |
| let checkInterval; | |
| let errorCheckInterval; | |
| // Função para enviar notificações | |
| function sendNotification(title, message) { | |
| if (Notification.permission === 'granted') { | |
| console.log('Enviando notificação...'); | |
| new Notification(title, { body: message }); | |
| } else if (Notification.permission !== 'denied') { | |
| Notification.requestPermission().then(permission => { | |
| if (permission === 'granted') { | |
| console.log('Permissão concedida, enviando notificação...'); | |
| new Notification(title, { body: message }); | |
| } else { | |
| console.log('Permissão para notificações foi negada.'); | |
| } | |
| }); | |
| } else { | |
| console.log('Permissão para notificações foi negada anteriormente.'); | |
| } | |
| } | |
| // Função para verificar se o usuário está deslogado | |
| function checkLoggedOut() { | |
| const logInLink = document.querySelector('a[href="/login"].d-none.d-sm-block'); | |
| if (logInLink) { | |
| console.log('Usuário deslogado, enviando notificação...'); | |
| sendNotification('Deslogado', 'Você foi deslogado do site.'); | |
| clearInterval(checkInterval); | |
| clearInterval(errorCheckInterval); | |
| observer.disconnect(); // Parar o observer | |
| } | |
| } | |
| // Função para clicar no botão claim | |
| function clickClaimButton() { | |
| var button = document.querySelector('button.btn.btn-sm.btn-success.makeclaim'); | |
| if (button) { | |
| button.click(); | |
| } | |
| } | |
| // Função para clicar no botão de erro e recarregar a página | |
| function clickErrorButton() { | |
| var errorButton = document.querySelector('button.swal-button.swal-button--confirm'); | |
| if (errorButton) { | |
| errorButton.click(); | |
| location.reload(); | |
| } | |
| } | |
| // Observer para mudanças na página | |
| const observer = new MutationObserver(() => { | |
| clickClaimButton(); | |
| clickErrorButton(); | |
| checkLoggedOut(); | |
| }); | |
| // Configura o observer para monitorar mudanças no corpo da página | |
| observer.observe(document.body, { childList: true, subtree: true }); | |
| // Verificar se o usuário está deslogado a cada 10 segundos | |
| checkInterval = setInterval(checkLoggedOut, 10000); // 10 segundos | |
| // Verificar e clicar no botão de erro a cada 1 minuto | |
| errorCheckInterval = setInterval(function () { | |
| clickErrorButton(); | |
| }, 60000); // 1 minuto | |
| // Recarregar a página após 10 minutos se o botão não estiver presente | |
| setInterval(function () { | |
| var button = document.querySelector('button.btn.btn-sm.btn-success.makeclaim'); | |
| if (!button) { | |
| console.log('Recarregando a página...') | |
| location.reload(); | |
| } | |
| }, 600000); // 10 minutos | |
| })(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment