Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // ==UserScript==
- // @name Symol Hole Avatar
- // @namespace http://tampermonkey.net/
- // @version 0.1
- // @description try to take over the world!
- // @author You
- // @match http://www.neopets.com/medieval/symolhole.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 url = window.location.href;
- if (url.search("type") < 0) {
- // Symol Hole Main page
- findLinkContainingString("ENTER!").click();
- } else {
- // Stop if we get avatar. Otherwise, go back to main page
- if (document.body.innerHTML.search("You are now eligible to use") < 0) {
- window.location.href = "http://www.neopets.com/medieval/symolhole.phtml";
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement