Advertisement
wherr

TownStar Set Auto Sell Active

May 9th, 2022
720
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. // ==UserScript==
  2. // @name         Set Auto Sell Active
  3. // @namespace    http://tampermonkey.net/
  4. // @version      1
  5. // @description  Adds jump to buttons for the leaderboard
  6. // @author       wherr
  7. // @match        https://townstar.sandbox-games.com/launch
  8. // @grant        none
  9. // @run-at       document-start
  10. // ==/UserScript==
  11.  
  12. (function() {
  13.     let settingsOpen = 0;
  14.     let autoSellOn = 0;
  15.  
  16.     new MutationObserver(function(mutations) {
  17.         if (document.querySelector('.hud-player-button') && settingsOpen == 0) {
  18.             settingsOpen = 1;
  19.             OpenSettings();
  20.         }
  21.  
  22.         if (document.querySelector('.autosell__switch') && autoSellOn == 0) {
  23.             autoSellOn = 1;
  24.             ClickAutoSell();
  25.         }
  26.  
  27.         if (settingsOpen == 1 && autoSellOn == 1) {
  28.             self.disconnect();
  29.         }
  30.     }).observe(document, {childList: true, subtree: true});
  31.  
  32.     function OpenSettings() {
  33.         document.querySelector(".hud-player-button").click();
  34.     }
  35.  
  36.     function ClickAutoSell() {
  37.         document.querySelector(".autosell__switch").click();
  38.         document.querySelector(".exit-button__icon").click();
  39.     }
  40. })();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement