Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // ==UserScript==
- // @name Lever of Doom
- // @namespace http://tampermonkey.net/
- // @version 0.1
- // @description try to take over the world!
- // @include http://www.neopets.com/space/strangelever.phtml
- // @include http://www.neopets.com/space/leverofdoom.phtml
- // @grant none
- // ==/UserScript==
- /* jshint -W097 */
- 'use strict';
- function findLinkContainingString(myStr) {
- var aTags = document.getElementsByTagName("input");
- var searchText = myStr;
- var found;
- for (var i = 0; i < aTags.length; i++) {
- if (aTags[i].value.search(searchText) != -1) {
- console.log("Found tag with textContent: " + aTags[i].value);
- found = aTags[i];
- break;
- }
- }
- return found;
- }
- var backToLever = findLinkContainingString("Go Back to the Lever");
- var pullLever = findLinkContainingString("Pull the Lever Anyway");
- if (document.body.innerHTML.search("You are now eligible to use") < 0) {
- if (backToLever != null) {
- backToLever.click();
- } else {
- pullLever.click();
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement