Multi WEB PTC With AUTO Captcha

Multi PTC Cryptorotator

此脚本不应直接安装,它是一个供其他脚本使用的外部库。如果您需要使用该库,请在脚本元属性加入:// @require https://update.cn-greasyfork.org/scripts/457009/1132234/Multi%20WEB%20PTC%20With%20AUTO%20Captcha.js

  1. // ==UserScript==
  2. // @name Multi WEB PTC With AUTO Captcha
  3. // @namespace Multi WEB PTC With AUTO Captcha
  4. // @version 1.1
  5. // @description Multi PTC Cryptorotator
  6. // @author Saputra
  7. // @match //https://trxking.xyz/*
  8. // @match //https://bitsfree.net/*
  9. // @match //https://free.shiba.limited/*
  10. // @match //https://faucetoshi.com/*
  11. // @match //https://claimcoin.in/*
  12. // @connect //trxking.xyz
  13. // @connect //bitsfree.net
  14. // @connect //free.shiba.limited
  15. // @connect //faucetoshi.com
  16. // @connect //claimcoin.in
  17. // @connect //faucet4u.com
  18. // @noframes
  19. // @grant GM_xmlhttpRequest
  20. // @grant GM_setValue
  21. // @grant GM_getValue
  22.  
  23. // ==/UserScript==
  24. (function() {
  25.  
  26. 'use strict';
  27. window.alert = function() {};
  28. window.confirm = function() {};
  29.  
  30.  
  31. //Do not execute if window is a pop up
  32. if(window.name){
  33. return;
  34. }
  35.  
  36. var count = 0;
  37. var clicked = false;
  38.  
  39.  
  40. //Enter your login and password below, if you like to Autologin. Be careful while providing passwords,
  41. //else you may get your accounts locked
  42. var websiteData = [
  43.  
  44. {url : "https://trxking.xyz/ptc", login: "", password: ""},
  45. {url : "https://bitsfree.net/ptc", login: "", password: ""},
  46. {url : "https://free.shiba.limited/ptc", login: "", password: ""},
  47. {url : "https://faucetoshi.com/ptc", login: "", password: ""},
  48. {url : "https://claimcoin.in/ptc", login: "", password: ""},
  49. ];
  50.  
  51. var websiteMap = [{
  52.  
  53. website: "faucetoshi.com",
  54. defaultButtonSelectors: [".card-body .btn.btn-primary.btn-block.waves-effect"],
  55. loginSelectors: ["input[type=text]", "input[type=password]", "button[type=submit]"],
  56. captchaButtonSubmitSelector: ".modal-content .btn.btn-success.btn-block",
  57. allMessageSelectors: [".alert.alert-warning.text-center"],
  58. messagesToCheckBeforeMovingToNextUrl: ["There are currently no PTC ads available!"],
  59. additionalFunctions: grandcryptoauto,
  60. timeoutbeforeMovingToNextUrl: 50000
  61. },
  62.  
  63. {
  64. website: "metabitz.net",
  65. defaultButtonSelectors: [".card-body .btn.btn-primary.btn-block"],
  66. loginSelectors: ["input[type=text]", "input[type=password]", "button[type=submit]"],
  67. toggleCaptchaSelector:[".modal-body .form-control"],
  68. toggleCaptchaSelectorIndex: 1,
  69. captchaButtonSubmitSelector: [".btn.btn-success.btn-block", ".btn.btn-primary.btn-block"],
  70. allMessageSelectors: [".alert.alert-warning.text-center"],
  71. messagesToCheckBeforeMovingToNextUrl: ["There is PTC Ad left"],
  72. additionalFunctions: ptcfaucet,
  73. timeoutbeforeMovingToNextUrl: 120000
  74. },
  75.  
  76. {
  77. website: "trxking.xyz",
  78. defaultButtonSelectors: [".card-body .btn.btn-primary.btn-block"],
  79. loginSelectors: ["input[type=text]", "input[type=password]", "button[type=submit]"],
  80. captchaButtonSubmitSelector: [".btn.btn-success.btn-block"],
  81. allMessageSelectors: [".alert.alert-warning.text-center"],
  82. messagesToCheckBeforeMovingToNextUrl: ["There is PTC Ad left"],
  83. additionalFunctions: trxking,
  84. timeoutbeforeMovingToNextUrl: 120000
  85. },
  86.  
  87.  
  88. {
  89. website: ["claimcoin.in"],
  90. defaultButtonSelectors: [".card .btn.btn-success.btn-block"],
  91. loginSelectors: ["input[type=text]", "input[type=password]", "button[type=submit]"],
  92. captchaButtonSubmitSelector: [".btn.btn-success.btn-block"],
  93. allMessageSelectors: [".alert.alert-warning.text-center"],
  94. messagesToCheckBeforeMovingToNextUrl: ["There is PTC Ad left"],
  95. additionalFunctions: mad,
  96. timeoutbeforeMovingToNextUrl: 120000
  97. },
  98.  
  99. {
  100. website: ["bitsfree.net"],
  101. defaultButtonSelectors: [".card-body .btn.btn-primary.btn-block"],
  102. loginSelectors: ["input[type=text]", "input[type=password]", "button[type=submit]"],
  103. captchaButtonSubmitSelector: [".btn.btn-success.btn-block.btn-sm"],
  104. allMessageSelectors: [".alert.alert-warning.text-center"],
  105. messagesToCheckBeforeMovingToNextUrl: ["There is PTC Ad left"],
  106. additionalFunctions: mad,
  107. timeoutbeforeMovingToNextUrl: 120000
  108. },
  109.  
  110. {
  111. website: ["free.shiba.limited"],
  112. defaultButtonSelectors: [".card-body .btn.btn-primary.btn-block"],
  113. loginSelectors: ["input[type=text]", "input[type=password]", "button[type=submit]"],
  114. captchaButtonSubmitSelector: [".btn.btn-success.btn-block"],
  115. allMessageSelectors: [".alert.alert-warning.text-center"],
  116. messagesToCheckBeforeMovingToNextUrl: ["There is PTC Ad left"],
  117. additionalFunctions: mad,
  118. timeoutbeforeMovingToNextUrl: 750000
  119. },
  120.  
  121. {
  122. website: ["dogeclick.io"],
  123. timeoutbeforeMovingToNextUrl: 2000
  124. },
  125.  
  126. ];
  127.  
  128. //HtmlEvents dispatcher
  129. function triggerEvent(el, type) {
  130. try{
  131. var e = document.createEvent('HTMLEvents');
  132. e.initEvent(type, false, true);
  133. el.dispatchEvent(e);
  134. }catch(exception){
  135. console.log(exception);
  136. }
  137. }
  138.  
  139. function toggleCaptcha(selector, index){
  140. if( document.querySelector(selector)){
  141. document.querySelector(selector).selectedIndex = index;
  142. var targetNode = document.querySelector(selector);
  143. if (targetNode) {
  144. setTimeout(function() {
  145. triggerEvent(targetNode, 'change');
  146. }, 5000);
  147. }
  148. }
  149. }
  150.  
  151. //Check if a string is present in Array
  152. String.prototype.includesOneOf = function(arrayOfStrings) {
  153.  
  154. //If this is not an Array, compare it as a String
  155. if (!Array.isArray(arrayOfStrings)) {
  156. return this.toLowerCase().includes(arrayOfStrings.toLowerCase());
  157. }
  158.  
  159. for (var i = 0; i < arrayOfStrings.length; i++) {
  160. if (this.toLowerCase().includes(arrayOfStrings[i].toLowerCase())) {
  161. return true;
  162. }
  163. }
  164. return false;
  165. }
  166.  
  167. var websiteDataValues = {};
  168.  
  169. //Get selector details from the websiteMap
  170. for (let value of Object.values(websiteMap)) {
  171. if (window.location.href.includesOneOf(value.website)) {
  172. websiteDataValues.inputTextSelector = value.inputTextSelector;
  173. websiteDataValues.inputTextSelectorButton = value.inputTextSelectorButton;
  174. websiteDataValues.defaultButtonSelectors = value.defaultButtonSelectors;
  175. websiteDataValues.claimButtonSelector = value.claimButtonSelector;
  176. websiteDataValues.captchaButtonSubmitSelector = value.captchaButtonSubmitSelector;
  177. websiteDataValues.loginSelectors = value.loginSelectors;
  178. websiteDataValues.loginCaptcha = value.loginCaptcha;
  179. websiteDataValues.allMessageSelectors = value.allMessageSelectors;
  180. websiteDataValues.messagesToCheckBeforeMovingToNextUrl = value.messagesToCheckBeforeMovingToNextUrl;
  181. websiteDataValues.withdrawPageUrl = value.withdrawPageUrl;
  182. websiteDataValues.withdrawEnabled = value.withdrawEnabled;
  183. websiteDataValues.balanceSelector = value.balanceSelector;
  184. websiteDataValues.withdrawMinAmount = value.withdrawMinAmount;
  185. websiteDataValues.successMessageSelectors = value.successMessageSelectors;
  186. websiteDataValues.toggleCaptchaSelector = value.toggleCaptchaSelector;
  187. websiteDataValues.toggleCaptchaSelectorIndex = value.toggleCaptchaSelectorIndex;
  188. websiteDataValues.additionalFunctions = value.additionalFunctions;
  189. websiteDataValues.timeoutbeforeMovingToNextUrl = value.timeoutbeforeMovingToNextUrl;
  190. break;
  191. }
  192. }
  193.  
  194.  
  195. var login = "";
  196. var password = "";
  197.  
  198. for (let value of Object.values(websiteData)) {
  199. count = count + 1;
  200. if (value.url.includes(window.location.hostname)) {
  201. websiteDataValues.url = value.url;
  202. login = value.login;
  203. password = value.password;
  204. break;
  205. }
  206. }
  207.  
  208.  
  209. //Get the next Url from the website data map
  210. async function getNextUrl() {
  211.  
  212. //Go to the beginning if the end of the array is reached
  213. if (count >= websiteData.length) {
  214. websiteDataValues.nextUrl = websiteData[0].url;
  215. } else {
  216. websiteDataValues.nextUrl = websiteData[count].url;
  217. }
  218.  
  219. //Use case for overrding next Url
  220. if (websiteDataValues.overrideNextUrl) {
  221. websiteDataValues.nextUrl = websiteDataValues.overrideNextUrl;
  222. }
  223.  
  224. //Ping Test to check if a website is up before proceeding to next url
  225. pingTest(websiteDataValues.nextUrl);
  226. }
  227.  
  228. var isNextUrlReachable = false;
  229. //Get the next Url from the website
  230. function pingTest(websiteUrl) {
  231. console.log(websiteUrl);
  232. GM_xmlhttpRequest({
  233. method: "GET",
  234. url: websiteUrl,
  235. headers: {
  236. "Content-Type": "application/x-www-form-urlencoded"
  237. },
  238. timeout: 5000,
  239. onload: function(response) {
  240. //Website is reachable
  241. isNextUrlReachable = true;
  242. },
  243. onerror: function(e) {
  244. count = count + 1;
  245. getNextUrl();
  246. },
  247. ontimeout: function() {
  248. count = count + 1;
  249. getNextUrl();
  250. },
  251. });
  252.  
  253. }
  254.  
  255.  
  256. async function delay(ms) {
  257. return new Promise(resolve => setTimeout(resolve, ms))
  258. }
  259.  
  260.  
  261. var movingToNextUrl = false;
  262. async function goToNextUrl() {
  263. if (!movingToNextUrl) {
  264. movingToNextUrl = true;
  265. getNextUrl();
  266. while (!isNextUrlReachable) {
  267. await delay(3000);
  268. }
  269. window.location.href = websiteDataValues.nextUrl;
  270. }
  271. }
  272.  
  273.  
  274. //Default Setting: After 1000 seconds go to next Url
  275. var delayBeforeMovingToNextUrl = 1000000;
  276. if (websiteDataValues.timeoutbeforeMovingToNextUrl) {
  277. delayBeforeMovingToNextUrl = websiteDataValues.timeoutbeforeMovingToNextUrl;
  278. }
  279.  
  280. setTimeout(function() {
  281. goToNextUrl();
  282. }, delayBeforeMovingToNextUrl);
  283.  
  284.  
  285. //Wait for 5 seconds if it's in dashboard,
  286. if ((!window.location.href.includes("coinpayu")) && (window.location.href.includes("dashboard") || window.location.href.includes("page/user-admin"))) {
  287. setTimeout(function() {
  288. if (websiteDataValues.url) {
  289. window.location.href = websiteDataValues.url;
  290. }
  291. }, 5000);
  292. }
  293.  
  294.  
  295. //Returns true if message selectors are present
  296. function messageSelectorsPresent() {
  297. if (websiteDataValues.allMessageSelectors) {
  298. for (var j = 0; j < websiteDataValues.allMessageSelectors.length; j++) {
  299. for (var k = 0; k < document.querySelectorAll(websiteDataValues.allMessageSelectors[j]).length; k++) {
  300. if (document.querySelectorAll(websiteDataValues.allMessageSelectors[j])[k] &&
  301. (document.querySelectorAll(websiteDataValues.allMessageSelectors[j])[k].innerText.includesOneOf(websiteDataValues.messagesToCheckBeforeMovingToNextUrl) ||
  302. (document.querySelectorAll(websiteDataValues.allMessageSelectors[j])[k].value &&
  303. document.querySelectorAll(websiteDataValues.allMessageSelectors[j])[k].value.includesOneOf(websiteDataValues.messagesToCheckBeforeMovingToNextUrl)))) {
  304. return true;
  305. }
  306. }
  307. }
  308. }
  309. return false;
  310. }
  311.  
  312. function closeRepeatingAds() {
  313.  
  314. //Check if previous Ad is Same as Current Ad and Skip the Ad
  315. if (unsafeWindow.viewurl) {
  316. if (GM_getValue("adUrl") && GM_getValue("adUrl") == unsafeWindow.viewurl) {
  317. //Skip the Ad
  318. document.querySelector(".card > a").click();
  319. movingToNextUrl = true;
  320. } else {
  321. GM_setValue("adUrl", unsafeWindow.viewurl);
  322. }
  323.  
  324. }
  325.  
  326. }
  327.  
  328.  
  329.  
  330. function grandcryptoauto() {
  331.  
  332. //Block Pop Ups
  333. unsafeWindow.open = function(){};
  334.  
  335. if(document.querySelector("body").innerText.includes("This ad does not exist or has expired")){
  336. window.location.href = "https://faucetoshi.com/ptc/";
  337. }
  338.  
  339. }
  340.  
  341. function ptcfaucet() {
  342.  
  343. //Block Pop Ups
  344. unsafeWindow.open = function(){};
  345.  
  346. if(document.querySelector("body").innerText.includes("This ad does not exist or has expired")){
  347. window.location.href = "https://ptcfaucet.xyz/ptc/";
  348. }
  349.  
  350. }
  351.  
  352. function metabitz() {
  353.  
  354. //Block Pop Ups
  355. unsafeWindow.open = function(){};
  356.  
  357. if(document.querySelector("body").innerText.includes("This ad does not exist or has expired")){
  358. window.location.href = "https://metabitz.net/ptc/";
  359. }
  360.  
  361. }
  362.  
  363. function dinntoks() {
  364.  
  365. //Block Pop Ups
  366. unsafeWindow.open = function(){};
  367.  
  368. if(document.querySelector("body").innerText.includes("This ad does not exist or has expired")){
  369. window.location.href = "https://dinntoks.com/ptc/";
  370. }
  371.  
  372. }
  373.  
  374. function paidsatoshi() {
  375.  
  376. //Block Pop Ups
  377. unsafeWindow.open = function(){};
  378.  
  379. if(document.querySelector("body").innerText.includes("This ad does not exist or has expired")){
  380. window.location.href = "https://https://paidsatoshi.com/surfads.php/";
  381. }
  382.  
  383. }
  384.  
  385. function adbtc() {
  386.  
  387. //Block Pop Ups
  388. unsafeWindow.open = function(){};
  389.  
  390. if(document.querySelector("body").innerText.includes("This ad does not exist or has expired")){
  391. window.location.href = "https://adbtc.io/surf/";
  392. }
  393.  
  394. }
  395.  
  396. function trxking() {
  397.  
  398. //Block Pop Ups
  399. unsafeWindow.open = function(){};
  400.  
  401. if(document.querySelector("body").innerText.includes("This ad does not exist or has expired")){
  402. window.location.href = "https://trxking.xyz/ptc/";
  403. }
  404.  
  405. }
  406.  
  407. function speedcoins() {
  408.  
  409. //Block Pop Ups
  410. unsafeWindow.open = function(){};
  411.  
  412. if(document.querySelector("body").innerText.includes("This ad does not exist or has expired")){
  413. window.location.href = "https://auto.speedcoins.xyz/ptc/";
  414. }
  415.  
  416. }
  417.  
  418. function mad() {
  419.  
  420. //Block Pop Ups
  421. unsafeWindow.open = function(){};
  422.  
  423. if(document.querySelector("body").innerText.includes("This ad does not exist or has expired")){
  424. window.location.href = ["https://madoge.fun/ptc/","https://madtrx.fun/ptc/","https://madfey.fun/ptc/","https://madshiba.fun/ptc/","https://bitsfree.net/ptc/","https://free.shiba.limited/ptc/","https://madltc.fun/ptc/"];
  425. }
  426.  
  427. }
  428.  
  429.  
  430. var stopSolvingCaptcha = false;
  431.  
  432. function checkLoginSelectors() {
  433.  
  434. if (websiteDataValues.loginSelectors) {
  435. //Check if all login selectors are present
  436. let count = 0;
  437. for (let i = 0; i < websiteDataValues.loginSelectors.length; i++) {
  438. if (document.querySelector(websiteDataValues.loginSelectors[i])) {
  439. count++;
  440. }
  441.  
  442. }
  443.  
  444. if (count == websiteDataValues.loginSelectors.length) {
  445.  
  446. if (login.length > 0 && password.length > 0) {
  447. //Input Login
  448. document.querySelector(websiteDataValues.loginSelectors[0]).value = login;
  449.  
  450. //Input Password
  451. document.querySelector(websiteDataValues.loginSelectors[1]).value = password;
  452. } else {
  453. stopSolvingCaptcha = true;
  454. }
  455.  
  456. } else {
  457. stopSolvingCaptcha = true;
  458. }
  459.  
  460. } else {
  461. stopSolvingCaptcha = true;
  462. }
  463.  
  464. }
  465.  
  466.  
  467. setTimeout(function() {
  468.  
  469. checkLoginSelectors();
  470.  
  471. if (websiteDataValues.additionalFunctions) {
  472. websiteDataValues.additionalFunctions();
  473. }
  474.  
  475. //Look for all the default messages or errors before proceeding to next url
  476. //For other languages difference in the length of the strings can be compared or visibility of the style element
  477. if (!movingToNextUrl && messageSelectorsPresent()) {
  478. goToNextUrl();
  479. }
  480.  
  481.  
  482. //Check for all the default button selectors and click
  483. //This will only click the first selector found, so mention the selectors with parent element wherever required
  484. if(!movingToNextUrl && websiteDataValues.defaultButtonSelectors){
  485. for(var i=0;i<websiteDataValues.defaultButtonSelectors.length ;i++){
  486. if(document.querySelector(websiteDataValues.defaultButtonSelectors[i])){
  487. triggerEvent(document.querySelector(websiteDataValues.defaultButtonSelectors[i]), 'mousedown');
  488. triggerEvent(document.querySelector(websiteDataValues.defaultButtonSelectors[i]), 'mouseup');
  489. document.querySelector(websiteDataValues.defaultButtonSelectors[i]).click();
  490. break;
  491. }
  492. }
  493. }
  494.  
  495. if(!movingToNextUrl && websiteDataValues.toggleCaptchaSelector && Number.isInteger(websiteDataValues.toggleCaptchaSelectorIndex)){
  496. toggleCaptcha(websiteDataValues.toggleCaptchaSelector,websiteDataValues.toggleCaptchaSelectorIndex);
  497. }
  498.  
  499. //Input the address and click the login button
  500. if (!movingToNextUrl && document.querySelector(websiteDataValues.inputTextSelector)) {
  501. document.querySelector(websiteDataValues.inputTextSelector).value = websiteDataValues.address;
  502. setTimeout(function() {
  503. if (websiteDataValues.inputTextSelectorButton && document.querySelector(websiteDataValues.inputTextSelectorButton)) {
  504. document.querySelector(websiteDataValues.inputTextSelectorButton).click();
  505. }
  506.  
  507. }, 5000);
  508. }
  509.  
  510. //Click the form button after solving captcha
  511. //Works for both recaptcha and hcaptcha
  512. var clicked = false;
  513. var captchaInterval = setInterval(function() {
  514. if (!stopSolvingCaptcha || !window.location.href.includes("login")) {
  515. try {
  516. if (!clicked && unsafeWindow.grecaptcha && unsafeWindow.grecaptcha.getResponse().length > 0) {
  517. for (let i = 0; i < websiteDataValues.captchaButtonSubmitSelector.length; i++) {
  518. if (document.querySelector(websiteDataValues.captchaButtonSubmitSelector[i])) {
  519. document.querySelector(websiteDataValues.captchaButtonSubmitSelector[i]).click();
  520. }
  521. }
  522. clicked = true;
  523.  
  524. clearInterval(captchaInterval);
  525. setTimeout(function() {
  526. if (messageSelectorsPresent()) {
  527. goToNextUrl();
  528. }
  529. }, 5000);
  530. }
  531. } catch (e) {
  532.  
  533. }
  534.  
  535. for (var hc = 0; hc < document.querySelectorAll("iframe").length; hc++) {
  536. if (!clicked && document.querySelectorAll("iframe")[hc] &&
  537. document.querySelectorAll("iframe")[hc].getAttribute("data-hcaptcha-response") &&
  538. document.querySelectorAll("iframe")[hc].getAttribute("data-hcaptcha-response").length > 0) {
  539. for (let i = 0; i < websiteDataValues.captchaButtonSubmitSelector.length; i++) {
  540. if (document.querySelector(websiteDataValues.captchaButtonSubmitSelector[i])) {
  541. document.querySelector(websiteDataValues.captchaButtonSubmitSelector[i]).click();
  542. }
  543. }
  544. clicked = true;
  545. clearInterval(captchaInterval);
  546. setTimeout(function() {
  547. if (messageSelectorsPresent()) {
  548. goToNextUrl();
  549. }
  550. }, 5000);
  551. }
  552. }
  553. }
  554.  
  555. }, 5000);
  556.  
  557.  
  558. }, 5000);
  559.  
  560.  
  561. window.onbeforeunload = function() {
  562. if (unsafeWindow.myWindow) {
  563. unsafeWindow.myWindow.close();
  564. }
  565. if (unsafeWindow.coinwin) {
  566. var tmp = unsafeWindow.coinwin;
  567. unsafeWindow.coinwin = {};
  568. tmp.close();
  569. }
  570.  
  571. };
  572.  
  573. })();