Jump to content

Script for tf2outpost.com


klenium

Recommended Posts

Weird, it still shows ??? for all taunts, but if I mouseover them at the bottom of the info popup it says "suggested price 1.5 -3" or whatever. 

 

The backpack.tf link works, that right there is a godsend

Link to comment
Share on other sites

  • 2 weeks later...

Thanks for this script, it has saved me countless time ^_^
Looking through the code, I found a couple of bugs
 
on lines 336-337, the script goes:

//HHHH and Haunted Metal Scrap aren't unusual hats
    if (id[1] == 266 && id[1] == 267)

Perhaps you meant to use "||" ?
 
Additionally, links to bp stats for australium weapons don't work properly (line 748), and the link format is incorrect, causing the bp stats of uncraft items to redirect to the craft version; It can be fixed by changing the line to:

 

var link = "http://backpack.tf/stats/"+(id[2]== -11 ? "Strange/Australium " : quality+"/")+p[id[1]].name+"/"+trade+"/"+craft+(s == 0 ? "" : "/"+s);

 

Edit: Looks like australiums now have id[2]s of 11 as well. A fix would be:

var is_australium = i.find(".australium").length != 0;
var link = "http://backpack.tf/stats/"+(is_australium ? "Strange/Australium " : quality+"/")+p[id[1]].name+"/"+trade+"/"+craft+(s == 0 ? "" : "/"+s);

There is also a minor typo in the comment on line 671, my uncraft amby was listed as australium, and prices for some uncrafts weapons don't show up.
 
Finally, one suggestion would be to include the BBcode for qualities automatically, for the auto-notes, i.e.

case "1": q = "[color=#4D7455]Geniune[/color] "; break; 

However, these are only minor issues, and i'd like to thank you once again for making such a great and useful script! :D

Link to comment
Share on other sites

minor bug, bubble pipe shows it's effect as genteel smoke instead of the actual effect when adding into description automatically:)

 

"Fucking chad."

Link to comment
Share on other sites

Hey,

Today I tried to refresh the prices, then the script completely stopped working, might be due to the halloween update

 

 

At every subpage it shows this message:

 

Couldn't update the prices, because:
TypeError: Cannot read property 'length' of null

Link to comment
Share on other sites

Hey,

Today I tried to refresh the prices, then the script completely stopped working, might be due to the halloween update

 

 

At every subpage it shows this message:

 

Couldn't update the prices, because:

TypeError: Cannot read property 'length' of null

After much tinkering around, looks like it is indeed due to the 'ween update.

Some of the new items are missing defindexes, which causes the script to fail, when it tries to $.each() over the defindex

 

A fix would be to change line 125 to:

$.each(item.defindex||[], function()

This ensures that a length of 0 is passed instead of a null object when the defindex does not exist, allowing it to "silently fail"

 

Although I don't quite get why there's a need to $.each over the defindex, as items should only have one, same for prices/tradable/craftable etc.

 

Hopefully this fixes the problem for you :)

  • Like 2
Link to comment
Share on other sites

After much tinkering around, looks like it is indeed due to the 'ween update.

Some of the new items are missing defindexes, which causes the script to fail, when it tries to $.each() over the defindex

 

A fix would be to change line 125 to:

$.each(item.defindex||[], function()
This ensures that a length of 0 is passed instead of a null object when the defindex does not exist, allowing it to "silently fail"

 

Although I don't quite get why there's a need to $.each over the defindex, as items should only have one, same for prices/tradable/craftable etc.

 

Hopefully this fixes the problem for you :)

 

Regular key has 10+ defindexes.

Link to comment
Share on other sites

Regular key has 10+ defindexes.

 

From what I can see from a quick glance through the JSON data, all keys have only one, and unique defindexes, with the regular key having a defindex of 5021

But I see now, crates do sometimes have multiple defindexes, something that I suspected previously

In any case, hopefully OP will be able to update the script soon to fix the problem (and the others previously mentioned) :D

Link to comment
Share on other sites

After much tinkering around, looks like it is indeed due to the 'ween update.

Some of the new items are missing defindexes, which causes the script to fail, when it tries to $.each() over the defindex

 

A fix would be to change line 125 to:

$.each(item.defindex||[], function()

This ensures that a length of 0 is passed instead of a null object when the defindex does not exist, allowing it to "silently fail"

 

Although I don't quite get why there's a need to $.each over the defindex, as items should only have one, same for prices/tradable/craftable etc.

 

Hopefully this fixes the problem for you :)

 

This worked for me. Cheers

Link to comment
Share on other sites

From what I can see from a quick glance through the JSON data, all keys have only one, and unique defindexes, with the regular key having a defindex of 5021

Regular key has 14 defindexes (5021 and 13 other defindexes inherited from retired keys).

Link to comment
Share on other sites

After much tinkering around, looks like it is indeed due to the 'ween update.

Some of the new items are missing defindexes, which causes the script to fail, when it tries to $.each() over the defindex

 

A fix would be to change line 125 to:

$.each(item.defindex||[], function()

This ensures that a length of 0 is passed instead of a null object when the defindex does not exist, allowing it to "silently fail"

 

Although I don't quite get why there's a need to $.each over the defindex, as items should only have one, same for prices/tradable/craftable etc.

 

Hopefully this fixes the problem for you :)

 

 

Worked for me aswell, thank you.

Link to comment
Share on other sites

  • 1 month later...

Is there any way to change the bp.tf link/button to go to the backpack instead of profile page? I'm guessing it's somewhere in this

 

$(function()
{
//only in the main window, otherwise it would run 4 times (other scripts)
if (window.top != window.self)
return;
if (localStorage.data === undefined)
return update();
if (localStorage.lastupdate !== undefined && parseInt(localStorage.lastupdate) < ((new Date()).getTime()/1000)-(60*60*24*(parseFloat(localStorage.update) || 1)))
update();
if (/backpack/.test(location.href) && localStorage.links === undefined)
$(".navigation_bar .left").append('<li><a href="http://www.tf2outpost.com/user/'+($(".user_infostrong").html() == "—" ? $(".user_info").html().split("</span> ")[1] : $(".user_info strong").html())+'/resolve/backpack.tf">BP.TF Profile</a></li>');
checkReady(function()
Link to comment
Share on other sites

  • 1 month later...
  • 2 months later...

i logged into outpost today and im seeing the following error:

Couldn't update the prices, because:

TypeError: a is undefined

 

Im using Firefox with the greasemonkey add on. i installed the script from this site without any modifications. I have tried to resinstall greasemonkey and this script with the same outcome.

Please advise. thanks

Link to comment
Share on other sites

Looks like somewhat global error. I have it as well. (Chrome tho)

Oh hey, I was wondering about this. Worked great for a really long time, was wondering what was up.

Link to comment
Share on other sites

fff6282dae.png

I also seem to get that error everytime (using firefox btw). I've gotten used to it meanwhile though, since if you click out of the box, the box itself disappears.

Link to comment
Share on other sites

I also seem to get that error everytime (using firefox btw). I've gotten used to it meanwhile though, since if you click out of the box, the box itself disappears.

I use chrome. I dont get any prices at all.

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...