Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Trying to find a user's most recent match #48

Closed
ZacharyWix opened this issue Jul 21, 2021 · 1 comment
Closed

Trying to find a user's most recent match #48

ZacharyWix opened this issue Jul 21, 2021 · 1 comment
Labels

Comments

@ZacharyWix
Copy link

I'm trying to find a user's most recent match so I can check whether it was a win or a loss. I'm very new when it comes to python, so trying to do this is a little over my skill level in this language. So far what I have is,

from steam.client import SteamClient
from csgo.client import CSGOClient
from csgo.enums import ECsgoGCMsg
#from google.protobuf.json_format import MessageToDict
#import logging

#logging.basicConfig(format='[%(asctime)s] %(levelname)s %(name)s: %(message)s', level=logging.DEBUG)

client = SteamClient()
cs = CSGOClient(client)

@client.on('logged_on')
def start_csgo():
    cs.launch()

@cs.on('ready')
def gc_ready():
    # send messages to gc
    pass

client.cli_login()
client.run_forever()

cs.request_recent_user_games(XXXXXXXXXXXXX) #i put my user's steam id here
response, = cs.wait_event('recent_user_games')

print(str(response))

I'm currently just trying to retrieve the match list and print the most recent games, but no matter what I try I can't get it to print. Also, I'm unsure if I'm using the account_id correctly for cs.request_recent_user_games(). I'm also using the Steam Profile ID that you can find on your steam profile (17 numbers), but i don't know if I should be using something else. Does anyone know what I'm doing wrong here?

@rossengeorgiev
Copy link
Member

Looking at the docs, that method takes account id (32bit), if you are passing steam id (64 bit), then it won't work

cs.request_recent_user_games(SteamID('steamid or accountid').as_32)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants