FAUCET 2 2023

Script to claim faucets

此脚本不应直接安装。它是供其他脚本使用的外部库,要使用该库请加入元指令 // @require https://update.gf.qytechs.cn/scripts/457181/1132094/FAUCET%202%202023.js

  1. // ==UserScript==
  2. // @name FAUCET 2 2023
  3. // @namespace AUTOROTATORFAUCET
  4. // @version 1.0
  5. // @description Script to claim faucets
  6. // @author Saputra
  7. // @match https://coinadster.com/*
  8. // @match https://faucetsfly.com/*
  9. // @match https://bitdaddy.cash/*
  10. // @match https://claimlite.club/*
  11. // @connect claimlite.club
  12. // @connect bitdaddy.cash
  13. // @connect faucetsfly.com
  14. // @connect coinadster.com
  15. // @grant GM_xmlhttpRequest
  16. // @license MIT
  17. // ==/UserScript==
  18. (function() {
  19. 'use strict';
  20. const valdelay = 5 ; // Change the number from 5 to 10 or 20 if you have issues like Your action marked Suspicious,Don't try to bypass ,Don't use Speedster, etc
  21. const valbwall = 5 ; // if you have any other problem apart from bitswall , please leave your feedback
  22. const RexBp = new RegExp(/^\?([^&]+)/);
  23. const bp = query => document.querySelector(query);
  24. const elementExists = query => bp(query) !== null;
  25. const domainCheck = domains => new RegExp(domains).test(location.host);
  26. function click(query) {bp(query).click();}
  27. function submit(query) {bp(query).submit();}
  28. function clickIfElementExists(query, timeInSec = 1, funcName = 'setTimeout') {if (elementExists(query)) {window[funcName](function() {click(query);}, timeInSec * 1000);}}
  29. function Captchasub(query, act = 'submit', timeInSec = 0.5) {if (elementExists(query)) {var timer = setInterval(function() {if (window.grecaptcha && !!window.grecaptcha.getResponse?.()) {bp(query)[act](); clearInterval(timer);}}, timeInSec * 1000);}}
  30. function Captchaklik(query, act = 'click', timeInSec = 1) {if (elementExists(query)) {var timer = setInterval(function() {if (window.grecaptcha && !!window.grecaptcha.getResponse?.()) {bp(query)[act](); clearInterval(timer);}}, timeInSec * 1000);}}
  31. //Block All Pop ups
  32. unsafeWindow.open = function(){};
  33. //List of the faucet websites
  34. //Comment the lines of url if you don't use them
  35. var websiteData = [
  36. {url : "https://coinadster.com/faucetz.html"},
  37. {url : "https://faucetsfly.com/roll.html"},
  38. {url : "https://bitdaddy.cash/"},
  39. {url : "https://claimlite.club/"},
  40. ];
  41. //Message selectors are for success or failure to move on to the next website
  42. //Add only domain name in website as mentioned below. Follow the same pattern.
  43. //Use arrays wherever it is required
  44. var websiteMap = [
  45. {website : ["faucetsfly.com","bitdaddy.cash"],
  46. defaultButtonSelectors: ["#claimFaucet > button"],
  47. toggleCaptchaSelector:[".form-control.form-control-sm.custom-select.mb-1"],
  48. toggleCaptchaSelectorIndex: 0,
  49. captchaButtonSubmitSelector: "#claimFaucet .btn.btn-danger.btn-md.w-100.mt-2",
  50. allMessageSelectors: [".alert.alert-success",".alert.alert-danger"],
  51. messagesToCheckBeforeMovingToNextUrl: ["can claim again","you won"],
  52. timeoutbeforeMovingToNextUrl: 140000},
  53. {website : ["coinadster.com"],
  54. defaultButtonSelectors: ["#claymFaucet > button"],
  55. toggleCaptchaSelector:["#toggle22Captcha"],
  56. toggleCaptchaSelectorIndex: 1,
  57. captchaButtonSubmitSelector: "#rollFaucet > button",
  58. allMessageSelectors: [".alert.alert-success",".alert.alert-danger"],
  59. messagesToCheckBeforeMovingToNextUrl: ["can claim again","you won"],
  60. timeoutbeforeMovingToNextUrl: 140000},
  61.  
  62. {website : ["claimlite.club"],
  63. defaultButtonSelectors: [".card-body.py-3.px-1 .btn.btn-danger.btn-md.w-50.mt-2"],
  64. toggleCaptchaSelector:[".form-control.form-control-sm.custom-select.mb-1"],
  65. toggleCaptchaSelectorIndex: 0,
  66. captchaButtonSubmitSelector: "#claimFaucet .btn.btn-danger.btn-md.w-50.mt-2",
  67. allMessageSelectors: [".alert.alert-success",".alert.alert-danger"],
  68. messagesToCheckBeforeMovingToNextUrl: ["can claim again", "You can claim again in", "you won"],
  69. timeoutbeforeMovingToNextUrl: 140000},
  70. ];
  71. //HtmlEvents dispatcher
  72. function triggerEvent(el, type) {
  73. try{
  74. var e = document.createEvent('HTMLEvents');
  75. e.initEvent(type, false, true);
  76. el.dispatchEvent(e);
  77. }catch(exception){
  78. console.log(exception);
  79. }
  80. }
  81. function toggleCaptcha(selector, index){
  82. if( document.querySelector(selector)){
  83. document.querySelector(selector).selectedIndex = index;
  84. var targetNode = document.querySelector(selector);
  85. if (targetNode) {
  86. setTimeout(function() {
  87. triggerEvent(targetNode, 'change');
  88. }, 5000);
  89. }
  90. }
  91. }
  92. //Check if a string is present in Array
  93. String.prototype.includesOneOf = function(arrayOfStrings) {
  94. //If this is not an Array, compare it as a String
  95. if (!Array.isArray(arrayOfStrings)) {
  96. return this.toLowerCase().includes(arrayOfStrings.toLowerCase());
  97. }
  98. for (var i = 0; i < arrayOfStrings.length; i++) {
  99. if (this.toLowerCase().includes(arrayOfStrings[i].toLowerCase())) {
  100. return true;
  101. }
  102. }
  103. return false;
  104. }
  105. var websiteDataValues = {};
  106. var clicked = false;
  107. //Get selector details from the websiteMap
  108. for (let value of Object.values(websiteMap)) {
  109. if(window.location.href.includesOneOf(value.website)){
  110. websiteDataValues.inputTextSelector= value.inputTextSelector;
  111. websiteDataValues.inputTextSelectorButton = value.inputTextSelectorButton;
  112. websiteDataValues.defaultButtonSelectors = value.defaultButtonSelectors;
  113. websiteDataValues.claimButtonSelector = value.claimButtonSelector;
  114. websiteDataValues.captchaButtonSubmitSelector = value.captchaButtonSubmitSelector;
  115. websiteDataValues.loginSelectors = value.loginSelectors;
  116. websiteDataValues.allMessageSelectors = value.allMessageSelectors;
  117. websiteDataValues.messagesToCheckBeforeMovingToNextUrl = value.messagesToCheckBeforeMovingToNextUrl;
  118. websiteDataValues.withdrawPageUrl = value.withdrawPageUrl;
  119. websiteDataValues.withdrawEnabled = value.withdrawEnabled;
  120. websiteDataValues.balanceSelector = value.balanceSelector;
  121. websiteDataValues.withdrawMinAmount = value.withdrawMinAmount;
  122. websiteDataValues.successMessageSelectors = value.successMessageSelectors;
  123. websiteDataValues.toggleCaptchaSelector = value.toggleCaptchaSelector;
  124. websiteDataValues.toggleCaptchaSelectorIndex = value.toggleCaptchaSelectorIndex;
  125. websiteDataValues.timeoutbeforeMovingToNextUrl = value.timeoutbeforeMovingToNextUrl;
  126. websiteDataValues.additionalFunctions = value.additionalFunctions;
  127. break;
  128. }
  129. }
  130. //Identify which coin to input, based on the url input
  131. //If the URL does not contain the coin, then use the default from the domain name
  132. var count = 0;
  133. var addressAssigned = false;
  134. for (let value of Object.values(websiteData)) {
  135. count = count + 1;
  136. if(window.location.href.includes("/" + value.regex)){
  137. addressAssigned = true;
  138. break;
  139. }
  140. }
  141. //If URL does not have coin, check the default from the domain name
  142. if(!addressAssigned){
  143. count = 0;
  144. for (let value of Object.values(websiteData)) {
  145. count = count + 1;
  146. if(value.url.includes(window.location.hostname)){
  147. break;
  148. }
  149. }
  150. }
  151. //Get the next Url from the website data map
  152. async function getNextUrl(){
  153. //Go to the beginning if the end of the array is reached
  154. if(count >= websiteData.length){
  155. count = 0;
  156. websiteDataValues.nextUrl = websiteData[count].url;
  157. }else{
  158. websiteDataValues.nextUrl = websiteData[count].url;
  159. }
  160. //Ping Test to check if a website is up before proceeding to next url
  161. pingTest(websiteDataValues.nextUrl);
  162. }
  163. var isNextUrlReachable = false;
  164. //Get the next Url from the website
  165. function pingTest(websiteUrl) {
  166. console.log(websiteUrl);
  167. GM_xmlhttpRequest({
  168. method: "GET",
  169. url: websiteUrl,
  170. headers: {
  171. "Content-Type": "application/x-www-form-urlencoded"
  172. },
  173. timeout: 5000,
  174. onload: function(response) {
  175. //Website is reachable
  176. isNextUrlReachable = true;
  177. },
  178. onerror: function(e) {
  179. count=count+1;
  180. getNextUrl();
  181. },
  182. ontimeout: function() {
  183. count=count+1;
  184. getNextUrl();
  185. },
  186. });
  187. }
  188. async function delay(ms) {
  189. return new Promise(resolve => setTimeout(resolve, ms))
  190. }
  191. var movingToNextUrl = false;
  192. async function goToNextUrl() {
  193. console.log("Going to next Url");
  194. if(!movingToNextUrl){
  195. movingToNextUrl = true;
  196. getNextUrl();
  197. while (!isNextUrlReachable) {
  198. await delay(3000);
  199. }
  200. window.location.href = websiteDataValues.nextUrl;
  201. }
  202. }
  203. async function goToWithdrawPage() {
  204. if(!movingToNextUrl){
  205. movingToNextUrl = true;
  206. window.location.href = websiteDataValues.withdrawPageUrl;
  207. }
  208. }
  209. //Default Setting: After 180 seconds go to next Url
  210. var delayBeforeMovingToNextUrl = 180000;
  211. if(websiteDataValues.timeoutbeforeMovingToNextUrl){
  212. delayBeforeMovingToNextUrl = websiteDataValues.timeoutbeforeMovingToNextUrl;
  213. }
  214. setTimeout(function(){
  215. goToNextUrl();
  216. },delayBeforeMovingToNextUrl);
  217. //Returns true if message selectors are present
  218. function messageSelectorsPresent(){
  219. if(websiteDataValues.allMessageSelectors){
  220. for(var j=0;j<websiteDataValues.allMessageSelectors.length;j++){
  221. for(var k=0; k< document.querySelectorAll(websiteDataValues.allMessageSelectors[j]).length;k++){
  222. if(document.querySelectorAll(websiteDataValues.allMessageSelectors[j])[k] &&
  223. (document.querySelectorAll(websiteDataValues.allMessageSelectors[j])[k].innerText.includesOneOf(websiteDataValues.messagesToCheckBeforeMovingToNextUrl) ||
  224. (document.querySelectorAll(websiteDataValues.allMessageSelectors[j])[k].value &&
  225. document.querySelectorAll(websiteDataValues.allMessageSelectors[j])[k].value.includesOneOf(websiteDataValues.messagesToCheckBeforeMovingToNextUrl)))){
  226. return true;
  227. }
  228. }
  229. }
  230. }
  231. return false;
  232. }
  233. //Returns true if message selectors are present
  234. function successMessageSelectorsPresent(){
  235. if(websiteDataValues.successMessageSelectors){
  236. for(var j=0;j<websiteDataValues.successMessageSelectors.length;j++){
  237. for(var k=0; k< document.querySelectorAll(websiteDataValues.successMessageSelectors[j]).length;k++){
  238. if(document.querySelectorAll(websiteDataValues.successMessageSelectors[j])[k] && document.querySelectorAll(websiteDataValues.successMessageSelectors[j])[k].innerText.includesOneOf(websiteDataValues.messagesToCheckBeforeMovingToNextUrl)){
  239. return true;
  240. }
  241. }
  242. }
  243. }
  244. return false;
  245. }
  246. function minijobwork(){
  247. if( document.querySelector("#count") && document.querySelector("#count").style.display != 'none') {
  248. websiteDataValues.messagesToCheckBeforeMovingToNextUrl = [":"];
  249. }
  250. }
  251. function qashbit(){
  252. if(document.querySelector("#dropdownList")){
  253. document.querySelector("#dropdownList").click();
  254. }
  255. if(document.querySelector("#claim div.modal-body > div.ad_box center li > a") &&
  256. document.querySelector("#claim div.modal-body > div.ad_box center li > a").innerText == "reCAPTCHA"){
  257. document.querySelector("#claim div.modal-body > div.ad_box center li > a").click()
  258. }
  259. }
  260. setTimeout(function(){
  261. if( websiteDataValues.additionalFunctions){
  262. websiteDataValues.additionalFunctions();
  263. }
  264. if(websiteDataValues.withdrawEnabled){
  265. if(websiteDataValues.balanceSelector && document.querySelector(websiteDataValues.balanceSelector)){
  266. var currentBalance = document.querySelector(websiteDataValues.balanceSelector).innerText;
  267. if(currentBalance > websiteDataValues.withdrawMinAmount && !window.location.href.includes(websiteDataValues.withdrawPageUrl)) {
  268. goToWithdrawPage();
  269. }
  270. }else{
  271. if(successMessageSelectorsPresent()){
  272. goToWithdrawPage();
  273. }
  274. }
  275. }
  276. //Look for all the default messages or errors before proceeding to next url
  277. //For other languages difference in the length of the strings can be compared or visibility of the style element
  278. if(!movingToNextUrl && messageSelectorsPresent()){
  279. goToNextUrl();
  280. }
  281. //Check for all the default button selectors and click
  282. //This will only click the first selector found, so mention the selectors with parent element wherever required
  283. if(!movingToNextUrl && websiteDataValues.defaultButtonSelectors){
  284. for(var i=0;i<websiteDataValues.defaultButtonSelectors.length ;i++){
  285. if(document.querySelector(websiteDataValues.defaultButtonSelectors[i])){
  286. triggerEvent(document.querySelector(websiteDataValues.defaultButtonSelectors[i]), 'mousedown');
  287. triggerEvent(document.querySelector(websiteDataValues.defaultButtonSelectors[i]), 'mouseup');
  288. document.querySelector(websiteDataValues.defaultButtonSelectors[i]).click();
  289. break;
  290. }
  291. }
  292. }
  293. if(!movingToNextUrl && websiteDataValues.toggleCaptchaSelector && Number.isInteger(websiteDataValues.toggleCaptchaSelectorIndex)){
  294. toggleCaptcha(websiteDataValues.toggleCaptchaSelector,websiteDataValues.toggleCaptchaSelectorIndex);
  295. }
  296. //Input the address and click the login button
  297. if(!movingToNextUrl && document.querySelector(websiteDataValues.inputTextSelector)){
  298. document.querySelector(websiteDataValues.inputTextSelector).value = websiteDataValues.address;
  299. setTimeout(function(){
  300. if(websiteDataValues.inputTextSelectorButton && document.querySelector(websiteDataValues.inputTextSelectorButton)){
  301. document.querySelector(websiteDataValues.inputTextSelectorButton).click();
  302. }
  303. },5000);
  304. }
  305. // Captcha Mode
  306. // ============================================
  307. let captchaMode = ['#_mform', '#userForm', '#link-view', '#frmprotect', '#ShortLinkId', '#captcha', '#submit-form', '#lview > form', '#file-captcha', '#btget > form', 'div#login form', 'F1', '#short-captcha-form', '#wpsafelink-landing', '.col-12 > form:nth-child(1)', '.col-md-4 > form:nth-child(1)', '.col-md-6 > form:nth-child(4)', '.contenido > form:nth-child(2)', '#main > div:nth-child(4) > form:nth-child(1)', 'div.col-md-12:nth-child(3) > form:nth-child(1)', '.content > div:nth-child(4) > form:nth-child(1)', '#showMe > center:nth-child(4) > form:nth-child(1)', '.sect > div:nth-child(1) > center:nth-child(7) > form:nth-child(1)', '#showMe > center:nth-child(1) > center:nth-child(4) > form:nth-child(1)', '#adb-not-enabled > div:nth-child(1) > div:nth-child(1) > div:nth-child(1) > div:nth-child(1) > div:nth-child(5) > form:nth-child(1)', 'button#continue.btn.btn-primary.btn-captcha', '.m-2.btn-captcha.btn-outline-primary.btn', '#yuidea-btn-before.yu-btn.yu-blue', '#yuidea-btn-after.yu-blue.yu-btn', '#fauform'];
  308. for (let i = 0; i < captchaMode.length; i++) {Captchasub(captchaMode[i]);}
  309. let klikMode = ['button#continue.btn.btn-primary.btn-captcha', '.m-2.btn-captcha.btn-outline-primary.btn', '#yuidea-btn-before.yu-btn.yu-blue', '#yuidea-btn-after.yu-blue.yu-btn', '#submitBtn'];
  310. for (let i = 0; i < klikMode.length; i++) {Captchaklik(klikMode[i]);}
  311. //Click the form button after solving captcha
  312. //Works for both recaptcha and hcaptcha
  313. var captchaInterval = setInterval(function(){
  314. try{
  315. if(!clicked && unsafeWindow.grecaptcha && unsafeWindow.grecaptcha.getResponse().length > 0){
  316. document.querySelector(websiteDataValues.captchaButtonSubmitSelector).click();
  317. clicked = true;
  318. clearInterval(captchaInterval);
  319. setTimeout(function(){
  320. if(messageSelectorsPresent()){
  321. goToNextUrl();
  322. }
  323. },5000);
  324. }
  325. }catch(e){
  326. }
  327. for(var hc=0; hc < document.querySelectorAll("iframe").length; hc++){
  328. if(! clicked && document.querySelectorAll("iframe")[hc] &&
  329. document.querySelectorAll("iframe")[hc].hasAttribute("data-hcaptcha-response") &&
  330. document.querySelectorAll("iframe")[hc].getAttribute("data-hcaptcha-response").length > 0) {
  331. document.querySelector(websiteDataValues.captchaButtonSubmitSelector).click();
  332. clicked = true;
  333. clearInterval(captchaInterval);
  334. setTimeout(function(){
  335. if(messageSelectorsPresent()){
  336. goToNextUrl();
  337. }
  338. },5000);
  339. }
  340. }
  341. },5000);
  342. },7000);
  343. })();

QingJ © 2025

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