Greasy Fork 支持简体中文。

Multi WEB PTC With AUTO Captcha

Multi PTC Cryptorotator

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

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