Kesuksesan2

mencari dia seorang

  1. // ==UserScript==
  2. // @name Kesuksesan2
  3. // @namespace http://tampermonkey.net/
  4. // @version 0.7
  5. // @description mencari dia seorang
  6. // @match https://*/*
  7. // @grant none
  8. // ==/UserScript==
  9.  
  10. (function() {
  11. 'use strict';
  12.  
  13. var targetURL = "https://id.arahlink.com/ijXD3";
  14. var targetURL1 = "https://id.arahlink.com/2OlPOA";
  15.  
  16. // Check if the current URL matches https://id.arahlink.com/
  17. if (window.location.href.startsWith("https://id.arahlink.com/ijXD3")) {
  18. function elementExists(query) {
  19. return document.querySelector(query) !== null;
  20. }
  21.  
  22. function click(query) {
  23. document.querySelector(query).click();
  24. }
  25.  
  26. function clickIfElementExists(query, timeInSec = 1) {
  27. if (elementExists(query)) {
  28. setTimeout(function() {
  29. click(query);
  30. }, timeInSec * 1000);
  31. }
  32. }
  33.  
  34. // Call the function to click a button with class btn btn-primary if it exists
  35. clickIfElementExists('.btn.btn-primary');
  36.  
  37. // Fungsi untuk mencari elemen a dengan teks "Dapatkan tautan"
  38. function findLinkElement() {
  39. var links = document.getElementsByTagName("a");
  40. for (var i = 0; i < links.length; i++) {
  41. var link = links[i];
  42. var text = link.textContent.trim();
  43. if (text === "Dapatkan tautan") {
  44. link.textContent = "SUKSES";
  45. return link;
  46. }
  47. }
  48. return null;
  49. }
  50.  
  51. setInterval(function() {
  52. var link = findLinkElement();
  53. if (link) {
  54. setTimeout(function() {
  55. window.location.href = targetURL1;
  56. }, 1000);
  57. }
  58. }, 1000);
  59. }
  60.  
  61. if (window.location.href.startsWith("https://id.arahlink.com/2OlPOA")) {
  62. function elementExists(query) {
  63. return document.querySelector(query) !== null;
  64. }
  65.  
  66. function click(query) {
  67. document.querySelector(query).click();
  68. }
  69.  
  70. function clickIfElementExists(query, timeInSec = 1) {
  71. if (elementExists(query)) {
  72. setTimeout(function() {
  73. click(query);
  74. }, timeInSec * 1000);
  75. }
  76. }
  77.  
  78. // Call the function to click a button with class btn btn-primary if it exists
  79. clickIfElementExists('.btn.btn-primary');
  80.  
  81. // Fungsi untuk mencari elemen a dengan teks "Dapatkan tautan"
  82. function findLinkElement1() {
  83. var links = document.getElementsByTagName("a");
  84. for (var i = 0; i < links.length; i++) {
  85. var link = links[i];
  86. var text = link.textContent.trim();
  87. if (text === "Dapatkan tautan") {
  88. link.textContent = "SUKSES";
  89. return link;
  90. }
  91. }
  92. return null;
  93. }
  94.  
  95. setInterval(function() {
  96. var link = findLinkElement1();
  97. if (link) {
  98. setTimeout(function() {
  99. window.location.href = "https://id.arahlink.com/";
  100. }, 1000);
  101. }
  102. }, 1000);
  103. }
  104.  
  105. // For the other website, redirect on refresh
  106. function redirectOnRefresh() {
  107. if (window.location.hostname === "id.arahlink.com") {
  108. var redirectURL = targetURL;
  109. if (performance.navigation.type === 1) {
  110. window.location.href = redirectURL;
  111. }
  112. }
  113. }
  114.  
  115. redirectOnRefresh();
  116.  
  117. // Check if the current URL matches "id.arahlink.com" without a trailing slash
  118. if (window.location.hostname === "id.arahlink.com" && window.location.pathname === "/") {
  119. function findImg() {
  120. // Mencari elemen img dengan class inserted-btn mtz
  121. var img = document.querySelector("img.inserted-btn.mtz");
  122. // Jika elemen img ditemukan
  123. if (img) {
  124. // Hentikan pencarian
  125. clearInterval(interval);
  126. // Setelah 2 detik
  127. setTimeout(function() {
  128. // Klik elemen img
  129. img.click();
  130. }, 1000);
  131. }
  132. }
  133.  
  134. // Membuat interval untuk mencari elemen img setiap 1 detik
  135. var interval = setInterval(findImg, 1000);
  136. }
  137.  
  138. })();
  139.  
  140.  
  141.  
  142.  
  143.