Auto BTC Rotator with PTC Support

auto faucets

  1. // ==UserScript==
  2. // @name Auto BTC Rotator with PTC Support
  3. // @namespace http://tampermonkey.net/
  4. // @version 0.5
  5. // @description auto faucets
  6. // @author vikiweb
  7. // @match https://btcadspace.com/*
  8. // @match https://easysatoshi.com/*
  9. // @match https://firefaucet.win/*
  10. // @icon https://www.google.com/s2/favicons?sz=64&domain=btcadspace.com
  11. // @grant GM_xmlhttpRequest
  12. // @grant GM_setValue
  13. // @grant GM_getValue
  14. // @license MIT
  15. // ==/UserScript==
  16.  
  17. (function() {
  18. 'use strict';
  19.  
  20. let sites = [
  21. {faucetUrl: "https://btcadspace.com/faucet", username: "", password: "", enableFaucet:true, faucetCaptcha:false},
  22. {faucetUrl: "https://easysatoshi.com/faucet", username: "", password: "", enableFaucet:true, faucetCaptcha:false},
  23. {faucetUrl: "https://firefaucet.win/faucet/", username: "", password: "",},
  24. ];
  25.  
  26. let sitesMap = [
  27. {
  28. websiteUrl:"https://btcadspace.com",
  29. homePageCheck : "body section.slider",
  30. claimPopupOpen : ".btn-primary.btn-lg",
  31. loginCaptchaCheck : true,
  32. surfSelectors:".card:not(.visited-link)",
  33. surfStartBtn:".card-body #box .start-btn",
  34. },
  35. {
  36. websiteUrl:"https://easysatoshi.com",
  37. homePageCheck : "body h1.display-5.fw-bold",
  38. claimPopupOpen : ".btn-primary.btn-lg",
  39. loginCaptchaCheck : true,
  40. surfSelectors:".container .row .col-lg-4 a:not(.opacity-50)",
  41. surfStartBtn:".container .row .start-btn",
  42. },
  43. {
  44. websiteUrl:"https://firefaucet.win",
  45. homePageCheck : "form[action='/login']",
  46. claimPopupOpen : "",
  47. loginCaptchaCheck : true,
  48. surfSelectors:".card.ptc-advert-card .watch-btn",
  49. surfStartBtn:".card-body #box .start-btn",
  50. additionalFunction : fireFaucet,
  51. },
  52. ]
  53.  
  54.  
  55. let check_address = window.location.origin;
  56. let currentFaucetUrl = new URL(window.location.href);
  57. let currentOrigin = currentFaucetUrl.origin;
  58. let currentIndex = sites.findIndex(site => site.faucetUrl.includes(currentOrigin));
  59. let websiteIndex = sitesMap.findIndex(website => website.websiteUrl.includes(currentOrigin));
  60. let oldfunction = unsafeWindow.open;
  61. let windowName = "";
  62. let interval = 1;
  63.  
  64. function movetonext() {
  65. if (currentIndex === sites.length - 1) {
  66. currentIndex = 0;
  67. console.log("All sites visited. Starting from 0 again.");
  68. } else {
  69. currentIndex++;
  70. }
  71. window.location.href = sites[currentIndex].faucetUrl;
  72. }
  73.  
  74. function checkWindow(params1, params2) {
  75. console.log(params1 + params2);
  76. if (!params2 || params2 == "_blank") {
  77. windowName = "popUpWindow";
  78. } else {
  79. windowName = params2;
  80. }
  81. console.log("WindowName is::" + windowName);
  82. return oldfunction(params1, windowName);
  83. };
  84.  
  85. function movetosurf() {
  86. window.location.href = check_address +'/surf'
  87. }
  88.  
  89. // Check if captcha is checked
  90. function isCaptchaChecked() {
  91. return grecaptcha && grecaptcha.getResponse().length !== 0;
  92. }
  93.  
  94. // Check if on faucet page and claim button is disabled
  95. function isFaucetClaimButtonDisabled(claimPopup) {
  96. return document.querySelector(claimPopup) && document.querySelector(claimPopup).disabled;
  97. }
  98.  
  99. // Check if on faucet page is fully claimed
  100. function isFaucetFullyClaimed() {
  101. return document.querySelector(".notyf-announcer") && document.querySelector(".notyf-announcer").innerText.includes('You reached the maximum')
  102. }
  103.  
  104. function visibleCheck(elm) {
  105. if(!elm.offsetHeight && !elm.offsetWidth) { return false; }
  106. if(getComputedStyle(elm).visibility === 'hidden') { return false; }
  107. return true;
  108. }
  109.  
  110. function websiteLogin(site){
  111. setInterval(function() {
  112. if (document.querySelector("#username")) {
  113. document.querySelector("#username").value = site.username;
  114. }
  115. if (document.querySelector("#password")) {
  116. document.querySelector("#password").value = site.password;
  117. }
  118. if (sitesMap[websiteIndex].loginCaptchaCheck){
  119. if (isCaptchaChecked()) {
  120. if (document.querySelector("button[type='submit']")) {
  121. document.querySelector("button[type='submit']").click();
  122. }
  123. }
  124. }else{
  125. if (document.querySelector("button[type='submit']")) {
  126. document.querySelector("button[type='submit']").click();
  127. }
  128. }
  129.  
  130. }, 6000);
  131. }
  132.  
  133. function fireFaucet(site) {
  134. if (document.querySelector(sitesMap[websiteIndex].homePageCheck)) {
  135. websiteLogin(site)
  136. }
  137.  
  138. if(document.querySelector(".dashboard-action-btns")){
  139. if(document.querySelector("[href='/daily']") && !document.querySelector("[href='/daily']").classList.contains('disabled')){
  140. document.querySelector("[href='/daily']").click();
  141. }else if(document.querySelector(".dashboard-action-btns [href='/faucet/']") && !document.querySelector(".dashboard-action-btns [href='/faucet/']").classList.contains('disabled')){
  142. document.querySelector(".dashboard-action-btns [href='/faucet/']").click();
  143. }else{
  144. movetonext()
  145. }
  146. }
  147.  
  148. if (window.location.href.includes(check_address +'/daily') || window.location.href.includes(check_address +'/faucet/')) {
  149. setInterval(function() {
  150. if (document.querySelector("button[type='submit']")) {
  151. if (isCaptchaChecked()) {
  152. document.querySelector("button[type='submit']").click();
  153. }
  154. }
  155. if(document.querySelector(".btn.earn-btns") && document.querySelector(".btn.earn-btns").innerText.includes("Continue") || document.querySelector(".btn.earn-btns").innerText.includes("Go Home")){
  156. document.querySelector(".btn.earn-btns").click();
  157. }
  158. }, 6000);
  159. }
  160. }
  161.  
  162. // Process current site
  163. function processSite(site) {
  164. if (sitesMap[websiteIndex].additionalFunction) {
  165. sitesMap[websiteIndex].additionalFunction(site);
  166. }else{
  167. if(document.querySelector(sitesMap[websiteIndex].homePageCheck) && (window.location.href.includes(check_address))) {
  168. window.location.replace(check_address + "/login");
  169. }
  170.  
  171. if (window.location.href.includes(check_address +'/login')) {
  172. console.log(sitesMap[websiteIndex], websiteIndex)
  173. websiteLogin(site)
  174. }
  175.  
  176. if(window.location.href.includes(check_address +'/account')) {
  177. if(site.enableFaucet){
  178. window.location.replace(check_address +'/faucet');
  179. }
  180. }
  181.  
  182.  
  183. if (window.location.href.includes(check_address +'/faucet')) {
  184.  
  185. let fauceClick = false;
  186.  
  187. setInterval(function() {
  188. if (document.querySelector(sitesMap[websiteIndex].claimPopupOpen) && fauceClick === false) {
  189. document.querySelector(sitesMap[websiteIndex].claimPopupOpen).click();
  190. fauceClick = true;
  191. }
  192. }, 5000);
  193.  
  194. setInterval(function() {
  195. if(document.querySelector("button[type='submit']")){
  196. if(site.faucetCaptcha == true){
  197. if (isCaptchaChecked()) {
  198. document.querySelector("button[type='submit']").click();
  199. }
  200. }else{
  201. document.querySelector("button[type='submit']").click();
  202. }
  203. }
  204. if(isFaucetFullyClaimed()){
  205. movetonext();
  206. }
  207. }, 5000);
  208. setInterval(function() {
  209. if (isFaucetClaimButtonDisabled(sitesMap[websiteIndex].claimPopupOpen) && site.enableSurf == true) {
  210. movetosurf()
  211. }else if(isFaucetClaimButtonDisabled(sitesMap[websiteIndex].claimPopupOpen)){
  212. movetonext()
  213. }
  214. }, interval * 60000);
  215. }
  216. }
  217. }
  218.  
  219. // Start processing the first site
  220. processSite(sites[currentIndex]);
  221. })();