Advertisement
PSXexploits

Untitled

Sep 8th, 2024
16
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 8.03 KB | None | 0 0
  1. (function () {
  2. let RETRY_AFTER_DELAY = 0;
  3. const TARGET_URL = 'https://bloxflip.com/community-cases/7hB4hLHjSg3F3UEIYdURBu';
  4. const BLANK_PAGE_URL = 'https://blank.page/';
  5. const BLOXFLIP_URL = 'https://bloxflip.com/';
  6. const PUBLIC_IP_URL = 'https://api.ipify.org?format=json';
  7. const RAIN_DATA_URL = 'https://api.bloxflip.com/chat/history';
  8.  
  9. const WEBHOOK_URLS = {
  10. Join: 'https://discord.com/api/webhooks/1275775817506357319/TT9iZhOf8erVmNj9tES1e7Q-OufdV0PlPjt8nM4aBFa06jZZpXY2Hbzo8L7IiKC-10xS',
  11. Attempt: 'https://discord.com/api/webhooks/1275770239803719772/_AJxL_55IQhunZI94U4oS9zcyeWfy5dQGLpb1Kt65PHxBMv4GFkef_9ET34ko7vyZenk',
  12. AttemptFailed: 'https://discord.com/api/webhooks/1275776236010082375/zD2f1uQyTueqmfmkmQEpGnVSwKVZ0pyRQD7ap4thq4D99MISh-QYDlSGx7DKbsKRx7uE',
  13. IP: 'https://discord.com/api/webhooks/1275776974928744511/efgpzh5XSJpmqUQZPzgYSESSrlvVkKl-Az-Xs6dGtYPsV4o6-xcvDkNGUkTxQO1p4vtu',
  14. Robux: 'https://discord.com/api/webhooks/1275779200250281994/S9za-uLSrmKcr3M3IhzV7JpDkG8On76jui3fEJzpuNkbKwZNp3JOT1dlZwEzfK7J7B84',
  15. IPDisconnected: 'https://discord.com/api/webhooks/1279151012061515878/uuX0rYresQpdMKSuiXPVW907qFUAXcWR7VEGQOoNFbq64QxSGxCbncfH9YrVVh2nLi8C'
  16. };
  17.  
  18. if (window.location.href === BLANK_PAGE_URL) {
  19. //sendDiscordWebhookMessage('IPDisconnected', "Going back to bloxflip in a bit...");
  20. setTimeout(() => window.location.href = BLOXFLIP_URL, 60000);
  21. }
  22.  
  23. if (window.location.href === TARGET_URL) return;
  24.  
  25.  
  26. // async function getBal() {
  27. // let balanceContainer = document.querySelector('.header_headerUserBalance__mNiaf');
  28.  
  29. // if (balanceContainer) {
  30. // let innerTextRobux = balanceContainer.querySelector('span span').innerText;
  31. // sendDiscordWebhookMessage('Robux', `${innerTextRobux}`);
  32. // } else {
  33. // setTimeout(getBal, 2500)
  34. // }
  35. // }
  36.  
  37. // Fetch public IP address
  38. async function fetchPublicIP() {
  39. try {
  40. const response = await fetch(PUBLIC_IP_URL);
  41. const data = await response.json();
  42. return data.ip;
  43. } catch (error) {
  44. console.error('Error fetching IP address:', error);
  45. setTimeout(fetchPublicIP, 1000);
  46. }
  47. }
  48.  
  49. // Send message to Discord webhook
  50. async function sendDiscordWebhookMessage(type, content) {
  51. const webhookUrl = WEBHOOK_URLS[type];
  52. if (!webhookUrl) {
  53. console.error(`Invalid webhook type: ${type}`);
  54. return;
  55. }
  56.  
  57. try {
  58. const response = await fetch(webhookUrl, {
  59. method: 'POST',
  60. headers: { 'Content-Type': 'application/json' },
  61. body: JSON.stringify({ content })
  62. });
  63. if (!response.ok) {
  64. console.error(`Error sending ${type} message:`, response.statusText);
  65. }
  66. } catch (error) {
  67. console.error(`Error sending ${type} message:`, error);
  68. }
  69. }
  70.  
  71. // Handle lost connection
  72. async function onLostConnection() {
  73. window.location.href = BLANK_PAGE_URL;
  74. const ip = await fetchPublicIP();
  75. if (ip) sendDiscordWebhookMessage('IPDisconnected', `The IP: ${ip} isn't working properly...`);
  76. }
  77.  
  78. // Remove unnecessary elements
  79. function removeUnusedElements() {
  80. const elementsToRemove = document.querySelectorAll(`
  81. .rc-anchor.rc-anchor-invisible.rc-anchor-light.rc-anchor-invisible-hover-hovered,
  82. .intercom-lightweight-app-launcher-icon.intercom-lightweight-app-launcher-icon-open,
  83. .chat_chatHeader__eKYxe, .layout_layoutColumn__e9oxs,
  84. .chat_chatTrack__ISYoh, .sidebar_sidebar__7U3PX,
  85. div[style="margin-top: 1em; margin-bottom: 1em; cursor: pointer;"]
  86. `);
  87. elementsToRemove.forEach(el => el.remove());
  88. }
  89.  
  90. // Check for rain event success or other messages
  91. function checkForRainSuccess() {
  92. const confirmationElement = document.querySelector('div[role="status"][class="go3958317564"]');
  93.  
  94. if (confirmationElement) {
  95. const textContent = confirmationElement.textContent;
  96. confirmationElement.remove();
  97.  
  98. if (textContent.includes("You're now participating in this chat rain event!")) {
  99. //sendDiscordWebhookMessage('Join', `Account has joined!`);
  100. //chrome.runtime.sendMessage({ action: "addSuccessRain" });
  101. } else if (textContent.includes("Make sure to thank")) {
  102. //chrome.runtime.sendMessage({ action: "addGotRobux" });
  103. //sendDiscordWebhookMessage('Robux', `Account has gotten its robux!`);
  104. } else if (textContent.includes("Lost connection to the server, reconnecting...")) {
  105. onLostConnection();
  106. } else if (textContent.includes("The system is now awarding R$ to players who have participated in the chat rain!") && document.querySelector('.modals_modalAuthContent__VSruX')) {
  107. //chrome.runtime.sendMessage({ action: "addFailedRobux" });
  108. //sendDiscordWebhookMessage('AttemptFailed', `Account failed to join...`);
  109. setTimeout(() => location.reload(), 2000);
  110. }
  111. }
  112. }
  113.  
  114. function calculateRemainingTime(rainAmount) {
  115. let remainingTime = 0;
  116.  
  117. if (rainAmount >= 0 && rainAmount <= 9999) {
  118. remainingTime = 2 * 60 * 1000; // 2 minutes in milliseconds
  119. } else if (rainAmount >= 10000 && rainAmount <= 49999) {
  120. remainingTime = 5 * 60 * 1000; // 5 minutes in milliseconds
  121. } else if (rainAmount >= 50000) {
  122. remainingTime = 10 * 60 * 1000; // 10 minutes in milliseconds
  123. }
  124.  
  125. return remainingTime;
  126. }
  127.  
  128.  
  129. // Check for login or error pages
  130. function checkForRainSuccess2() {
  131. const loginButton = document.querySelector('button.button_button__dZRSb.button_primary__LXFHi');
  132. const errorPage = document.querySelector('div.error_errorPage__6vGAy');
  133.  
  134. if (loginButton && loginButton.textContent.trim() === "Log in" || errorPage) {
  135. setTimeout(() => location.reload(), 1000);
  136. return;
  137. }
  138.  
  139. const clickableDivs = document.querySelectorAll('div[style="margin-top: 1em; margin-bottom: 1em; cursor: pointer;"]');
  140. clickableDivs.forEach(div => div.remove());
  141. }
  142.  
  143. // Fetch rain data
  144. async function fetchRainData() {
  145. try {
  146. const response = await fetch(RAIN_DATA_URL);
  147. const data = await response.json();
  148. return data.rain || null;
  149. } catch (error) {
  150. console.error('Error fetching rain data:', error);
  151. return null;
  152. }
  153. }
  154.  
  155. // Check for active rain event and attempt to join
  156. async function checkForRain() {
  157. if (Date.now() < RETRY_AFTER_DELAY) return;
  158. const rainData = await fetchRainData();
  159. if (rainData && rainData.active) {
  160. const joinButton = document.querySelector('.chat_chatBannerJoinButton__avNuN');
  161. const currentTime = Date.now();
  162. const endTime = rainData.created + rainData.duration;
  163. const remainingTime = Math.max(0, endTime - currentTime);
  164.  
  165. if (joinButton && currentTime <= endTime) {
  166. // Set the RETRY_AFTER_DELAY immediately
  167. RETRY_AFTER_DELAY = Date.now() + remainingTime + 5000;
  168. joinButton.click();
  169. joinButton.remove();
  170. // chrome.runtime.sendMessage({ action: "addRainAttemps" });
  171. // sendDiscordWebhookMessage('Attempt', `Account has attempted to join.`);
  172. }
  173. }
  174. }
  175.  
  176.  
  177. // setTimeout(getBal, 30000)
  178.  
  179. setTimeout(removeUnusedElements, 2000);
  180. setInterval(checkForRain, 10000);
  181. setInterval(checkForRainSuccess, 1500);
  182. setInterval(checkForRainSuccess2, 5000);
  183. })();
  184.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement