yukarıda bırakdığım python steam kütüphanesi ile steam giriş yaptırıp istediğim oyuna giriyorum bu sekilde ( screen -S idle python3 steamgiris.py ). Ben kendi bilgisayarımdan steam hesabımdan bir oyuna girince bu screen'nin kapanmasını istiyorum.
import logging
from steam.client import SteamClient
from steam.enums import EResult
from steam.enums import EFriendRelationship, EPersonaState, EChatEntryType
from steam.client import user
import os, signal,sys
# setup logging
logging.basicConfig(format="%(asctime)s | %(message)s", level=logging.INFO)
LOG = logging.getLogger()
client = SteamClient()
client.set_credential_location(".") # where to store sentry files and other stuff
@client.on("error")
def handle_error(result):
LOG.info("Logon result: %s", repr(result))
@client.on("channel_secured")
def send_login():
if client.relogin_available:
client.relogin()
@client.on("connected")
def handle_connected():
LOG.info("Connected to %s", client.current_server_addr)
@client.on("reconnect")
def handle_reconnect(delay):
LOG.info("Out...")
LOG.info("Reconnect in %ds...", delay)
@client.on("disconnected")
def handle_disconnect():
LOG.info("Disconnected.")
if client.relogin_available:
LOG.info("Reconnecting...")
client.reconnect(maxdelay=30)
@client.on("logged_on")
def handle_after_logon():
LOG.info("-"*30)
LOG.info("Logged on as: %s", client.user.name)
LOG.info("Community profile: %s", client.steam_id.community_url)
LOG.info("Last logon: %s", client.user.last_logon)
LOG.info("Last logoff: %s", client.user.last_logoff)
LOG.info("-"*30)
LOG.info("Press ^C to exit")
def main():
LOG.info("Persistent logon recipe")
LOG.info("-"*30)
try:
result = client.cli_login("xxx","xxxx")
if result != EResult.OK:
LOG.info("Failed to login: %s" % repr(result))
return sys.exit()
else:
client.get_web_session("Turkish")
client.games_played([730])
client.change_status(persona_state=EPersonaState.Online, player_name='xxxx™')
client.run_forever()
except KeyboardInterrupt:
if client.connected:
LOG.info("Logout")
client.logout()
main()kod yukardaki gibidir verdiğim dokumasyona bakarak veya biliyorsanız dediğim gibi yapabilirim.