Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // ==UserScript==
- // @name Set Auto Sell Active
- // @namespace http://tampermonkey.net/
- // @version 1
- // @description Adds jump to buttons for the leaderboard
- // @author wherr
- // @match https://townstar.sandbox-games.com/launch
- // @grant none
- // @run-at document-start
- // ==/UserScript==
- (function() {
- let settingsOpen = 0;
- let autoSellOn = 0;
- new MutationObserver(function(mutations) {
- if (document.querySelector('.hud-player-button') && settingsOpen == 0) {
- settingsOpen = 1;
- OpenSettings();
- }
- if (document.querySelector('.autosell__switch') && autoSellOn == 0) {
- autoSellOn = 1;
- ClickAutoSell();
- }
- if (settingsOpen == 1 && autoSellOn == 1) {
- self.disconnect();
- }
- }).observe(document, {childList: true, subtree: true});
- function OpenSettings() {
- document.querySelector(".hud-player-button").click();
- }
- function ClickAutoSell() {
- document.querySelector(".autosell__switch").click();
- document.querySelector(".exit-button__icon").click();
- }
- })();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement