my code stock.com

Uunk nownn

PH | Pokemon Quick Profile
by Uunk nownn

Snippet options

Download: Download snippet as ph-pokemon-quick-profile.js.
Copy snippet: For this you need a free my code stock.com account.
Embed code : You will find the embed code for this snippet at the end of the page, if you want to embed it into a website or a blog!

// ==UserScript==
// @name         [Pokémon] Quick Profile
// @version      2.0.0
// @description  Add shortcuts to the profile
// @author       Iskandar
// @match        http://pokeheroes.com/pokemon?id=*
// @match        http://pokeheroes.com/pokemon.php?id=*
// @grant        none
// ==/UserScript==

// WARNING, CODE BELOW
var pkmn_id=/[0-9]+$/.exec(window.location);$("form").css({"text-align":"right",margin:"1em 0"});$("form").after("<form style='margin: 1em 0; width: 100%; text-align: right' method='post' id='set_gts'></form>");$("#set_gts").append("<strong>Set UP GTS:</strong> <input name='comment' placeholder='Comment here'> <input type='hidden' name='pkmn_id' value='"+pkmn_id+"'> <input type='submit' value='Create Trade'>");$("#set_gts").after('<form id="add_item" style="text-align: right;"></form>');var itemList=new Array();var itemAmount=new Array();$.get("bag.php",{},function(b){var a=0;$(b).find(".tabcontent table").each(function(){a++;if(a!=9&&a!=14){if($(this).find("th:eq(0)").text()=="#"){$(this).find("tr").each(function(){$(this).find("td:eq(1)").each(function(){itemList.push(this.innerText)});$(this).find("td:eq(3)").each(function(){if(/[0-9]+/.test(this.innerText)){itemAmount.push(this.innerText)}else{itemAmount.push($(this).prev().text())}})})}else{$(this).find("tr").each(function(){$(this).find("td:eq(0)").each(function(){itemList.push(this.innerText)});$(this).find("td:eq(2)").each(function(){itemAmount.push(this.innerText)})})}}})}).done(function(){$("#add_item").append("<strong>Select Item: </strong><select id='itemlist' name='itemname'></select><input type='hidden' name='pkmn_id' value='"+pkmn_id+"'> <input type='submit' value='Add Item'>");for(var a=0;a<itemList.length;a++){$("#itemlist").append('<option value="'+itemList[a]+'">'+itemList[a]+" ("+itemAmount[a]+"x)</option>")}});$("#set_gts").on("submit",function(a){a.preventDefault();$.post("gts_setup.php",{trade_pkmn:this.pkmn_id.value,trade_comment:this.comment.value},function(b){if(/Your Pokémon has been set up for trade successfully!/.test(b.trim())){$("#set_gts").html("<input style='width: 18em; text-align: center; padding: .32em;' type='text' onclick='this.select()' value='[url=gts_newoffer?id="+pkmn_id+"]here[/url]' readonly>")}else{alert($(b).find("#redfield").text())}})});$("#add_item").on("submit",function(b){b.preventDefault();var a=this.itemname.value;$.post("bag.php",{pkmn_select:this.pkmn_id.value,itemname:a},function(c){if($(c).find("#greenfield").length){$("#add_item").html("<input style='width: 18em; text-align: center; padding: .32em;' type='text' value='Done!' readonly>")}else{alert($(c).find("#redfield").text())}})});

Create a free my code stock.com account now.

my code stok.com is a free service, which allows you to save and manage code snippes of any kind and programming language. We provide many advantages for your daily work with code-snippets, also for your teamwork. Give it a try!

Find out more and register now

You can customize the height of iFrame-Codes as needed! You can find more infos in our API Reference for iframe Embeds.