Void Coin FreeBitco

https://freebitco.in/?r=1393623

目前为 2025-03-04 提交的版本。查看 最新版本

  1. // ==UserScript==
  2. // @name Void Coin FreeBitco
  3. // @namespace https://github.com/HaygoNunes/Script-FreeBTC
  4. // @namespace https://gf.qytechs.cn/en/users/1295753-hyago-nunes
  5. // @version 2.0
  6. // @description https://freebitco.in/?r=1393623
  7. // @author Sr.Fox / Hyago Nunes
  8. // @match https://freebitco.in/*
  9. // @match https://*/recaptcha/*
  10. // @match https://*.hcaptcha.com/*hcaptcha-challenge*
  11. // @match https://*.hcaptcha.com/*checkbox*
  12. // @match https://*.hcaptcha.com/*captcha*
  13. // @grant GM_getValue
  14. // @grant GM_setValue
  15. // @grant GM_registerMenuCommand
  16. // @grant GM_xmlhttpRequest
  17. // @update https://update.gf.qytechs.cn/scripts/493924/Void%20Coin%20FreeBitco.user.js
  18. // @license MIT
  19. // ==/UserScript==
  20.  
  21. (function () {
  22. 'use strict';
  23.  
  24. // UTILITÁRIOS BÁSICOS
  25. function qSelector(selector) { return document.querySelector(selector); }
  26. function isHidden(el) { return (el.offsetParent === null); }
  27. function random(min, max) { return min + (max - min) * Math.random(); }
  28.  
  29. // CONFIGURAÇÃO
  30. const CONFIG = {
  31. tentativasMaximas: 7,
  32. intervaloCaptcha: 3000,
  33. rollDelay: 7000,
  34. playWithoutCaptchaDelay: 12000,
  35. secondRollDelay: 14000,
  36. intervaloVerificacao: 1000,
  37. intervaloBackground: 30000,
  38. // Seletores para captchas e botões
  39. hcCheckBox: "#checkbox",
  40. hcAriaChecked: "aria-checked",
  41. rcCheckBox: ".recaptcha-checkbox-border",
  42. rcStatus: "#recaptcha-accessible-status",
  43. rcDosCaptcha: ".rc-doscaptcha-body",
  44. rollButton: "#free_play_form_button",
  45. playWithoutCaptchaButton: "#play_without_captchas_button",
  46. timerElement: "#time_remaining",
  47. // Cloudflare Turnstile
  48. cfIframeSelector: 'iframe[src*="challenges.cloudflare.com"]',
  49. cfResponseInput: "#cf-chl-widget-a1bva_response",
  50. cfSuccessSelector: "#success-i > circle",
  51. // 2Captcha (para resolver o Turnstile, se necessário)
  52. use2Captcha: true,
  53. turnstileSitekey: "a1bva",
  54. apiKey2Captcha: "Sua KEY_API do 2captcha"
  55. };
  56.  
  57. // ESTADO – persistência simples
  58. let state = {
  59. modoOperacao: 0, // 0 = Normal, 1 = Sem Captcha
  60. tentativas: 0,
  61. ultimaExecucao: 0
  62. };
  63.  
  64. function carregarEstado() {
  65. try {
  66. const saved = GM_getValue('stateFreeBTC');
  67. if (saved) state = Object.assign(state, JSON.parse(saved));
  68. } catch (e) { console.error(e); }
  69. }
  70. function salvarEstado() {
  71. try {
  72. GM_setValue('stateFreeBTC', JSON.stringify(state));
  73. } catch (e) { console.error(e); }
  74. }
  75.  
  76. // POPUP MANAGER
  77. const PopupManager = {
  78. fecharPopups() {
  79. ['.pushly_popover-container', '#onesignal-slidedown-container', '#notification_permission']
  80. .forEach(sel => { const el = qSelector(sel); if (el) el.style.display = 'none'; });
  81. }
  82. };
  83.  
  84. // CAPTCHAS – Soluções para Hcaptcha, Recaptcha e Cloudflare Turnstile
  85. function resolverHcaptcha() {
  86. if (window.location.href.includes("hcaptcha")) {
  87. const interval = setInterval(() => {
  88. const checkbox = qSelector(CONFIG.hcCheckBox);
  89. if (!checkbox) return;
  90. if (checkbox.getAttribute(CONFIG.hcAriaChecked) === "true") {
  91. clearInterval(interval);
  92. console.log("Hcaptcha resolvido");
  93. } else if (!isHidden(checkbox) && checkbox.getAttribute(CONFIG.hcAriaChecked) === "false") {
  94. checkbox.click();
  95. clearInterval(interval);
  96. console.log("Hcaptcha: abrindo checkbox");
  97. }
  98. }, Number(CONFIG.intervaloCaptcha));
  99. }
  100. }
  101. function resolverRecaptcha() {
  102. if (window.location.href.includes("recaptcha")) {
  103. setTimeout(() => {
  104. let initialStatus = qSelector(CONFIG.rcStatus) ? qSelector(CONFIG.rcStatus).innerText : "";
  105. try {
  106. if (qSelector(CONFIG.rcCheckBox) && !isHidden(qSelector(CONFIG.rcCheckBox))) {
  107. qSelector(CONFIG.rcCheckBox).click();
  108. console.log("Recaptcha: abrindo checkbox");
  109. }
  110. if (qSelector(CONFIG.rcStatus) && qSelector(CONFIG.rcStatus).innerText !== initialStatus) {
  111. console.log("Recaptcha resolvido");
  112. }
  113. if (qSelector(CONFIG.rcDosCaptcha) && qSelector(CONFIG.rcDosCaptcha).innerText.length > 0) {
  114. console.log("Recaptcha: consulta automatizada detectada");
  115. }
  116. } catch (err) { console.error(err.message); }
  117. }, Number(CONFIG.intervaloCaptcha));
  118. }
  119. }
  120. function resolverTurnstileClique() {
  121. const cfIframe = qSelector(CONFIG.cfIframeSelector);
  122. if (cfIframe && cfIframe.contentDocument) {
  123. const checkbox = cfIframe.contentDocument.querySelector('.mark');
  124. if (checkbox && !isHidden(checkbox)) {
  125. if (simularCliqueHumano(checkbox)) {
  126. console.log("Turnstile resolvido via clique");
  127. return true;
  128. }
  129. }
  130. }
  131. return false;
  132. }
  133. function resolverTurnstile2Captcha(callback) {
  134. const reqUrl = `http://2captcha.com/in.php?key=${CONFIG.apiKey2Captcha}&method=turnstile&sitekey=${CONFIG.turnstileSitekey}&pageurl=${encodeURIComponent(window.location.href)}&json=1`;
  135. console.log("Enviando requisição 2Captcha para Turnstile");
  136. GM_xmlhttpRequest({
  137. method: "GET",
  138. url: reqUrl,
  139. onload: function(response) {
  140. try {
  141. const data = JSON.parse(response.responseText);
  142. if (data.status === 1) {
  143. pollToken(data.request, callback);
  144. } else {
  145. console.error("2Captcha Error: " + data.request);
  146. callback(false);
  147. }
  148. } catch (e) {
  149. console.error(e); callback(false);
  150. }
  151. },
  152. onerror: function(err) { console.error(err); callback(false); }
  153. });
  154. }
  155. function pollToken(captchaId, callback) {
  156. const pollUrl = `http://2captcha.com/res.php?key=${CONFIG.apiKey2Captcha}&action=get&id=${captchaId}&json=1`;
  157. let attempts = 0;
  158. const pollInterval = setInterval(() => {
  159. attempts++;
  160. GM_xmlhttpRequest({
  161. method: "GET",
  162. url: pollUrl,
  163. onload: function(response) {
  164. try {
  165. const data = JSON.parse(response.responseText);
  166. if (data.status === 1) {
  167. clearInterval(pollInterval);
  168. const token = data.request;
  169. const input = qSelector(CONFIG.cfResponseInput);
  170. if (input) {
  171. input.value = token;
  172. console.log("Turnstile resolvido via 2Captcha");
  173. callback(true);
  174. } else {
  175. console.error("Input para Turnstile não encontrado");
  176. callback(false);
  177. }
  178. } else if (data.request !== "CAPCHA_NOT_READY") {
  179. clearInterval(pollInterval);
  180. console.error("Erro polling: " + data.request);
  181. callback(false);
  182. }
  183. } catch (e) { console.error(e); callback(false); }
  184. },
  185. onerror: function(err) { console.error(err); callback(false); }
  186. });
  187. if (attempts >= 24) {
  188. clearInterval(pollInterval);
  189. console.error("Timeout 2Captcha polling");
  190. callback(false);
  191. }
  192. }, 5000);
  193. }
  194.  
  195. // FUNÇÃO PARA SIMULAR CLIQUE HUMANO
  196. function simularCliqueHumano(elemento) {
  197. if (!elemento) return false;
  198. let sucesso = false;
  199. try {
  200. const rect = elemento.getBoundingClientRect();
  201. const x = rect.left + rect.width / 2;
  202. const y = rect.top + rect.height / 2;
  203. elemento.dispatchEvent(new MouseEvent('mousedown', { bubbles: true, cancelable: true, clientX: x, clientY: y }));
  204. elemento.dispatchEvent(new MouseEvent('mouseup', { bubbles: true, cancelable: true, clientX: x, clientY: y }));
  205. elemento.click();
  206. console.info("Clique simulado com MouseEvents");
  207. sucesso = true;
  208. } catch (e) { console.warn("MouseEvents falharam:", e); }
  209. if (!sucesso) {
  210. try {
  211. const rect = elemento.getBoundingClientRect();
  212. const x = rect.left + rect.width / 2;
  213. const y = rect.top + rect.height / 2;
  214. elemento.dispatchEvent(new PointerEvent('pointerdown', { bubbles: true, cancelable: true, clientX: x, clientY: y }));
  215. elemento.dispatchEvent(new PointerEvent('pointerup', { bubbles: true, cancelable: true, clientX: x, clientY: y }));
  216. elemento.click();
  217. console.info("Clique simulado com PointerEvents");
  218. sucesso = true;
  219. } catch (e) { console.warn("PointerEvents falharam:", e); }
  220. }
  221. if (!sucesso) {
  222. try {
  223. elemento.focus();
  224. elemento.click();
  225. console.info("Clique simulado com Focus + Click");
  226. sucesso = true;
  227. } catch (e) { console.error("Focus + Click falharam:", e); }
  228. }
  229. return sucesso;
  230. }
  231.  
  232. // GERENCIAMENTO DOS CAPTCHAS
  233. function gerenciarCaptcha() {
  234. if (window.location.href.includes("hcaptcha")) resolverHcaptcha();
  235. if (window.location.href.includes("recaptcha")) resolverRecaptcha();
  236. if (qSelector(CONFIG.cfIframeSelector)) {
  237. if (!resolverTurnstileClique() && CONFIG.use2Captcha) {
  238. resolverTurnstile2Captcha(function(success) {
  239. if (!success) console.error("Falha ao resolver Turnstile via 2Captcha");
  240. });
  241. }
  242. }
  243. }
  244.  
  245. // ACIONAMENTO DOS BOTÕES PLAY/ROLL
  246. function acionarRoll() {
  247. const btn = qSelector(CONFIG.rollButton);
  248. if (btn && !isHidden(btn)) { btn.click(); console.log("ROLL acionado"); }
  249. else console.warn("Botão ROLL não encontrado");
  250. }
  251. function acionarPlayWithoutCaptcha() {
  252. const btn = qSelector(CONFIG.playWithoutCaptchaButton);
  253. if (btn && !isHidden(btn)) { btn.click(); console.log("PLAY WITHOUT CAPTCHA acionado"); }
  254. else console.warn("Botão PLAY WITHOUT CAPTCHA não encontrado");
  255. }
  256.  
  257. // AÇÕES TEMPORIZADAS
  258. function iniciarAcoesTemporizadas() {
  259. setTimeout(acionarRoll, CONFIG.rollDelay);
  260. setTimeout(acionarPlayWithoutCaptcha, CONFIG.playWithoutCaptchaDelay);
  261. setTimeout(acionarRoll, CONFIG.secondRollDelay);
  262. }
  263.  
  264. // MONITORAMENTO DO TIMER
  265. function monitorarTimer() {
  266. setInterval(() => {
  267. const timer = qSelector(CONFIG.timerElement);
  268. if (timer && timer.textContent.trim().includes("00:00:00")) {
  269. console.log("Timer zerado – acionar ações");
  270. gerenciarCaptcha();
  271. iniciarAcoesTemporizadas();
  272. }
  273. }, 1000);
  274. }
  275.  
  276. // MONITORAMENTO VISUAL DO TIMER NO CONSOLE (formata com countdown_section se disponível)
  277. function monitorarTimerNoConsole() {
  278. let ultimoTempo = '';
  279. const formatarTempo = (elemento) => {
  280. const secoes = elemento.querySelectorAll('.countdown_section');
  281. if (secoes.length < 2) return null;
  282. const minutos = secoes[0].querySelector('.countdown_amount').textContent.padStart(2, '0');
  283. const segundos = secoes[1].querySelector('.countdown_amount').textContent.padStart(2, '0');
  284. return `${minutos}:${segundos}`;
  285. };
  286. const atualizarConsole = () => {
  287. const timer = qSelector(CONFIG.timerElement);
  288. if (timer && timer.offsetParent !== null) {
  289. const tempoFormatado = formatarTempo(timer);
  290. if (tempoFormatado && tempoFormatado !== ultimoTempo) {
  291. console.clear();
  292. console.log(`⏳ Timer: ${tempoFormatado}`);
  293. ultimoTempo = tempoFormatado;
  294. }
  295. } else {
  296. if (ultimoTempo !== 'oculto') {
  297. console.log(' Timer não visível');
  298. ultimoTempo = 'oculto';
  299. }
  300. }
  301. };
  302. setInterval(atualizarConsole, 1000);
  303. atualizarConsole();
  304. }
  305.  
  306. // CONTROLE DE VISIBILIDADE
  307. function configurarVisibilidade() {
  308. document.addEventListener('visibilitychange', () => {
  309. if (!document.hidden) {
  310. console.log("Retomando operação em primeiro plano");
  311.  
  312. } else {
  313. console.log("Modo segundo plano ativado");
  314. }
  315. });
  316. }
  317.  
  318. // AJUSTE DO PRELOAD DO CLOUDFLARE
  319. function ajustarPreloadCloudflare() {
  320. try {
  321. const link = document.querySelector('link[rel="preload"][href*="challenges.cloudflare.com/cdn-cgi/challenge-platform/h/g/cmg/1"]');
  322. if (link) {
  323. link.setAttribute('as', 'script');
  324. console.info("Atributo 'as' ajustado para 'script' no link de preload");
  325. }
  326. } catch (e) { console.error(e); }
  327. }
  328.  
  329. // HANDLERS GLOBAIS DE ERROS
  330. const IGNORED_PATTERNS = ["third-party cookies", "preloaded using link preload"];
  331. window.addEventListener('error', event => {
  332. try {
  333. if (event.message && IGNORED_PATTERNS.some(p => event.message.includes(p))) {
  334. event.preventDefault();
  335. return;
  336. }
  337. if (event.filename && event.filename.includes('challenges.cloudflare.com')) {
  338. console.warn("Erro do Cloudflare ignorado:", event.message);
  339. event.preventDefault();
  340. } else {
  341. console.error(event.message, event);
  342. }
  343. } catch (e) { console.error(e); }
  344. });
  345. window.addEventListener('unhandledrejection', event => {
  346. try {
  347. if (event.reason && event.reason.message && IGNORED_PATTERNS.some(p => event.reason.message.includes(p))) {
  348. event.preventDefault();
  349. return;
  350. }
  351. if (event.reason && event.reason.message && event.reason.message.includes('challenges.cloudflare.com')) {
  352. console.warn("Rejeição do Cloudflare ignorada:", event.reason.message);
  353. event.preventDefault();
  354. } else {
  355. console.error(event.reason);
  356. }
  357. } catch (e) { console.error(e); }
  358. });
  359.  
  360. // Polyfill para GM_getValue/GM_setValue se necessário
  361. if (typeof GM_getValue === 'undefined') {
  362. window.GM_getValue = key => JSON.parse(localStorage.getItem(key));
  363. window.GM_setValue = (key, value) => localStorage.setItem(key, JSON.stringify(value));
  364. }
  365.  
  366. // MENU DE CONTROLE
  367. GM_registerMenuCommand('Configurações do Script', () => {
  368. alert(`Modo: ${state.modoOperacao === 0 ? 'Normal' : 'Sem Captcha'}\nTentativas: ${state.tentativas}`);
  369. });
  370.  
  371. // INICIALIZAÇÃO
  372. function init() {
  373. carregarEstado();
  374. PopupManager.fecharPopups();
  375. monitorarTimer();
  376. monitorarTimerNoConsole();
  377. configurarVisibilidade();
  378. gerenciarCaptcha();
  379. iniciarAcoesTemporizadas();
  380. console.log("Script iniciado no Freebitco.in");
  381. }
  382.  
  383. window.addEventListener('load', () => {
  384. ajustarPreloadCloudflare();
  385. init();
  386. });
  387. })();

QingJ © 2025

镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址