Shoutbox

advice - how to create PSM text:%location - 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: advice - how to create PSM text:%location (/showthread.php?tid=88554)

advice - how to create PSM text:%location by SkipRinPerth on 01-19-2009 at 05:32 AM

Hello Forum users,

I am looking for a way to automate setting my PSM when messenger signs in to include my location. Eg. PSM is "Fred is at Head Office" or "Fred is at Home". The last bit of the information is determined from the network IP subnet I am attached to.

I don't think MP!L with any extra scripts do what I want. Assuming that is the case here are my current ideas:

I can make a machine startup cmd file that can put the location in an ENV var or a file containing "Head Office", "Home" etc.

Can anyone suggest a suitable script(s) that may help me?

I have searched the online library but found no exact match.  I am prepared to tweak scripts that may be close to what I want. Only just loaded MP!L so I am new to this application but have some VB coding background.

So far I think code in these scripts may help me:
- MSN Names and Tools 1.04  - if adding %xxxx vars
- PSM Scheduler 1.0 - if it has run at startup option
- Display-Picture-Changer-1.2 - for file access

Any constructive advice would be appreciated. Thank for reading this.


RE: advice - how to create PSM text:%location by ShawnZ on 01-19-2009 at 06:16 AM

are they seperate computers? :p


RE: advice - how to create PSM text:%location by Th3rmal on 01-19-2009 at 06:35 AM

quote:
Originally posted by ShawnZ
are they seperate computers? :p

quote:
Originally posted by SkipRinPerth
Eg. PSM is "Fred is at Head Office" or "Fred is at Home". The last bit of the information is determined from the network IP subnet I am attached to.
I would guess so, unless he is working off a laptop
RE: RE: advice - how to create PSM text:%location by SkipRinPerth on 01-31-2009 at 10:37 AM

quote:
Originally posted by ShawnZ
are they separate computers? :p
hi ShawnZ

For me 90% mostly it's the laptop that moves to same place I am. I boot up a windows XP PRO  machine and automatically sign in, so automatically passing some location info into the Msngr Status Line is my objective.  Usually it's a cold boot but it would be nice if the solution would work if my last shutdown was in hibernate mode.

Is the status line text somewhere in the registry - I wonder...

However I would be interested in a solution which caters for a different machines too (others I work with move to different branches and so you can not tell where they are unless ofcourse you ask them

RE: RE: RE: advice - how to create PSM text:%location by Vilkku on 01-31-2009 at 10:50 AM

quote:
Originally posted by SkipRinPerth
quote:
Originally posted by ShawnZ
are they separate computers? :p
hi ShawnZ

For me 90% mostly it's the laptop that moves to same place I am. I boot up a windows XP PRO  machine and automatically sign in, so automatically passing some location info into the Msngr Status Line is my objective.  Usually it's a cold boot but it would be nice if the solution would work if my last shutdown was in hibernate mode.

Is the status line text somewhere in the registry - I wonder...

However I would be interested in a solution which caters for a different machines too (others I work with move to different branches and so you can not tell where they are unless ofcourse you ask them

For different machines, won't it be possible to just grab the computer name from the WLM settings (used for signing in on multiple locations)? I'm no scripter, so I don't know. Detecting location based on IP sounds like a good feature, I'd use it :P
RE: advice - how to create PSM text:%location by Matti on 01-31-2009 at 11:41 AM

Well, I don't know how one would retrieve the name as configured in the Messenger settings, because we don't have a decent API for that. However, it is possible (and quite simple in fact) to retrieve the network name and description of the current computer.

Javascript code:
var MAX_COMPUTERNAME_LENGTH = 31;
 
function GetComputerName() {
    var nLength = MAX_COMPUTERNAME_LENGTH + 1;
    var lpBuffer = Interop.Allocate(2*nLength+4);
    var lpSize = Interop.Allocate(4);
    lpSize.WriteDWORD(0, nLength);
 
    var Result = Interop.Call("kernel32", "GetComputerNameW", lpBuffer, lpSize);
    var sName = (Result === 0) ? false : lpBuffer.ReadString(0);
    lpBuffer.Size = 0;
    lpSize.Size = 0;
 
    return sName;
}

To get the computer's description, you simply need to check whether there's a valid REG_SZ key value named "srvcomment" in "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\LanmanServer\Parameters" and read that.
RE: advice - how to create PSM text:%location by matty on 01-31-2009 at 01:24 PM

What are the different IP Subnets for your home and office?


RE: advice - how to create PSM text:%location by ShawnZ on 01-31-2009 at 04:00 PM

quote:
Originally posted by Vilkku
For different machines, won't it be possible to just grab the computer name from the WLM settings (used for signing in on multiple locations)? I'm no scripter, so I don't know. Detecting location based on IP sounds like a good feature, I'd use it :P
quote:
Originally posted by Matti
Well, I don't know how one would retrieve the name as configured in the Messenger settings, because we don't have a decent API for that. However, it is possible (and quite simple in fact) to retrieve the network name and description of the current computer.


or, if they're different machines, you could, you know, just SET DIFFERENT PSMs ON EACH MACHINE?!

8-)
RE: advice - how to create PSM text:%location by Matti on 01-31-2009 at 05:40 PM

quote:
Originally posted by ShawnZ
or, if they're different machines, you could, you know, just SET DIFFERENT PSMs ON EACH MACHINE?!

8-)
Correct me when I'm wrong, but when you run Windows Live Messenger 8.5 or higher on both computers and sign in on the same account, Messenger will always synchronize the name, personal message and display picture.

EDIT: Okay, thanks Matty. I seem to have missed that option while scrolling through the Messenger options window. :P
RE: advice - how to create PSM text:%location by matty on 01-31-2009 at 06:26 PM

quote:
Originally posted by Matti
quote:
Originally posted by ShawnZ
or, if they're different machines, you could, you know, just SET DIFFERENT PSMs ON EACH MACHINE?!

8-)
Correct me when I'm wrong, but when you run Windows Live Messenger 8.5 or higher on both computers and sign in on the same account, Messenger will always synchronize the name, personal message and display picture.
Only if this option is SET within the preferences of the account.

[Image: attachment.php?pid=949302]
RE: advice - how to create PSM text:%location by janlukaz on 02-01-2009 at 02:58 AM

It does sound a good feature, but what if your work or home IP address is not static, then wouldn't you have to reconfigure it every time IP changed?


RE: advice - how to create PSM text:%location by ShawnZ on 02-01-2009 at 03:24 AM

quote:
Originally posted by janlukaz
It does sound a good feature, but what if your work or home IP address is not static, then wouldn't you have to reconfigure it every time IP changed?

well you could check it against a range :p

and besides, your work address probably would be static, where you could just set a default for every other address and use that for when you're at home
RE: advice - how to create PSM text:%location by matty on 02-01-2009 at 04:40 AM

They would also be on different subnets and different class of address.