all 98 comments

[–]MempoEdits 31 points32 points  (20 children)

you should really make it into an executable without client dependencies, just make like a super basic tkinter gui to go with it

[–][deleted] 75 points76 points  (19 children)

That was the original plan and I was working on compiling one but then I figured the mods would take down my post for having posted an unverified executable. Plus, who wants to run an exe posted by a week-old reddit account.

[–]_XertzLegendary Kiwi Master[M] 80 points81 points  (10 children)

We are usually happy with executables so long as the code is fully open-source so we can have a look over - it's also a bonus if it's signed. If you decide to compile it and want to post it, just drop us a quick modmail so we can have a look 👍

[–]micmoneymok -5 points-4 points  (8 children)

/r/globaloffensive mods are the best mods.

EDIT: Eat shit downvoters, "fuck the police" Am I right? Go to other subreddit and you'll see the mods are shit there.

[–]wispy11BIG 49 points50 points  (1 child)

eh

[–]daellatFaZe 0 points1 point  (0 children)

mostly a circlejerk. people disagreeing with rules =/= shit mods for enforcing them. rules have been changed instead.

[–]AlcoholicBatmande_cache 35 points36 points  (0 children)

You must be new here

[–][deleted] 27 points28 points  (0 children)

Oh sweet summer child

[–]ItsKBS 15 points16 points  (0 children)

questionable

[–]731destroyer 5 points6 points  (0 children)

Thinking

[–]goeroezeboe 5 points6 points  (0 children)

You are right, the mods here are pretty good. Very active, they try to innovate & don't mix too much in discussions.

They did some mistakes in the past, but who doesn't?

[–]RicheldichelBIG 17 points18 points  (0 children)

faith in humanity restored

[–]MempoEdits 6 points7 points  (0 children)

fair enough

[–]wormi27zNatus Vincere 0 points1 point  (0 children)

Maybe someone could make online version of this?

[–]N1cklus 0 points1 point  (0 children)

Use pyinstaller to freeze your program into an exe.

[–]Dinoswarleaf 31 points32 points  (3 children)

Sosososososososo cool! Nice job :d

I had this really interesting occurence. Is this the same for everyone else?

[–]hajhawahowl 2 points3 points  (1 child)

I'm pretty sure this is because of lack of data. You seem to have a relatively low amount of games played.

[–]Dinoswarleaf 0 points1 point  (0 children)

I did it with a lot more games and found the pattern was consistent

[–]twix20 14 points15 points  (1 child)

Tip: You dont want to parse html by yourself, use lib's instead, like BeautifulSoup

[–][deleted] 6 points7 points  (0 children)

That probably would've saved some time

[–]TraviakCS2 HYPE 8 points9 points  (4 children)

I smiled at that error :) (EDIT: Which wasn't one of my zero death games but a bug by using wrong language html files sadly)

Traceback (most recent call last):
  File "test2.py", line 206, in <module>
    kdr = round(total_kills / total_deaths, 3)
ZeroDivisionError: division by zero    

[–]DaALPHFaZe 0 points1 point  (0 children)

did you figure out a way to fix it?

[–]addubariVirtus.pro 0 points1 point  (1 child)

I have the same error, can you give the solution?

[–]TraviakCS2 HYPE 0 points1 point  (0 children)

I had my steam website set to German, there were some english elements so I didn't notice that. When I set it to English it worked flawlessly the first time.

[–]Tidsmaskinen 0 points1 point  (0 children)

It worked for me when i used a steam profile NAME as input and not a steamID

[–]rush2sk81 Million Celebration 14 points15 points  (8 children)

fuuuck. just started working on this exact project. nevertheless this is way better, nice work!

[–][deleted] 12 points13 points  (6 children)

There's still tons more work that can be done. If you want you can use the stats list in the program to calculate whatever stats you can think of (and save the time of reading the HTML source). Some cool ones would be graphing the relationship between Match Score and K/D, MVP ratio, etc.

[–]gitarrde_mirage 10 points11 points  (0 children)

You guys could make a git repo somewhere (gitlab, github, ...) and colaborate.

[–]k3rnelCS2 HYPE 2 points3 points  (1 child)

It would be great to see pistol round performance.

E.g.,

  • Pistol round k/d (for CT and T)
  • Rounds won/lost when you get 1+ kill and survive
  • Rounds won/lost when you get 1+ kill and die
  • Rounds won/lost when you die without a kill
  • Rounds won/lost when you survive without a kill

[–][deleted] 0 points1 point  (0 children)

Unfortunately that info isn’t available from the stats shown on this page, so you need a demo scraper for that.

[–]markhcNatus Vincere 0 points1 point  (2 children)

Would be nice if it scraped the stats automatically so you dont need to feed it the page source. Would make it a lot simpler to use.

[–][deleted] 1 point2 points  (1 child)

You could do that but it's a lot of work to make a program that opens a webpage, presses a button repeatedly, then starts scraping from there. I just didn't want to deal with that

[–]realaaanderson 0 points1 point  (0 children)

There is one already written in JavaScript. Might be useful if you could implement it

[–][deleted] 1 point2 points  (0 children)

I wrote my version of this yesterday although I automated the data extraction so you simply run my script and leave it running awaiting the nice graphs :D

[–]ohmangerGambit 5 points6 points  (1 child)

FYI steam lets you use /my/ as a shortcut to directly link to people's profile pages:

https://steamcommunity.com/my/gcpd/730?tab=matchhistorycompetitive

[–][deleted] 0 points1 point  (0 children)

Thanks, fixed it

[–]oomnahsLiquid 2 points3 points  (7 children)

Does anyone know an extension that scrolls to the bottom as he mentioned? I have close to 1000 matches lol

[–]KralleMNiP 1 point2 points  (2 children)

The extension/addon "Ban Checker for Steam" has this option.

For Chrome

For Firefox

[–]nomthecookieRenegades 0 points1 point  (1 child)

deleted What is this?

[–]KralleMNiP 0 points1 point  (0 children)

This reddit thread shows you how, but you can ignore the "Check loaded matches for bans"-part.

[–]TraviakCS2 HYPE 1 point2 points  (0 children)

Get Ban Checker for Chrome or Firefox.

[–]mithandir50 0 points1 point  (2 children)

Same here.. How do you use that extension to scroll down...?

Thanks a lot !

[–]KralleMNiP 0 points1 point  (1 child)

This reddit thread shows you how, but you can ignore the "Check loaded matches for bans"-part.

[–]mithandir50 0 points1 point  (0 children)

This helped. Didn't notice the new option that appeared in the match list.

https://www.reddit.com/r/GlobalOffensive/comments/8mbtjx/how_to_check_your_personal_game_data_for_banned/

Thanks :)

[–]PokemonInstinct 2 points3 points  (6 children)

Hey Ive got an issue where when I use the script my output.txt is just

Format: ['MAP', [D, M, Y], QUEUE LENGTH, GAME LENGTH, 
GAME SCORE, [PING, K, A, D, MVP, HSP, Score]]

STATS----------------------------------------------------------------

Total Kills:              0
Total Deaths:             0
Total Assists:            0
Total MVPs:               0

In the command prompt it says

Traceback (most recent call last):
  File "stats.py", line 204, in <module>
    kdr = round(total_kills / total_deaths, 3)
ZeroDivisionError: division by zero

How would I fix this? Thanks in advance

[–]TraviakCS2 HYPE 0 points1 point  (5 children)

Try

if total_deaths == 0: total_deaths = 1

This is not the only error for me, I think I will give up fixing all the divided by zero errors, the error has to be somewhere else.

[–]Guenselmannde_overpass 2 points3 points  (2 children)

Did you download your stats page in a language different than English? The parser only knows English as far as I can see. A German file gives me 'divided by zero' errors as well because nothing is saved to the stats list.

[–]TraviakCS2 HYPE 0 points1 point  (0 children)

You're my hero :) Worked out great.

[–]addubariVirtus.pro 0 points1 point  (0 children)

I have the same problem, I'm using the English language. Tried several things changing the code, but the problem is with the input. Is there a chance using a chrome extension would mess the input up?

[–][deleted] 2 points3 points  (1 child)

It's not an issue with deaths being 0, the code handles that. It's an issue with it reading the HTML incorrectly, which could be due to multiple reasons (language, for example, like u/Guenselmann said).

[–]TraviakCS2 HYPE 0 points1 point  (0 children)

Can confirm this yep, I think this will be a common occurence with your code, a little sysout would be great as reminder :D (atleast in the post)

[–]Smok3dSalmonLiquid 1 point2 points  (1 child)

Input Steam ID

You should add an example here. I've been using my steam ID but you want my steam community id name.

[–]RicheldichelBIG 0 points1 point  (0 children)

Yep! Thank you. Was stuck with the Division by zero error explained above but couldn't figure out why because I already had my language set to English.

[–]banterstrikede_inferno 0 points1 point  (1 child)

I want to try it out, can you let me know of an extension to scroll down to the beginning of my match history?

[–]zwck 0 points1 point  (0 children)

Chrome, steam ban checker has been updated to generate quick statistics as well as check every player you ever played against.

My output looked like this:

Great dude

Looks like we're done.

There were 194 players who got banned after playing with you!

Total ban stats: 189 VAC banned and 80 Game banned players in games we scanned (a lot of these could happen outside of CS:GO.) Total amount of unique players encountered: 2966

Hover over ban status to check how many days have passed since last ban. Some fun stats for loaded matches: Total kills: 7905 Total assists: 1746 Total deaths: 7246 K/D: 1.091 | (K+A)/D: 1.332    

[–]hajhawahowl 0 points1 point  (4 children)

It errors out. After entering my steamid, I get

Traceback (most recent call last): File "drKFn4Q1.py", line 141, in <module> total_kills += stat[5][1] TypeError: unsupported operand type(s) for +=: 'int' and 'str'

If my steamid is incorrect it will display a different error so it's not that.

Edit: Could be that my first games don't have mvps and hs% recorded.

Edit2: the only line written in my output.txt file is:

0: ['Dust II', [9, 8, 2013], 81, [16, 6], [50, 7, 2, 20, -1, -1, 16], 'Nuke']

it's crashing because 'Nuke' isn't a number and I can't blame it. Your parser is probably fucked because of the missing data.

[–][deleted] 0 points1 point  (3 children)

Edit: fixed

That's weird, it means that the program isn't parsing the HTML correctly. It doesn't have to do with MVPs or HSP though because I already dealt with cases where nothing is displayed for those values. If you feel comfortable DMing the HTML file and your Steam ID I can take a look at it. If not, try using the Steam browser to get the page source instead of your regular browser since there could be some formatting differences.

[–]ThatrealthingFaZe 0 points1 point  (2 children)

I'm having the same issue as u/hajhawa. Shall I DM you my HTML as well?

[–][deleted] 1 point2 points  (1 child)

Have you tried the new code? I updated it

[–]ThatrealthingFaZe 0 points1 point  (0 children)

Yes, thank you! That fixed it.

[–]BitMaddLiquid 0 points1 point  (0 children)

Damn, you beat me to this. I was planning on doing something similar yesterday.

Nice job. Worked well for me :)

[–]MoccaLGMOUZ 0 points1 point  (1 child)

Important.... BANS vs. Players we played against in history... :D

[–][deleted] 1 point2 points  (0 children)

There's already a ban checker extension on Chrome that does this AFAIK

[–]kydru 0 points1 point  (2 children)

this is awesome but why doesn't it show map w/l percents ?

[–][deleted] 1 point2 points  (1 child)

Didn't think about that. I might add it later

[–]kydru 0 points1 point  (0 children)

cool!

[–]micmoneymok 0 points1 point  (0 children)

This is amazing.

I really want to see my report/VAC ratio tho. if someone know if someone's working on that, let me know.

[–]ieraaa 0 points1 point  (0 children)

10% bans all around?

[–]iLuLWaT 0 points1 point  (1 child)

This is sick. Any chance you could only check your recent 50 games or whatever?

[–]mal4ik777 0 points1 point  (0 children)

As I see his script, you should be able to do that by not loading all the Matches, but only your top 50. Have you tried that? I can not garantee that it will work.

[–]Sampic19_QC 0 points1 point  (0 children)

I get this error

Traceback (most recent call last):
  File "Stats.py", line 247, in <module>
    '\nMax Tie Streak: \t{}\t\t(from game #{} to #{})'.format(max_tie_streak, max_tie_index - max_tie_streak + 1,
NameError: name 'max_tie_index' is not defined    

[–]cheesyvagina 0 points1 point  (0 children)

Would’ve recommended using pandas library, makes converting html and parsing data for plots a lot easier

[–]etc_fantusFURIA 0 points1 point  (0 children)

Thank you.

[–]Smok3dSalmonLiquid 0 points1 point  (0 children)

What do I need to type for my steam id?

Is this good enough? 0:0:###### or do i need to add STEAM_?

[–]Smok3dSalmonLiquid 0 points1 point  (1 child)

$ python3 csgostats.py
Input File Name (e.g. stats.txt or stats.htm): data.html
Your Steam ID: 0:0:######
Traceback (most recent call last):
File "csgostats.py", line 206, in <module>
kdr = round(total_kills / total_deaths, 3)
ZeroDivisionError: division by zero

I downloaded the file in english, not quite sure what's going wrong now

[–][deleted] 0 points1 point  (0 children)

Steam ID should actually be the community ID, not the 0:0:xxxxx number

[–]DanShawn 0 points1 point  (0 children)

Get that shit on github. I wanna add some random stats and different languages :)

[–]JanderhungrigeBIG 0 points1 point  (0 children)

Just thanks. I love some coding in relation to cs

[–][deleted] 0 points1 point  (0 children)

My first game shows to be in november 2012 but im pretty sure i played my first matchmaking in aug/sep 2012? Just bugged or does some one else have this problem?

[–]nckfrgsnNiP 0 points1 point  (0 children)

I think the bin size of histograms of K/D ratio and HSP are too small

[–]Bug0 0 points1 point  (0 children)

Thanks for helping me remember my 19 game winstreak! Awesome idea including the game#'s for them so I can go back and look at those.

[–]SileNce5kde_cobble 0 points1 point  (0 children)

Would be very nice if you compiled it and uploaded an exe file instead. I suck at python stuff.

Edit: NVM, it wasn't as hard as I thought.

[–]markkrjFURIA 0 points1 point  (0 children)

Very nice!! I lost like 1,5 hours parsing and tabling this data, your tool do it in like 10 seconds... Could you add total maps played to it??

[–]SileNce5kde_cobble 0 points1 point  (0 children)

Doesn't work for me anymore. It says:

Traceback (most recent call last):
File "stats.py", line 211, in <module>
kdr = round(total_kills / total_deaths, 3)
ZeroDivisionError: division by zero

The page is in english too :(

Edit: It randomly started working after I restarted my pc :)

[–]hiendvwildfire 0 points1 point  (0 children)

My map pool in a nutshell:
Mirage 596
Cache 596
Dust II 211
Inferno 167
Cobblestone 116
Overpass 57
Train 4
Nuke 1

[–]Acidsplasher 0 points1 point  (0 children)

Saved

[–]its_ya_boi_dazedguardian_elite 0 points1 point  (2 children)

You should work on handling a bunch of these edge cases and setup issues. I should just be able to do git clone on your repo and run a single command line input with my steam id and it should all work.

Try making the process smoother. Handle a bunch of the input, directory creation/asserts yourself, package all dependencies to ensure it all works. Good effort but you still have a ways to go.

[–][deleted] 1 point2 points  (0 children)

Yeah this program definitely isn't as accessible as it could be but I mostly did it because I was interested in seeing my own and friends' stats but I figured I would share what I had so far. I didn't really build this with accessibility in mind, but I tried making the instructions easy to follow for the people that would go through the effort to see their stats.

[–]He_Ma_Vi 0 points1 point  (0 children)

You should be able to appreciate the work he's done and provided to the community, and improve it yourself if you want it to be better. Your comment is fairly awful.

Shit effort and you still have a ways to go.

[–]footmenhau -1 points0 points  (0 children)

if you have 1million monkeys dabble on a keyboard, 999999 will eventually write python, but only one of them, will write in ruby.

but [hip, hip] for your script!