Jump to content

[script] The History Bastard


naknak

Recommended Posts

Download latest version: History Bastard.v1.92.user.js.txt
 
I made this so that I could look at my inventory history and discern wtf was going on.

  • sort items with currency first, then by quality
  • remove duplicated items, show count instead
  • replace custom item names with canonical name
  • show item properties (effect, paint, sheen, parts, giftedness, etc.) alongside item name
  • highlight held trades, summarize their contents at top of page
  • load the second page too, when on page 1 (because held trades were falling off the first page)
  • use the entire page instead of a tiny narrow strip of it down the middle
  • add bp.tf links to user names
  • (NEW in 1.3!) accumulate metal into a total like "5.33" instead of counting each grade of metal separately
  • (NEW in 1.3!) optional sorting of held trades first, set SHOW_HELD_FIRST true to enable
  • (NEW in 1.4!) get text log of any trade by clicking the little [text] button
  • (NEW in 1.5!) toggle display of all (default) or held trades only
  • (NEW in 1.6!) filter trades by keyword, kind of like bp.tf's backpack item filter!

Screenshots:
Summary of held trades, counting of metal and other duplicated items, item properties:

bhFpdbE.png


Filtering by keyword:

v17zK2y.png


Text summary of a complex trade:

acteLV1.png


 
Install:

  • get Chrome
  • get Tampermonkey
  • save the attached file to disk History Bastard.v1.92.user.js.txt
  • open txt file in a UTF-8 safe editor (if in doubt, Ctrl-F StatTrak and it should be followed by TM).  Select All, Copy.
  • Go to Tampermonkey Dashboard, click the green + icon and Paste (overwrite the stuff that is there already).  See Oddball's post below this one for pics.  Click Save.
  • look your history http://steamcommunity.com/my/inventoryhistory/

FAQ:








Q: Firefox?

A: I don't know if it's just me but Scriptish and Greasemonkey are broken when it comes to interacting with js data on the page (like the giant array that holds item properties).  Googling the problem brings up a bunch of stupid workarounds that don't.  If someone can figure it out, please share with the class.

 

Q: non-TF2?

A: I do a little CSGO and game trading, so it's tested with those a little bit.  It should look okay.  The listed properties may be excessive and item images will get squished to TF2 dimensions.

 

Q: This is really confusing?

A: I dunno man. 

 

Q: it's slow?

A: Most of the delay is loading the second page which I can't speed up.  Set LOAD_SECOND_PAGE=false;  at the top of the script if you don't mind an incomplete summary of items on-hold.

 

Q: what is the little number in green?

A: that's the total number of items in that side of the trade.

 

Q: I can't paste trades into notepad anymore because you removed the commas?

A: I know, this kind of sucks.  Micromanaging the comma soup that results from deduplication turns out to be slow so I just removed them all.  When I do need to put a trade in notepad, I turn off the History Bastard.(NEW in 1.4!) get text log of any trade, suitable for paste into an editor or spreadsheet, by clicking the little [text] button!

 

Q: Hover/properties don't work on the bottom half of page 1 (the next 30 trades)?

A: Yes.  The data needed for that gets thrown away when page 2 is loaded.  It's unclear to me how to make it work.  If some javascript wizard wants to fix it, that would be neat.Page 2 item properties work in v1.9. Hover can be made to work, I think, but I never really use hover anymore so it's not a priority.

 

Q: Hover doesn't work in the held items summary?

A: No idea how to fix this either.

 

Q: this script stole my inventory / got me tradebanned / left bacon cooking on my stove?

A: I doubt it, because I use this script and nothing bad happened to me.  But it's not my problem.  The script interacts with a logged-in steam page and, hypothetically, could do anything that a logged-in browser could do.   I suggest to examine any kind of browser script you install.  This one does not auto-update, so if I get hacked you won't also get hacked.

 

Changelog:






v1.1: bugfix page 2 URL to HTTPS so that https page doesn't throw "insecure endpoint" error
v1.2: bugfix  fetch page 2 with same protocol as page 1
v1.3: mark the boundary between page 1 & 2; only load pg2 if page 1 lacks 72 hours of history; accumulate metal counts; SHOW_HELD_FIRST option
v1.4: include levels in description; given items can wrap to next line now; sort by name if quality is equal; text-only trade log popups; warn if some held trades might be on the next page
v1.5: dedup everything; fix metal rounding so .99=1.00; text log aesthetics, button to show only held trades, fix 2nd page url when current page ends in "#"
v1.6: filter by keyword
v1.7: mention hours remaining on each held trade; include outgoing items in summary; bugfix warning on <72h of history available; readability tweaks
v1.8: bugfix trade hold ending in different year than current year
v1.9: page 2 properties work
v1.91: bugfix filter box

v1.92: more readable hold-timer countdowns; continuous update of timers



 

Link to comment
Share on other sites

Why is your .js file a txt? It wont parse when you import it. Copy the actual contents into tapermonkey's built in editor, and save.

WGSMk.png (built in editor button)

 

ENSvt.png (to save it to scripts)

 

http://oddball.tf/img/pp5Wc.js copy this entire document (ctrl+a) and paste it into the built in editor.

 

Should look like this:

 

SgCXJ.png

Don't worry about the errors.

Link to comment
Share on other sites

Wow!  Nice work, what an awesome script!  Thanks for sharing :P

 

I haven't tried it yet but I will soon.  Can it also maybe search the first 2 pages for trades in escrow and bunch all of those together for you to see? (so you can keep track of exactly which items of your's and your partner's are in escrow at a given time)

Link to comment
Share on other sites

Why is your .js file a txt? It wont parse when you import it. Copy the actual contents into tapermonkey's built in editor, and save.

 

Forums won't let me attach a .js file.  It should work if renamed to .js.

 

EDIT: no, import is just broken.  Open the txt in notepad and paste the contents into a new user script, like Oddball says

 

EDIT2: Oddball's link has mangled UTF8 characters.   Don't use that ^_^

Link to comment
Share on other sites

I haven't tried it yet but I will soon.  Can it also maybe search the first 2 pages for trades in escrow and bunch all of those together for you to see? (so you can keep track of exactly which items of your's and your partner's are in escrow at a given time)

It does exactly this. Or am I misunderstanding?  It highlights the escrowed trades yellow-gray (see screenshot: the first trade is a normal one and the second is held) so they are easy to pick out if you want details like partner's name and time of release.

Link to comment
Share on other sites

It does exactly this. Or am I misunderstanding?  It highlights the escrowed trades yellow-gray (see screenshot: the first trade is a normal one and the second is held) so they are easy to pick out if you want details like partner's name and time of release.

Ohh, I thought the second screenshot was part of the first.  It didn't say in text on the OP that it exclusively showed escrow trades first and not regular ones.

Link to comment
Share on other sites

okay I see what you mean.  It doesn't do that (reordering trades), just summarizes all the escrowed items at the top.   I personally wouldn't use that but maybe I can add it as an option.

Link to comment
Share on other sites

 Can it also maybe search the first 2 pages for trades in escrow and bunch all of those together for you to see?

 

There's an option for this in v1.3 (OP updated), set SHOW_HELD_FIRST to true and all the held trades will show at the top.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

  • Recently Browsing   0 members

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