Multi WEB PTC With AUTO Captcha

Multi PTC Cryptorotator

当前为 2022-12-23 提交的版本,查看 最新版本

此脚本不应直接安装。它是供其他脚本使用的外部库,要使用该库请加入元指令 // @require https://update.cn-greasyfork.org/scripts/457009/1131279/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. //click on claim button with recaptcha
  129. var clicked = false;
  130. var click = setInterval(function() {
  131. if (window.grecaptcha.getResponse().length > 0) {
  132. document.querySelector(".btn.btn-success.btn-block").click();
  133. clicked = true;
  134. clearInterval(click);
  135. }}, 5000);
  136.  
  137. //click on claim button without recaptcha
  138. var click2 = setInterval(function() {
  139. if(document.querySelector("#Verify")){
  140. document.querySelector("#Verify").click();
  141. clicked = true;
  142. clearInterval(click2);
  143. }}, 8000);
  144.  
  145.  
  146. //HtmlEvents dispatcher
  147. function triggerEvent(el, type) {
  148. try{
  149. var e = document.createEvent('HTMLEvents');
  150. e.initEvent(type, false, true);
  151. el.dispatchEvent(e);
  152. }catch(exception){
  153. console.log(exception);
  154. }
  155. }
  156.  
  157. function toggleCaptcha(selector, index){
  158. if( document.querySelector(selector)){
  159. document.querySelector(selector).selectedIndex = index;
  160. var targetNode = document.querySelector(selector);
  161. if (targetNode) {
  162. setTimeout(function() {
  163. triggerEvent(targetNode, 'change');
  164. }, 5000);
  165. }
  166. }
  167. }
  168.  
  169. //Check if a string is present in Array
  170. String.prototype.includesOneOf = function(arrayOfStrings) {
  171.  
  172. //If this is not an Array, compare it as a String
  173. if (!Array.isArray(arrayOfStrings)) {
  174. return this.toLowerCase().includes(arrayOfStrings.toLowerCase());
  175. }
  176.  
  177. for (var i = 0; i < arrayOfStrings.length; i++) {
  178. if (this.toLowerCase().includes(arrayOfStrings[i].toLowerCase())) {
  179. return true;
  180. }
  181. }
  182. return false;
  183. }
  184.  
  185. var websiteDataValues = {};
  186.  
  187. //Get selector details from the websiteMap
  188. for (let value of Object.values(websiteMap)) {
  189. if (window.location.href.includesOneOf(value.website)) {
  190. websiteDataValues.inputTextSelector = value.inputTextSelector;
  191. websiteDataValues.inputTextSelectorButton = value.inputTextSelectorButton;
  192. websiteDataValues.defaultButtonSelectors = value.defaultButtonSelectors;
  193. websiteDataValues.claimButtonSelector = value.claimButtonSelector;
  194. websiteDataValues.captchaButtonSubmitSelector = value.captchaButtonSubmitSelector;
  195. websiteDataValues.loginSelectors = value.loginSelectors;
  196. websiteDataValues.loginCaptcha = value.loginCaptcha;
  197. websiteDataValues.allMessageSelectors = value.allMessageSelectors;
  198. websiteDataValues.messagesToCheckBeforeMovingToNextUrl = value.messagesToCheckBeforeMovingToNextUrl;
  199. websiteDataValues.withdrawPageUrl = value.withdrawPageUrl;
  200. websiteDataValues.withdrawEnabled = value.withdrawEnabled;
  201. websiteDataValues.balanceSelector = value.balanceSelector;
  202. websiteDataValues.withdrawMinAmount = value.withdrawMinAmount;
  203. websiteDataValues.successMessageSelectors = value.successMessageSelectors;
  204. websiteDataValues.toggleCaptchaSelector = value.toggleCaptchaSelector;
  205. websiteDataValues.toggleCaptchaSelectorIndex = value.toggleCaptchaSelectorIndex;
  206. websiteDataValues.additionalFunctions = value.additionalFunctions;
  207. websiteDataValues.timeoutbeforeMovingToNextUrl = value.timeoutbeforeMovingToNextUrl;
  208. break;
  209. }
  210. }
  211.  
  212.  
  213. var login = "";
  214. var password = "";
  215.  
  216. for (let value of Object.values(websiteData)) {
  217. count = count + 1;
  218. if (value.url.includes(window.location.hostname)) {
  219. websiteDataValues.url = value.url;
  220. login = value.login;
  221. password = value.password;
  222. break;
  223. }
  224. }
  225.  
  226.  
  227. //Get the next Url from the website data map
  228. async function getNextUrl() {
  229.  
  230. //Go to the beginning if the end of the array is reached
  231. if (count >= websiteData.length) {
  232. websiteDataValues.nextUrl = websiteData[0].url;
  233. } else {
  234. websiteDataValues.nextUrl = websiteData[count].url;
  235. }
  236.  
  237. //Use case for overrding next Url
  238. if (websiteDataValues.overrideNextUrl) {
  239. websiteDataValues.nextUrl = websiteDataValues.overrideNextUrl;
  240. }
  241.  
  242. //Ping Test to check if a website is up before proceeding to next url
  243. pingTest(websiteDataValues.nextUrl);
  244. }
  245.  
  246. var isNextUrlReachable = false;
  247. //Get the next Url from the website
  248. function pingTest(websiteUrl) {
  249. console.log(websiteUrl);
  250. GM_xmlhttpRequest({
  251. method: "GET",
  252. url: websiteUrl,
  253. headers: {
  254. "Content-Type": "application/x-www-form-urlencoded"
  255. },
  256. timeout: 5000,
  257. onload: function(response) {
  258. //Website is reachable
  259. isNextUrlReachable = true;
  260. },
  261. onerror: function(e) {
  262. count = count + 1;
  263. getNextUrl();
  264. },
  265. ontimeout: function() {
  266. count = count + 1;
  267. getNextUrl();
  268. },
  269. });
  270.  
  271. }
  272.  
  273.  
  274. async function delay(ms) {
  275. return new Promise(resolve => setTimeout(resolve, ms))
  276. }
  277.  
  278.  
  279. var movingToNextUrl = false;
  280. async function goToNextUrl() {
  281. if (!movingToNextUrl) {
  282. movingToNextUrl = true;
  283. getNextUrl();
  284. while (!isNextUrlReachable) {
  285. await delay(3000);
  286. }
  287. window.location.href = websiteDataValues.nextUrl;
  288. }
  289. }
  290.  
  291.  
  292. //Default Setting: After 1000 seconds go to next Url
  293. var delayBeforeMovingToNextUrl = 1000000;
  294. if (websiteDataValues.timeoutbeforeMovingToNextUrl) {
  295. delayBeforeMovingToNextUrl = websiteDataValues.timeoutbeforeMovingToNextUrl;
  296. }
  297.  
  298. setTimeout(function() {
  299. goToNextUrl();
  300. }, delayBeforeMovingToNextUrl);
  301.  
  302.  
  303. //Wait for 5 seconds if it's in dashboard,
  304. if ((!window.location.href.includes("coinpayu")) && (window.location.href.includes("dashboard") || window.location.href.includes("page/user-admin"))) {
  305. setTimeout(function() {
  306. if (websiteDataValues.url) {
  307. window.location.href = websiteDataValues.url;
  308. }
  309. }, 5000);
  310. }
  311.  
  312.  
  313. //Returns true if message selectors are present
  314. function messageSelectorsPresent() {
  315. if (websiteDataValues.allMessageSelectors) {
  316. for (var j = 0; j < websiteDataValues.allMessageSelectors.length; j++) {
  317. for (var k = 0; k < document.querySelectorAll(websiteDataValues.allMessageSelectors[j]).length; k++) {
  318. if (document.querySelectorAll(websiteDataValues.allMessageSelectors[j])[k] &&
  319. (document.querySelectorAll(websiteDataValues.allMessageSelectors[j])[k].innerText.includesOneOf(websiteDataValues.messagesToCheckBeforeMovingToNextUrl) ||
  320. (document.querySelectorAll(websiteDataValues.allMessageSelectors[j])[k].value &&
  321. document.querySelectorAll(websiteDataValues.allMessageSelectors[j])[k].value.includesOneOf(websiteDataValues.messagesToCheckBeforeMovingToNextUrl)))) {
  322. return true;
  323. }
  324. }
  325. }
  326. }
  327. return false;
  328. }
  329.  
  330. function closeRepeatingAds() {
  331.  
  332. //Check if previous Ad is Same as Current Ad and Skip the Ad
  333. if (unsafeWindow.viewurl) {
  334. if (GM_getValue("adUrl") && GM_getValue("adUrl") == unsafeWindow.viewurl) {
  335. //Skip the Ad
  336. document.querySelector(".card > a").click();
  337. movingToNextUrl = true;
  338. } else {
  339. GM_setValue("adUrl", unsafeWindow.viewurl);
  340. }
  341.  
  342. }
  343.  
  344. }
  345.  
  346.  
  347.  
  348. function grandcryptoauto() {
  349.  
  350. //Block Pop Ups
  351. unsafeWindow.open = function(){};
  352.  
  353. if(document.querySelector("body").innerText.includes("This ad does not exist or has expired")){
  354. window.location.href = "https://faucetoshi.com/ptc/";
  355. }
  356.  
  357. }
  358.  
  359. function ptcfaucet() {
  360.  
  361. //Block Pop Ups
  362. unsafeWindow.open = function(){};
  363.  
  364. if(document.querySelector("body").innerText.includes("This ad does not exist or has expired")){
  365. window.location.href = "https://ptcfaucet.xyz/ptc/";
  366. }
  367.  
  368. }
  369.  
  370. function metabitz() {
  371.  
  372. //Block Pop Ups
  373. unsafeWindow.open = function(){};
  374.  
  375. if(document.querySelector("body").innerText.includes("This ad does not exist or has expired")){
  376. window.location.href = "https://metabitz.net/ptc/";
  377. }
  378.  
  379. }
  380.  
  381. function dinntoks() {
  382.  
  383. //Block Pop Ups
  384. unsafeWindow.open = function(){};
  385.  
  386. if(document.querySelector("body").innerText.includes("This ad does not exist or has expired")){
  387. window.location.href = "https://dinntoks.com/ptc/";
  388. }
  389.  
  390. }
  391.  
  392. function paidsatoshi() {
  393.  
  394. //Block Pop Ups
  395. unsafeWindow.open = function(){};
  396.  
  397. if(document.querySelector("body").innerText.includes("This ad does not exist or has expired")){
  398. window.location.href = "https://https://paidsatoshi.com/surfads.php/";
  399. }
  400.  
  401. }
  402.  
  403. function adbtc() {
  404.  
  405. //Block Pop Ups
  406. unsafeWindow.open = function(){};
  407.  
  408. if(document.querySelector("body").innerText.includes("This ad does not exist or has expired")){
  409. window.location.href = "https://adbtc.io/surf/";
  410. }
  411.  
  412. }
  413.  
  414. function trxking() {
  415.  
  416. //Block Pop Ups
  417. unsafeWindow.open = function(){};
  418.  
  419. if(document.querySelector("body").innerText.includes("This ad does not exist or has expired")){
  420. window.location.href = "https://trxking.xyz/ptc/";
  421. }
  422.  
  423. }
  424.  
  425. function speedcoins() {
  426.  
  427. //Block Pop Ups
  428. unsafeWindow.open = function(){};
  429.  
  430. if(document.querySelector("body").innerText.includes("This ad does not exist or has expired")){
  431. window.location.href = "https://auto.speedcoins.xyz/ptc/";
  432. }
  433.  
  434. }
  435.  
  436. function mad() {
  437.  
  438. //Block Pop Ups
  439. unsafeWindow.open = function(){};
  440.  
  441. if(document.querySelector("body").innerText.includes("This ad does not exist or has expired")){
  442. 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/"];
  443. }
  444.  
  445. }
  446.  
  447.  
  448. var stopSolvingCaptcha = false;
  449.  
  450. function checkLoginSelectors() {
  451.  
  452. if (websiteDataValues.loginSelectors) {
  453. //Check if all login selectors are present
  454. let count = 0;
  455. for (let i = 0; i < websiteDataValues.loginSelectors.length; i++) {
  456. if (document.querySelector(websiteDataValues.loginSelectors[i])) {
  457. count++;
  458. }
  459.  
  460. }
  461.  
  462. if (count == websiteDataValues.loginSelectors.length) {
  463.  
  464. if (login.length > 0 && password.length > 0) {
  465. //Input Login
  466. document.querySelector(websiteDataValues.loginSelectors[0]).value = login;
  467.  
  468. //Input Password
  469. document.querySelector(websiteDataValues.loginSelectors[1]).value = password;
  470. } else {
  471. stopSolvingCaptcha = true;
  472. }
  473.  
  474. } else {
  475. stopSolvingCaptcha = true;
  476. }
  477.  
  478. } else {
  479. stopSolvingCaptcha = true;
  480. }
  481.  
  482. }
  483.  
  484.  
  485. setTimeout(function() {
  486.  
  487. checkLoginSelectors();
  488.  
  489. if (websiteDataValues.additionalFunctions) {
  490. websiteDataValues.additionalFunctions();
  491. }
  492.  
  493. //Look for all the default messages or errors before proceeding to next url
  494. //For other languages difference in the length of the strings can be compared or visibility of the style element
  495. if (!movingToNextUrl && messageSelectorsPresent()) {
  496. goToNextUrl();
  497. }
  498.  
  499.  
  500. //Check for all the default button selectors and click
  501. //This will only click the first selector found, so mention the selectors with parent element wherever required
  502. if(!movingToNextUrl && websiteDataValues.defaultButtonSelectors){
  503. for(var i=0;i<websiteDataValues.defaultButtonSelectors.length ;i++){
  504. if(document.querySelector(websiteDataValues.defaultButtonSelectors[i])){
  505. triggerEvent(document.querySelector(websiteDataValues.defaultButtonSelectors[i]), 'mousedown');
  506. triggerEvent(document.querySelector(websiteDataValues.defaultButtonSelectors[i]), 'mouseup');
  507. document.querySelector(websiteDataValues.defaultButtonSelectors[i]).click();
  508. break;
  509. }
  510. }
  511. }
  512.  
  513. if(!movingToNextUrl && websiteDataValues.toggleCaptchaSelector && Number.isInteger(websiteDataValues.toggleCaptchaSelectorIndex)){
  514. toggleCaptcha(websiteDataValues.toggleCaptchaSelector,websiteDataValues.toggleCaptchaSelectorIndex);
  515. }
  516.  
  517. //Input the address and click the login button
  518. if (!movingToNextUrl && document.querySelector(websiteDataValues.inputTextSelector)) {
  519. document.querySelector(websiteDataValues.inputTextSelector).value = websiteDataValues.address;
  520. setTimeout(function() {
  521. if (websiteDataValues.inputTextSelectorButton && document.querySelector(websiteDataValues.inputTextSelectorButton)) {
  522. document.querySelector(websiteDataValues.inputTextSelectorButton).click();
  523. }
  524.  
  525. }, 5000);
  526. }
  527.  
  528. //Click the form button after solving captcha
  529. //Works for both recaptcha and hcaptcha
  530. var clicked = false;
  531. var captchaInterval = setInterval(function() {
  532. if (!stopSolvingCaptcha || !window.location.href.includes("login")) {
  533. try {
  534. if (!clicked && unsafeWindow.grecaptcha && unsafeWindow.grecaptcha.getResponse().length > 0) {
  535. for (let i = 0; i < websiteDataValues.captchaButtonSubmitSelector.length; i++) {
  536. if (document.querySelector(websiteDataValues.captchaButtonSubmitSelector[i])) {
  537. document.querySelector(websiteDataValues.captchaButtonSubmitSelector[i]).click();
  538. }
  539. }
  540. clicked = true;
  541.  
  542. clearInterval(captchaInterval);
  543. setTimeout(function() {
  544. if (messageSelectorsPresent()) {
  545. goToNextUrl();
  546. }
  547. }, 5000);
  548. }
  549. } catch (e) {
  550.  
  551. }
  552.  
  553. for (var hc = 0; hc < document.querySelectorAll("iframe").length; hc++) {
  554. if (!clicked && document.querySelectorAll("iframe")[hc] &&
  555. document.querySelectorAll("iframe")[hc].getAttribute("data-hcaptcha-response") &&
  556. document.querySelectorAll("iframe")[hc].getAttribute("data-hcaptcha-response").length > 0) {
  557. for (let i = 0; i < websiteDataValues.captchaButtonSubmitSelector.length; i++) {
  558. if (document.querySelector(websiteDataValues.captchaButtonSubmitSelector[i])) {
  559. document.querySelector(websiteDataValues.captchaButtonSubmitSelector[i]).click();
  560. }
  561. }
  562. clicked = true;
  563. clearInterval(captchaInterval);
  564. setTimeout(function() {
  565. if (messageSelectorsPresent()) {
  566. goToNextUrl();
  567. }
  568. }, 5000);
  569. }
  570. }
  571. }
  572.  
  573. }, 5000);
  574.  
  575.  
  576. }, 5000);
  577.  
  578.  
  579. window.onbeforeunload = function() {
  580. if (unsafeWindow.myWindow) {
  581. unsafeWindow.myWindow.close();
  582. }
  583. if (unsafeWindow.coinwin) {
  584. var tmp = unsafeWindow.coinwin;
  585. unsafeWindow.coinwin = {};
  586. tmp.close();
  587. }
  588.  
  589. };
  590.  
  591. })();