Shoutbox

[?] Displaying steam status in PSM - Printable Version

-Shoutbox (https://shoutbox.menthix.net)
+-- Forum: MsgHelp Archive (/forumdisplay.php?fid=58)
+--- Forum: Messenger Plus! for Live Messenger (/forumdisplay.php?fid=4)
+---- Forum: Scripting (/forumdisplay.php?fid=39)
+----- Thread: [?] Displaying steam status in PSM (/showthread.php?tid=95196)

[?] Displaying steam status in PSM by ryxdp on 08-07-2010 at 04:11 AM

I searched around a bit but I'm sure it's been asked before.

Is there a way to get what game you're playing in Steam? It seems plausible but I'd say it'd be mostly done with DLLs and not JScript, right?

Thanks :P


RE: [?] Displaying steam status in PSM by matty on 08-07-2010 at 04:56 AM

There really isn't a lot of information available especially on limited profiles...

http://steamcommunity.com/id/ryxdp/?xml=1


RE: [?] Displaying steam status in PSM by MeEtc on 08-07-2010 at 07:25 AM

There's this: http://www.msgpluslive.net/scripts/view/61-AppMon+/
Works for any application, not just Steam. However, you do need to configure each application separately.


RE: [?] Displaying steam status in PSM by Matti on 08-07-2010 at 08:18 AM

Although it's true that the XMLs delivered by the Steam Community don't provide much valuable data, you can get the current status and the name of the game currently being played if the user has set his profile visibility to public. (privacyState = public, visibilityState = 3)

First, you check the value of "onlineStatus". This can be "offline", "online" or "in-game". If the user is in-game, there will be an additional "inGameInfo" block and an "inGameServerIP" node. This may look like this:

XML code:
    <inGameServerIP>1.2.3.4:5678</inGameServerIP>
    <inGameInfo>
        <gameName><![CDATA[Garry's Mod]]></gameName>
        <gameLink><![CDATA[http://store.steampowered.com/app/4000]]></gameLink>
        <gameIcon><![CDATA[http://media.steampowered.com/steamcommunity/public/images/apps/4000/d9101cbeddcc4ff06c7fa1936c3f381b0bbf2e92.jpg]]></gameIcon>
        <gameLogo><![CDATA[http://media.steampowered.com/steamcommunity/public/images/apps/4000/dca12980667e32ab072d79f5dbe91884056a03a2.jpg]]></gameLogo>
        <gameLogoSmall><![CDATA[http://media.steampowered.com/steamcommunity/public/images/apps/4000/5e47aefd968b67fdedf3155f92686991a3ec197e.jpg]]></gameLogoSmall>
        <gameJoinLink><![CDATA[steam://connect/1.2.3.4:5678]]></gameJoinLink>
    </inGameInfo>

As you can see, there's plenty of information there about the name and the server the user is currently playing on. The only requirement is that you set your profile to public which shouldn't be so much of a problem when you're cautious about what you actually publish on it.
RE: [?] Displaying steam status in PSM by ryxdp on 08-08-2010 at 04:23 AM

Thanks guys. AppMon+ seems pretty good, but it seems to need a bit of tweaking to get it work completely with WLM9/Windows 7... the open file dialog doesn't show up. The XML thing might work if Steam stores the XML file locally (I don't want to keep checking the profile page, even though it's quite a small file). For the moment I've modified AppMon+ for my own use, now it shows the Now Playing properly. For some reason it was putting the text into the format parameter, not the title one.

EDIT: I've just found that it can't distinguish between Portal, Garry's Mod and Half-Life 2 (they all have their own hl2.exe but it appears AppMon+ just checks the filename and not the entire path) so it's displaying all three at once. I'll see if i can find a way to fix it but I'm not what you'd call an expert on WMI.


RE: [?] Displaying steam status in PSM by Matti on 08-08-2010 at 09:19 PM

quote:
Originally posted by ryxdp
EDIT: I've just found that it can't distinguish between Portal, Garry's Mod and Half-Life 2 (they all have their own hl2.exe but it appears AppMon+ just checks the filename and not the entire path) so it's displaying all three at once. I'll see if i can find a way to fix it but I'm not what you'd call an expert on WMI.
They're all called "hl2.exe", but those executables are in different directories (e.g. "Steam\steamapps\youraccountname\portal\hl2.exe").
I don't have AppMon+ installed, but can't you set a full executable path instead of just the file name?
RE: [?] Displaying steam status in PSM by MeEtc on 08-09-2010 at 01:10 AM

I've experienced the same issue too, it doesn't use the full path. Should be easy enough to change the script to do so however


RE: RE: [?] Displaying steam status in PSM by ryxdp on 08-11-2010 at 08:22 AM

quote:
Originally posted by MeEtc
I've experienced the same issue too, it doesn't use the full path. Should be easy enough to change the script to do so however

It seems so, but as I said, I have very little experience with this WMI thing, plus I'm a bit rusty on my JScript. Little help, anyone? And is it alright if I post the responsible parts of the code so people can help and/or tell me what it does exactly?
RE: [?] Displaying steam status in PSM by matty on 08-11-2010 at 01:14 PM

Javascript code:
            exenamey = programlist[i].split('\\');            exenamey = exenamey[exenamey.length-1];            var on = true;
            Debug.Trace(handle+" - "+activehandle);
            if(onlyactivelist[i]=='Yes' && handle!=activehandle){
                on = false;
            }
            if((path == programlist[i] || exename==exenamey) && on){

The highlighted lines above are what is causing a problem. More importantly is the latter. The first OR (||) should likely be an AND (&&). This will make sure that the path and exe both match (not eachother obviously). I do not know how that would affect things but you can try it.
RE: RE: [?] Displaying steam status in PSM by ryxdp on 08-12-2010 at 08:49 AM

quote:
Originally posted by matty
Javascript code:
            exenamey = programlist[i].split('\\');            exenamey = exenamey[exenamey.length-1];            var on = true;
            Debug.Trace(handle+" - "+activehandle);
            if(onlyactivelist[i]=='Yes' && handle!=activehandle){
                on = false;
            }
            if((path == programlist[i] || exename==exenamey) && on){

The highlighted lines above are what is causing a problem. More importantly is the latter. The first OR (||) should likely be an AND (&&). This will make sure that the path and exe both match (not eachother obviously). I do not know how that would affect things but you can try it.

Ah, thank you very much! I just got rid of all mentions of exename and exenamey and made both path strings lower case so they matched exactly. Now it works perfectly.