Results 1 to 5 of 5

Thread: [buying]Subeta item Rarity

  1. #1
    zyocuh's Avatar
    Join Date
    Jan 2012
    Gender
    Posts
    109
    Thanks
    4
    Thanked 15 Times in 11 Posts


    Downloads
    45
    Uploads
    0
    Mentioned
    17 Post(s)
    Time Online
    2 d 13 h 10 m
    Avg. Time Online
    1 m
    Rep Power
    6

    [buying]Subeta item Rarity

    I found this code on userscript.org but it got deleted and no longer works, would anyone be able to tweak it to get it working? it is for Subeta main shops checking the rarity of all the items and giving them a glowing border
    [please PM if you have questions and to talk about price]

    // ==UserScript==
    // @name Subeta Shop Item Rarity Tooltips
    // @namespace Shaun Dreclin
    // @include *subeta.net/shop.php*
    // ==/UserScript==

    //A big thank-you to pagewil on stackoverflow.com for this asynchronous for loop!
    var asyncLoop = function(o){
    var i=-1, length = o.length;
    var loop = function(){
    i++;
    if(i==length){o.callback(); return;}
    o.functionToLoop(loop, i);
    }; loop();
    };

    var itemName; var itemNameTooltip; var rarityName; var rarityColor;
    asyncLoop({ length: document.getElementsByTagName('img').length, functionToLoop: function(loop, i){ setTimeout(function(){
    try {
    if(document.getElementsByTagName('img')[i].style.border == "1px solid black" || document.getElementsByTagName('img')[i].style.border == "1px solid white") {
    itemName = document.getElementsByTagName('body')[0].innerHTML.split(document.getElementsByTagName('im g')[i].src);
    itemName = itemName[1].split("");
    itemName = itemName[0].split("\n");
    itemName = itemName[2];
    while(itemName.indexOf(String.fromCharCode(9)) != -1) { itemName = itemName.replace(String.fromCharCode(9), ""); }

    document.getElementsByTagName('img')[i].style.opacity = "0.25";
    document.getElementsByTagName('img')[i].style.border = "1px solid white";

    GM_xmlhttpRequest({
    method: "GET",
    url: "http://subeta.net/hover_item.php?name=" + escape(itemName),
    onload: function(response) {
    itemNameTooltip = unescape(this.url.split("=")[1]);

    rarityName = response.responseText.split("'>");
    rarityName = rarityName[2].split("");
    rarityName = rarityName[0];

    rarityColor = rarityName;
    rarityColor = rarityColor.replace("Really Common", "999999");
    rarityColor = rarityColor.replace("Mundane", "666666");
    rarityColor = rarityColor.replace("Common", "333333");
    rarityColor = rarityColor.replace("Normal", "000000");
    rarityColor = rarityColor.replace("Super Rare", "dd00ff");
    rarityColor = rarityColor.replace("Rare", "0099ff");
    rarityColor = rarityColor.replace("Retired", "6da877");

    for(j in document.getElementsByTagName('img')) {
    try {
    if(document.getElementsByTagName('img')[j].style.border == "1px solid white") {
    itemName = document.getElementsByTagName('body')[0].innerHTML.split(document.getElementsByTagName('im g')[j].src);
    itemName = itemName[1].split("");
    itemName = itemName[0].split("\n");
    itemName = itemName[2];
    while(itemName.indexOf(String.fromCharCode(9)) != -1) { itemName = itemName.replace(String.fromCharCode(9), ""); }

    if(itemName == itemNameTooltip) {
    document.getElementsByTagName('img')[j].style.opacity = "1.0";
    document.getElementsByTagName('img')[j].style.border = "2px solid #" + rarityColor;
    if(rarityName == "Rare" || rarityName == "Super Rare" || rarityName == "Retired") {
    document.getElementsByTagName('img')[j].style.boxShadow = "0px 0px 50px #" + rarityColor;
    }
    document.getElementsByTagName('img')[j].title = "Rarity: " + rarityName;
    }
    }
    } catch(e) { }
    }
    }
    });
    }
    } catch(e) { }
    loop(); },1); }, callback: function(){ /* Done! */}});


    ---------- Post added at 07:14 PM ---------- Previous post was at 05:16 PM ----------

    @Infamous Joe can you move this to Program/Source Request

  2. #2
    zyocuh's Avatar
    Join Date
    Jan 2012
    Gender
    Posts
    109
    Thanks
    4
    Thanked 15 Times in 11 Posts


    Downloads
    45
    Uploads
    0
    Mentioned
    17 Post(s)
    Time Online
    2 d 13 h 10 m
    Avg. Time Online
    1 m
    Rep Power
    6
    Bamp paying USD please comment or ping

  3. #3
    Little Brother


    Zachafer's Avatar
    Join Date
    Dec 2011
    Gender
    Posts
    1,206
    Thanks
    723
    Thanked 1,392 Times in 651 Posts


    Downloads
    81
    Uploads
    17
    Mentioned
    497 Post(s)
    Time Online
    21 d 17 h 32 m
    Avg. Time Online
    16 m
    Rep Power
    14
    I fixed half of it, I'll continue working on it.

  4. #4
    zyocuh's Avatar
    Join Date
    Jan 2012
    Gender
    Posts
    109
    Thanks
    4
    Thanked 15 Times in 11 Posts


    Downloads
    45
    Uploads
    0
    Mentioned
    17 Post(s)
    Time Online
    2 d 13 h 10 m
    Avg. Time Online
    1 m
    Rep Power
    6
    Awesome well how much were you looking if you want to PM you can I also dont mind public

  5. #5
    zyocuh's Avatar
    Join Date
    Jan 2012
    Gender
    Posts
    109
    Thanks
    4
    Thanked 15 Times in 11 Posts


    Downloads
    45
    Uploads
    0
    Mentioned
    17 Post(s)
    Time Online
    2 d 13 h 10 m
    Avg. Time Online
    1 m
    Rep Power
    6
    @Zachafer were you able to make any more progress

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •