What happened to the Messenger Plus! forums on msghelp.net?
Shoutbox » MsgHelp Archive » Messenger Plus! for Live Messenger » Scripting » [?] Displaying steam status in PSM

[?] Displaying steam status in PSM
Author: Message:
ryxdp
Senior Member
****


Posts: 804
Reputation: 16
29 / Male / Flag
Joined: Jun 2006
O.P. [?] Displaying steam status in PSM
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
08-07-2010 04:11 AM
Profile PM Find Quote Report
matty
Scripting Guru
*****


Posts: 8336
Reputation: 109
39 / Male / Flag
Joined: Dec 2002
Status: Away
RE: [?] Displaying steam status in PSM
There really isn't a lot of information available especially on limited profiles...

http://steamcommunity.com/id/ryxdp/?xml=1
08-07-2010 04:56 AM
Profile E-Mail PM Find Quote Report
MeEtc
Patchou's look-alike
*****

Avatar
In the Shadow Gallery once again

Posts: 2200
Reputation: 60
38 / Male / Flag
Joined: Nov 2004
Status: Away
RE: [?] Displaying steam status in PSM
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.
[Image: signature/]     [Image: sharing.png]
I cannot hear you. There is a banana in my ear.
08-07-2010 07:25 AM
Profile PM Web Find Quote Report
Matti
Elite Member
*****

Avatar
Script Developer and Helper

Posts: 1646
Reputation: 39
32 / Male / Flag
Joined: Apr 2004
RE: [?] Displaying steam status in PSM
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.
Plus! Script Developer | Plus! Beta Tester | Creator of Countdown Live | Co-developer of Screenshot Sender 5

Found my post useful? Rate me!
08-07-2010 08:18 AM
Profile E-Mail PM Web Find Quote Report
ryxdp
Senior Member
****


Posts: 804
Reputation: 16
29 / Male / Flag
Joined: Jun 2006
O.P. RE: [?] Displaying steam status in PSM
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.

This post was edited on 08-08-2010 at 10:53 AM by ryxdp.
08-08-2010 04:23 AM
Profile PM Find Quote Report
Matti
Elite Member
*****

Avatar
Script Developer and Helper

Posts: 1646
Reputation: 39
32 / Male / Flag
Joined: Apr 2004
RE: [?] Displaying steam status in PSM
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?
Plus! Script Developer | Plus! Beta Tester | Creator of Countdown Live | Co-developer of Screenshot Sender 5

Found my post useful? Rate me!
08-08-2010 09:19 PM
Profile E-Mail PM Web Find Quote Report
MeEtc
Patchou's look-alike
*****

Avatar
In the Shadow Gallery once again

Posts: 2200
Reputation: 60
38 / Male / Flag
Joined: Nov 2004
Status: Away
RE: [?] Displaying steam status in PSM
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
[Image: signature/]     [Image: sharing.png]
I cannot hear you. There is a banana in my ear.
08-09-2010 01:10 AM
Profile PM Web Find Quote Report
ryxdp
Senior Member
****


Posts: 804
Reputation: 16
29 / Male / Flag
Joined: Jun 2006
O.P. RE: RE: [?] Displaying steam status in PSM
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?
08-11-2010 08:22 AM
Profile PM Find Quote Report
matty
Scripting Guru
*****


Posts: 8336
Reputation: 109
39 / Male / Flag
Joined: Dec 2002
Status: Away
RE: [?] Displaying steam status in PSM
js 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.

This post was edited on 08-11-2010 at 01:15 PM by matty.
08-11-2010 01:14 PM
Profile E-Mail PM Find Quote Report
ryxdp
Senior Member
****


Posts: 804
Reputation: 16
29 / Male / Flag
Joined: Jun 2006
O.P. RE: RE: [?] Displaying steam status in PSM
quote:
Originally posted by matty
js 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.

This post was edited on 08-12-2010 at 08:50 AM by ryxdp.
08-12-2010 08:49 AM
Profile PM Find Quote Report
« Next Oldest Return to Top Next Newest »


Threaded Mode | Linear Mode
View a Printable Version
Send this Thread to a Friend
Subscribe | Add to Favorites
Rate This Thread:

Forum Jump:

Forum Rules:
You cannot post new threads
You cannot post replies
You cannot post attachments
You can edit your posts
HTML is Off
myCode is On
Smilies are On
[img] Code is On