greasyfork.org Open in urlscan Pro
2600:3c01:1::68c8:1a9a  Public Scan

URL: https://greasyfork.org/en/scripts/392663-neopets-empty-shop/code
Submission Tags: falconsandbox
Submission: On May 26 via api from US — Scanned from DE

Form analysis 1 forms found in the DOM

/scripts/392663-neopets-empty-shop/code

<form id="language-selector" action="/scripts/392663-neopets-empty-shop/code">
  <select id="language-selector-locale" name="locale" data-translate-url="https://github.com/JasonBarnabe/greasyfork/wiki/Translating-Greasy-Fork">
    <option data-language-url="/ar/scripts/392663-neopets-empty-shop/code" value="ar"> العَرَبِيةُ (ar) </option>
    <option data-language-url="/bg/scripts/392663-neopets-empty-shop/code" value="bg"> Български (bg) </option>
    <option data-language-url="/cs/scripts/392663-neopets-empty-shop/code" value="cs"> Čeština (cs) </option>
    <option data-language-url="/da/scripts/392663-neopets-empty-shop/code" value="da"> Dansk (da) </option>
    <option data-language-url="/de/scripts/392663-neopets-empty-shop/code" value="de"> Deutsch (de) </option>
    <option data-language-url="/el/scripts/392663-neopets-empty-shop/code" value="el"> Ελληνικά (el) </option>
    <option data-language-url="/en/scripts/392663-neopets-empty-shop/code" value="en" selected=""> English (en) </option>
    <option data-language-url="/eo/scripts/392663-neopets-empty-shop/code" value="eo"> Esperanto (eo) </option>
    <option data-language-url="/es/scripts/392663-neopets-empty-shop/code" value="es"> Español (es) </option>
    <option data-language-url="/fi/scripts/392663-neopets-empty-shop/code" value="fi"> Suomi (fi) </option>
    <option data-language-url="/fr/scripts/392663-neopets-empty-shop/code" value="fr"> Français (fr) </option>
    <option data-language-url="/fr-CA/scripts/392663-neopets-empty-shop/code" value="fr-CA"> Français canadien (fr-CA) </option>
    <option data-language-url="/he/scripts/392663-neopets-empty-shop/code" value="he"> עברית (he) </option>
    <option data-language-url="/hu/scripts/392663-neopets-empty-shop/code" value="hu"> Magyar (hu) </option>
    <option data-language-url="/id/scripts/392663-neopets-empty-shop/code" value="id"> Bahasa Indonesia (id) </option>
    <option data-language-url="/it/scripts/392663-neopets-empty-shop/code" value="it"> Italiano (it) </option>
    <option data-language-url="/ja/scripts/392663-neopets-empty-shop/code" value="ja"> 日本語 (ja) </option>
    <option data-language-url="/ko/scripts/392663-neopets-empty-shop/code" value="ko"> 한국어 (ko) </option>
    <option data-language-url="/nb/scripts/392663-neopets-empty-shop/code" value="nb"> Bokmål (nb) </option>
    <option data-language-url="/nl/scripts/392663-neopets-empty-shop/code" value="nl"> Nederlands (nl) </option>
    <option data-language-url="/pl/scripts/392663-neopets-empty-shop/code" value="pl"> Polski (pl) </option>
    <option data-language-url="/pt-BR/scripts/392663-neopets-empty-shop/code" value="pt-BR"> Português do Brasil (pt-BR) </option>
    <option data-language-url="/ro/scripts/392663-neopets-empty-shop/code" value="ro"> Română (ro) </option>
    <option data-language-url="/ru/scripts/392663-neopets-empty-shop/code" value="ru"> Русский (ru) </option>
    <option data-language-url="/sk/scripts/392663-neopets-empty-shop/code" value="sk"> Slovenčina (sk) </option>
    <option data-language-url="/sr/scripts/392663-neopets-empty-shop/code" value="sr"> srpski (sr) </option>
    <option data-language-url="/sv/scripts/392663-neopets-empty-shop/code" value="sv"> Svenska (sv) </option>
    <option data-language-url="/th/scripts/392663-neopets-empty-shop/code" value="th"> ภาษาไทย (th) </option>
    <option data-language-url="/tr/scripts/392663-neopets-empty-shop/code" value="tr"> Türkçe (tr) </option>
    <option data-language-url="/uk/scripts/392663-neopets-empty-shop/code" value="uk"> Українська (uk) </option>
    <option data-language-url="/ug/scripts/392663-neopets-empty-shop/code" value="ug"> ئۇيغۇر (ug) </option>
    <option data-language-url="/vi/scripts/392663-neopets-empty-shop/code" value="vi"> Tiếng Việt (vi) </option>
    <option data-language-url="/zh-CN/scripts/392663-neopets-empty-shop/code" value="zh-CN"> 简体中文 (zh-CN) </option>
    <option data-language-url="/zh-TW/scripts/392663-neopets-empty-shop/code" value="zh-TW"> 繁體中文 (zh-TW) </option>
    <option value="help">Help us translate!</option>
  </select><input id="language-selector-submit" type="submit" value="→" style="display: none;">
  <script>
    /* submit is handled by js if enabled */
    document.getElementById("language-selector-submit").style.display = "none"
  </script>
</form>

Text Content

GREASY FORK

Sign in
العَرَبِيةُ (ar) Български (bg) Čeština (cs) Dansk (da) Deutsch (de) Ελληνικά
(el) English (en) Esperanto (eo) Español (es) Suomi (fi) Français (fr) Français
canadien (fr-CA) עברית (he) Magyar (hu) Bahasa Indonesia (id) Italiano (it) 日本語
(ja) 한국어 (ko) Bokmål (nb) Nederlands (nl) Polski (pl) Português do Brasil
(pt-BR) Română (ro) Русский (ru) Slovenčina (sk) srpski (sr) Svenska (sv)
ภาษาไทย (th) Türkçe (tr) Українська (uk) ئۇيغۇر (ug) Tiếng Việt (vi) 简体中文
(zh-CN) 繁體中文 (zh-TW) Help us translate!
Scripts Forum Help More
Advanced search User list Libraries Moderator log

Greasy Fork ist auf Deutsch verfügbar.

 * Info
 * Code
 * History
 * Feedback (0)
 * Stats


NEOPETS - EMPTY SHOP

Puts something in the unused shop IDs

Install this script?


HOW TO INSTALL

You will need to install an extension such as Tampermonkey, Greasemonkey or
Violentmonkey to install this script.

You will need to install an extension such as Tampermonkey or Violentmonkey to
install this script.

You will need to install an extension such as Tampermonkey or Violentmonkey to
install this script.

You will need to install an extension such as Tampermonkey or Userscripts to
install this script.

You will need to install a user script manager extension to install this script.

(I already have a user script manager, let me install it!)

OK


HOW TO INSTALL

You will need to install an extension such as Stylus to install this script.

You will need to install an extension such as Stylus to install this script.

You will need to install an extension such as Stylus to install this script.

You will need to install a user style manager extension to install this script.

You will need to install a user style manager extension to install this script.

(I already have a user style manager, let me install it!)

OK
Ask a question, post a review, or report the script.
 1.   // ==UserScript==
 2.   // @name           Neopets - Empty Shop
 3.   // @namespace
 4.   // @include        http://www.neopets.com/objects.phtml?type=shop&obj_type=*
 5.   // @include        http://www.neopets.com/objects.phtml?obj_type=*&type=shop
 6.   // @description    Puts something in the unused shop IDs
 7.   // @copyright      mysticmajin
 8.   // @grant          none
 9.   // @homepageURL    http://www.neopets.com/~Jialana
 10.  // @version 0.0.1.20191119212706
 11.  // @namespace http://www.neopets.com/~Jialana
 12.  // ==/UserScript==
 13.   
 14.  function id(el,id) {return el.getElementById(id);} //These three functions are just typing shortcuts for getting page elements.
 15.  function cl(el,cls) {return el.getElementsByClassName(cls);}
 16.  function tg(el,tag) {return el.getElementsByTagName(tag);}
 17.   
 18.  (function() {
 19.  var pageArea = cl(document,"content")[0]
 20.  pageArea = tg(pageArea,"center")[0]
 21.  pageArea = tg(pageArea,"br")[0]; //Gets an anchor point for the HTML.
 22.  var shopName; //What's displayed at the top-left of the content module.
 23.  var shopGreeting; //The bolded text under the shopkeeper image.
 24.  var shopCaption; //The non-bolded text under the greeting.
 25.  var shopkeeperImage; //The shopkeeper themselves.
 26.  var imgNotPet = '\" width=\"450\" height=\"150\" border=\"0\">' //The attributes for ordinary shopkeeper images.
 27.  var imgIsPet = '/2/2.png\" style=\"padding-left:150px;padding-right:150px;height:150px;\" border=\"0\">' //For when the active pet is in place of the shopkeeper.
 28.   
 29.  var currentURL = window.location.href; //Reads the URL of the current page.
 30.  var shopID = currentURL.replace(/[\D]/g, ''); //Extracts the shop ID number from the URL.
 31.   
 32.  var validShop = false; //Determines whether anything is done.
 33.   
 34.   
 35.  //Simulates the Pteri hints at the bottom of out-of-stock shops for a more authentic feel.
 36.  var REDPTERIHINT = ["You may be able to find some cheap food, or other objects in the <a href=\"http://www.neopets.com/auctions.phtml\"><b>Neopian Auctions</b></a>!",
 37.                      "Fancy some free <a href=\"http://www.neopets.com/prehistoric/omelette.phtml\"><b>Omelette</b></a>?",
 38.                      "Hungry?  Why not try <a href=\"http://www.neopets.com/objects.phtml?type=shop&amp;obj_type=47\"><b>PIZZAROO!</b></a>???",
 39.                      "The <a href=\"http://www.neopets.com/soupkitchen.phtml\"><b>Soup Kitchen</b></a> will give away free food to pets!",
 40.                      "There are loads more shops in the <a href=\"http://www.neopets.com/market_map.phtml\"><b>Marketplace</b></a>",
 41.                      "Chocolate is good.  Go to the <a href=\"http://www.neopets.com/objects.phtml?type=shop&amp;obj_type=14\"><b>Chocolate Factory</b></a> now to get some :)",
 42.                      "Have you tried the <a href=\"http://www.neopets.com/island/tradingpost.phtml\"><b>Island Trading Post</b></a> for some good deals?",
 43.                      "You can find food randomly over the site, it does happen, so keep trying!", "Did you know you can click on the shopkeeper to refresh the shop??",
 44.                      "Playing <a href=\"http://www.neopets.com/games/dicearoo.phtml\"><b>Dice-A-Roo</b></a> is a good way to get food!",
 45.                      "Out of food?  Why not try <a href=\"http://www.neopets.com/objects.phtml?type=shop&amp;obj_type=46\"><b>Hubert\'s Hot Dogs</b></a>???"];
 46.  var hintNumber = Math.ceil(Math.random() * (REDPTERIHINT.length - 1)); //Selects one of the phrases from the list above.
 47.   
 48.  var actpetmodule = cl(document,"sidebartable")[0]
 49.  var actpetname = tg(actpetmodule,"b")[0].textContent; //Reads the active pet's name, for use with never-used shops
 50.   
 51.  if (shopID == 6 || shopID == 19 || shopID == 33 || shopID == 52 || shopID == 64 || shopID == 65 || shopID == 115 || shopID >= 118){
 52.      shopName = "???";
 53.  //These sites were never used or could not be identified.
 54.  	shopGreeting = actpetname + " says, \'What is this place?\'";
 55.  	shopCaption = "I don\'t think we\'re supposed to be here. Let\'s go before something happens.";
 56.  	shopkeeperImage = "http://pets.neopets.com/cpn/" + actpetname + imgIsPet;
 57.  }
 58.  else if (shopID == 11){
 59.      shopName = "Video Store";
 60.  //This shop sold VHS tapes and merchandise in Neopia Central until February 28, 2001, where it closed presumably due to changing rules about what technology existed in Neopia. The items sold were turned into books and Usuki merchandise.
 61.  	shopGreeting = "Huh? A visitor?";
 62.  	shopCaption = "What? You want a video? Uh... I\'m really sorry, but I\'m retired. I don't sell those anymore.<br>If you want to stick around for a while and we can watch something, I like company, but...";
 63.  	shopkeeperImage = "http://images.neopets.com/shopkeepers/w11.gif" + imgNotPet;
 64.  //Interesting to note is that the shopkeeper image was the generic "sad" Red Lenny pose at the time, not a unique shopkeeper image.
 65.      }
 66.  else if (shopID == 28){
 67.      shopName = "Koi Foods";
 68.  //This food shop was destroyed with Old Maraqua on August 18th, 2001. The items it sold were retired.
 69.  	shopGreeting = "What brings you to the ruins?"
 70.  	shopCaption = "Huh? Me? Oh, I\'m just here to reminisce. I used to have a store in this spot...<br>I\'m actually the head chef at <a href=\"http://www.neopets.com/water/restaurant.phtml\">Kelp</a> now, though. I\'ll see you there!";
 71.  	shopkeeperImage = "http://images.neopets.com/shopkeepers/w28.gif" + imgNotPet;
 72.  }
 73.  else if (shopID == 29){
 74.      shopName = "Utility Fish";
 75.  //This shop, selling items originally intended for Classic Neohomes but never implemented, closed shortly before the destruction of Old Maraqua on August 14th, 2001.
 76.  	shopGreeting = "Do you have business here?"
 77.  	shopCaption = "Utility Fish? Oh, those old things? I gave those up as a failed project long ago.<br>I\'ve moved onto bigger and better inventions. My latest project is something called the \"3D Crabulator\"...";
 78.  	shopkeeperImage = "http://images.neopets.com/shopkeepers/w29.gif" + imgNotPet;
 79.  }
 80.  else if (shopID == 32){
 81.      shopName = "Apothecary";
 82.  //This shop sold mushrooms that raised a pet's stats, and closed sometime in 2001 presumably for balance reasons. I can't find a specific date.
 83.  	shopGreeting = "Mr. Coconut says, \'GOOD NIGHT!!!\'"
 84.  	shopCaption = actpetname + " whispers, \'I don\'t know what this thing is, but it gives me the creeps... let\'s get out of here.\'";
 85.  	shopkeeperImage = "http://images.neopets.com/shopkeepers/w32.gif" + imgNotPet;
 86.  }
 87.  else if (shopID == 99){
 88.      shopName = "Altador Cup Souvenirs";
 89.  //This shop existed during the first two Altador Cups.
 90.  	shopGreeting = "Oh, sorry! Looking in the wrong place."
 91.  	shopCaption = "I just watch the games now. Totally psyched for next year\'s Cup, aren\'t you? Which team you following?"
 92.  	shopkeeperImage = "http://images.neopets.com/shopkeepers/w99.gif" + imgNotPet;
 93.  }
 94.  else if (shopID == 109){
 95.      shopName = "Crumble and Twig";
 96.  //This shop was never used, but it was the one that came closest to opening. It was apparently intended for the Habitarium.
 97.  	shopGreeting = "Crumble says, \'Oh, hello!\'"
 98.  	shopCaption = "Shopkeeping wasn\'t for me. I just decided to raise Petpetpets myself. Adorable, aren\'t they?"
 99.  	shopkeeperImage = "http://images.neopets.com/shopkeepers/w109.gif" + imgNotPet;
 100. }
 101. else {
 102.     validShop = true; //This is a working shop ID. Skip the script.
 103.     };
 104.  
 105.     if (validShop === false){//If the shop isn't detected to be a real shop
 106. var newHTML = //What will actually be injected into the page.
 107. '<table width="100%" cellspacing="0" cellpadding="0" border="0"><tr><td align="left" valign="top"><div class="contentModule" style="height: 100%"><table cellpadding="3" cellspacing="0" border="0" class="contentModuleTable"><tr><td class="contentModuleHeader"> '+ shopName
 108. //This part creates the box with the black label that you see in the Neopian shops.
 109. + '</td></tr><tr><td align="left" valign="top" class="contentModuleContent">'
 110. //The stuff within the box.
 111. + '<div align="center"><br /><a href="objects.phtml?type=shop&obj_type=' + shopID + '\"><img src=\"' + shopkeeperImage + '</a><br>'
 112. //"Did you know you can click on the shopkeeper to refresh the shop?" I mean, there's not much point to here, but just a little detail.
 113. + '<b>' + shopGreeting + '</b><br>' + shopCaption + '<P><div align="center">Neopian Inflation is currently at <b>2.31%</b><br></div><BR>'
 114. //The message from the shopkeeper. Neopian inflation number is arbitrary because I've never had a clue what it means.
 115. + '</div></td></tr></table></div></td></tr></table><br /><hr><center>Sorry, but this shop has been removed from the site.</center><hr>'
 116. //"Sorry, we are sold out of everything! We get restocked every eight minutes or so, so please come back soon."
 117. + '<p><table align=center border=1 cellpadding=3 cellspacing=0><tr><td align=center bgcolor="#ffffee" colspan=2><b>NEOPETS HINT</b></td></tr><tr><td width=80 align=center valign=center><img src="http://images.neopets.com/pets/80by80/pteri_red_happy.gif" width=80 height=80 border=0></td><td width=220 align=center valign=center><i>' + REDPTERIHINT[hintNumber] + '</i></td></tr></table>';
 118. //Lastly, the hint box for the Red Pteri.
 119.  
 120. var pageTitle = "Neopets - " + shopName;
 121. document.title = pageTitle; // Sets the page title to match the shop in question.
 122.  
 123. pageArea.insertAdjacentHTML('beforebegin',newHTML); //The line that actually modifies the page, inserting the above into the point anchored at the start.
 124. }
 125.  
 126. })();