Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // ==UserScript==
- // @name Mush Character Autopicker
- // @namespace http://tampermonkey.net/
- // @version 0.1
- // @description Reloads the /chooseHero page, waits for your favorite character and autopicks it
- // @author HwangLiu
- // @match http://mush.vg/chooseHero
- // @match http://mush.twinoid.com/chooseHero
- // @grant none
- // ==/UserScript==
- //Checks for a preferred character
- var allImages = document.getElementsByTagName("img");
- for (var i = 0, max = allImages.length; i < max; i++)
- if (allImages[i].src === "http://mush.vg/img/art/char/paola_rinaldo.jpg"){
- var target = allImages[i];
- break;
- }
- //Sets the countdown to reload the page
- setTimeout(function() {
- location.reload();
- }, 300000);
- //Choosing the preferred character
- var clickEvent = document.createEvent ('MouseEvents');
- clickEvent.initEvent ('click', true, true);
- target.dispatchEvent (clickEvent);
- //Pressing Join the ship button
- var joinButton = document.getElementsByClassName("but2bg")
- joinButton[0].dispatchEvent (clickEvent);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement