Results 1 to 5 of 5

Thread: [buying]Subeta item Rarity

  1. #1
    zyocuh's Avatar
    Joined
    Jan 2012
    Posts
    105
    Userbars
    1
    Thanks
    5
    Thanked
    17/13
    DL/UL
    45/0
    Mentioned
    17 times
    Time Online
    2d 14h 57m
    Avg. Time Online
    N/A

    [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==
    // @(you need an account to see links) Subeta Shop Item Rarity Tooltips
    // @(you need an account to see links)space 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 ----------

    @(you need an account to see links) can you move this to Program/Source Request

  2. #2
    zyocuh's Avatar
    Joined
    Jan 2012
    Posts
    105
    Userbars
    1
    Thanks
    5
    Thanked
    17/13
    DL/UL
    45/0
    Mentioned
    17 times
    Time Online
    2d 14h 57m
    Avg. Time Online
    N/A
    Bamp paying USD please comment or ping

  3. #3
    Zachafer's Avatar
    Joined
    Dec 2011
    Posts
    1,235
    Userbars
    11
    Thanks
    769
    Thanked
    1,466/678
    DL/UL
    98/0
    Mentioned
    512 times
    Time Online
    24d 13h 9m
    Avg. Time Online
    8m
    I fixed half of it, I'll continue working on it.

  4. #4
    zyocuh's Avatar
    Joined
    Jan 2012
    Posts
    105
    Userbars
    1
    Thanks
    5
    Thanked
    17/13
    DL/UL
    45/0
    Mentioned
    17 times
    Time Online
    2d 14h 57m
    Avg. Time Online
    N/A
    Awesome well how much were you looking if you want to PM you can I also dont mind public

  5. #5
    zyocuh's Avatar
    Joined
    Jan 2012
    Posts
    105
    Userbars
    1
    Thanks
    5
    Thanked
    17/13
    DL/UL
    45/0
    Mentioned
    17 times
    Time Online
    2d 14h 57m
    Avg. Time Online
    N/A
    @(you need an account to see links) 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
  •