Jump to content
klenium

Script for tf2outpost.com

Recommended Posts

The Recluse

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

Share this post


Link to post
Share on other sites
Thanatos

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

Share this post


Link to post
Share on other sites
Enohka

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

 

"Fucking chad."

Share this post


Link to post
Share on other sites
BlueRain

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

Share this post


Link to post
Share on other sites
Thanatos

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 :)

Share this post


Link to post
Share on other sites
HusKy

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.

Share this post


Link to post
Share on other sites
Thanatos

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

Share this post


Link to post
Share on other sites
Pyrocide

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

Share this post


Link to post
Share on other sites
HusKy

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).

Share this post


Link to post
Share on other sites
BlueRain

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.

Share this post


Link to post
Share on other sites
The Recluse

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()

Share this post


Link to post
Share on other sites
HusKy

I think you can't since the script uses the profile resolver provided by TF2OP and that only links to profiles.

Share this post


Link to post
Share on other sites
Cooyon

Just a little mistake: your script writes "Geniune" instead of "Genuine".

Thanks a lot for this awesome script! :)

Share this post


Link to post
Share on other sites
Frankies Fifth Finger

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

Share this post


Link to post
Share on other sites
ShadowMan

-snip-

 

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

Share this post


Link to post
Share on other sites
SHDW thealexander152

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.

Share this post


Link to post
Share on other sites
harsheldon

getting error: Couldn't update the prices, because:
TypeError: a is undefined

Share this post


Link to post
Share on other sites
Woifi The Viking

getting error: Couldn't update the prices, because:

TypeError: a is undefined

fff6282dae.png

Share this post


Link to post
Share on other sites
Betasecret

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.

Share this post


Link to post
Share on other sites
Woifi The Viking

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.

Share this post


Link to post
Share on other sites
ShadowMan

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

 

I get the prices, however this error every page load \ F5 is... annoying

Share this post


Link to post
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...