Greasy Fork 还支持 简体中文。

Multi WEB PTC With AUTO Captcha

Multi PTC Cryptorotator

目前為 2022-12-22 提交的版本,檢視 最新版本

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