ValvePython / steam

☁️ Python package for interacting with Steam
http://steam.readthedocs.io
MIT License
1.11k stars 147 forks source link

Changing Steam Accounts for different games #336

Closed Cintox closed 3 years ago

Cintox commented 3 years ago

Changing Steam Accounts for different games

Hello everyone,

Lately I've been trying to create a python script which automatically changes the steam account depending on which game I want to play. To do so I've decided to use this module here. My Python skills aren't the best because I usually use Java or C#. In order to test this module I decided to print out the username of the current logged in steam user.

Here's my code:

https://hastebin.com/etacujaraz.rb

If I execute the code, I get the following errors:

"C:\Program Files\Python38\python.exe" D:/Development/ProgrammExecutor/main.pyw
Traceback (most recent call last):
  File "D:/Development/ProgrammExecutor/main.pyw", line 61, in <module>
    window()
  File "D:/Development/ProgrammExecutor/main.pyw", line 56, in window
    win = MyWindow()
  File "D:/Development/ProgrammExecutor/main.pyw", line 15, in __init__
    self.initUI()
  File "D:/Development/ProgrammExecutor/main.pyw", line 26, in initUI
    self.label2.setText("Du bist aktuell als " % client.user.name % " eingeloggt.")
AttributeError: 'NoneType' object has no attribute 'name'

Process finished with exit code 1

Does anyone know what I have to do in order to fix the problem?

Cintox commented 3 years ago

Additionally I've tried to execute this test code, but it didn't worked for me either.

from steam.client import SteamClient
from steam.enums.emsg import EMsg

client = SteamClient()

@client.on(EMsg.ClientVACBanStatus)
def print_vac_status(msg):
    print("Number of VAC Bans: %s" % msg.body.numBans)

client.cli_login()

print("Logged on as: %s" % client.user.name)
print("Community profile: %s" % client.steam_id.community_url)
print("Last logon: %s" % client.user.last_logon)
print("Last logoff: %s" % client.user.last_logoff)
print("Number of friends: %d" % len(client.friends))

client.logout()

I don't get any errors with this code, but when I enter the username the script won't go on.

Cintox commented 3 years ago

Additionally I've tried to execute this test code, but it didn't worked for me either.

from steam.client import SteamClient
from steam.enums.emsg import EMsg

client = SteamClient()

@client.on(EMsg.ClientVACBanStatus)
def print_vac_status(msg):
    print("Number of VAC Bans: %s" % msg.body.numBans)

client.cli_login()

print("Logged on as: %s" % client.user.name)
print("Community profile: %s" % client.steam_id.community_url)
print("Last logon: %s" % client.user.last_logon)
print("Last logoff: %s" % client.user.last_logoff)
print("Number of friends: %d" % len(client.friends))

client.logout()

I don't get any errors with this code, but when I enter the username the script won't go on.

I don't know if this helps, but if I execute this code with the debugger it works.

rossengeorgiev commented 3 years ago

This package can't be used to automated your Steam client. It talks the Steam protocol, and has nothing to do with your normal client. You cannot make an account switcher with this.

rossengeorgiev commented 3 years ago

Closing this due to inactivity