Auto Vote and Refresh

Automate voting and refresh with styled credits

当前为 2024-12-27 提交的版本,查看 最新版本

  1. // ==UserScript==
  2. // @name Auto Vote and Refresh
  3. // @namespace http://tampermonkey.net/
  4. // @version 1.2
  5. // @description Automate voting and refresh with styled credits
  6. // @author Mohamed Nasr
  7. // @match *://vote.1billionsummit.com/*
  8. // @grant none
  9. // @license MIT Mohammed Elshreef
  10. // ==/UserScript==
  11.  
  12. (function() {
  13. 'use strict';
  14.  
  15. function voteAndRefresh() {
  16. try {
  17. const voteButton = document.querySelector('button[aria-label*="Vote for Ahmed AbuZaid"]');
  18. if (!voteButton) {
  19. console.error("Vote button not found!");
  20. return;
  21. }
  22.  
  23. voteButton.click();
  24. console.log("Vote button clicked");
  25.  
  26. setTimeout(() => {
  27. const submitButton = Array.from(document.querySelectorAll('button span')).find(
  28. el => el.textContent.trim() === "Submit Vote"
  29. )?.closest('button');
  30.  
  31. if (!submitButton) {
  32. console.error("Submit Vote button not found!");
  33. return;
  34. }
  35.  
  36. submitButton.click();
  37. console.log("Submit Vote button clicked");
  38.  
  39. setTimeout(() => {
  40. document.cookie.split(";").forEach(cookie => {
  41. const name = cookie.split("=")[0].trim();
  42. document.cookie = `${name}=; expires=Thu, 01 Jan 1970 00:00:00 UTC; path=/;`;
  43. });
  44. console.log("Cookies cleared");
  45.  
  46. localStorage.clear();
  47. sessionStorage.clear();
  48. console.log("LocalStorage and SessionStorage cleared");
  49.  
  50. location.reload();
  51. }, 2000);
  52. }, 2000);
  53. } catch (error) {
  54. console.error("An error occurred:", error);
  55. }
  56. }
  57.  
  58. function showCredits() {
  59. const creditDiv = document.createElement('div');
  60. creditDiv.innerHTML = 'Script by <a href="https://discord.com/users/832761264542449695" target="_blank" style="color: #FFD700; text-decoration: none;"><strong>Mohamed Nasr</strong></a>';
  61. creditDiv.style.position = 'fixed';
  62. creditDiv.style.bottom = '10px';
  63. creditDiv.style.right = '10px';
  64. creditDiv.style.backgroundColor = '#222';
  65. creditDiv.style.color = '#fff';
  66. creditDiv.style.padding = '15px 30px';
  67. creditDiv.style.borderRadius = '10px';
  68. creditDiv.style.boxShadow = '0 0 20px rgba(0, 0, 0, 0.7)';
  69. creditDiv.style.fontSize = '18px';
  70. creditDiv.style.zIndex = '9999';
  71. creditDiv.style.animation = 'fadeInOut 5s linear infinite';
  72. creditDiv.style.textAlign = 'center';
  73.  
  74. document.body.appendChild(creditDiv);
  75.  
  76. const style = document.createElement('style');
  77. style.textContent = `
  78. @keyframes fadeInOut {
  79. 0%, 100% { opacity: 0; transform: translateY(20px); }
  80. 50% { opacity: 1; transform: translateY(0); }
  81. }
  82. `;
  83. document.head.appendChild(style);
  84. }
  85.  
  86. const intervalTime = 10000;
  87. setInterval(voteAndRefresh, intervalTime);
  88. showCredits();
  89. })();