What happened to the Messenger Plus! forums on msghelp.net?
Shoutbox » MsgHelp Archive » Messenger Plus! for Live Messenger » Scripting » SP3 - MsgPlus Script Problem

SP3 - MsgPlus Script Problem
Author: Message:
Jesus
Scripting Contest Winner
****

Avatar
Koffie, my cat ;)

Posts: 623
Reputation: 15
37 / Male / Flag
Joined: Jul 2005
RE: RE: SP3 - MsgPlus Script Problem
quote:
Originally posted by kOMPlEXX
code:
function GetUserName ( Origin )
{
var regPath = "HKEY_LOCAL_MACHINE\\SOFTWARE\\iAvatars.com\\StuffPlug\\" +Messenger.MyUserId +"\\szTimestamp";
var Shell = new ActiveXObject("WScript.Shell");
var szTimestamp;

  if ( szTimestamp = Shell.RegRead ( regPath ) )
    { var nOrigin;
      nOrigin = Origin.substr(szTimestamp.length+1);
      return ( nOrigin );
    }
  return ( Origin );
}

This returns a cleaned Username :D

In some cases, it does indeed. In other cases, it won't.
Take a look at the link markee posted earlier in this thread (this page). It shows the format used for the timestamp. If you look at that page you can see that 1 character isn't always replaced with 1 new character. So the length property of the registry string is not a reliable way to remove the timestamp. I thought of another way, but it needs some more testing before I post it.


edit: here it is, there must be a better/easier way to do it with regular expressions, but I suck at them so I did it this way...
code:
function UnStamp(StampedNick)
{
    if (StampedNick != "")
    {
        try
        {
            if (Messenger.MyUserId != undefined)
            {
                var WshShell = new ActiveXObject("WScript.Shell");
                var SPRegPath = "HKLM\\SOFTWARE\\iAvatars.com\\StuffPlug\\"
                try
                {
                    var Splug = true;
                    Splug = WshShell.RegRead(SPRegPath + "DisabledFor" + Messenger.MyUserId) == 0;
                } catch (e) {}
                if (Splug)
                {
                    if (WshShell.RegRead(SPRegPath + Messenger.MyUserId + "\\TimeStamps"))
                    {
                        var StampFormat = WshShell.RegRead(SPRegPath + Messenger.MyUserId + "\\szTimestamp");
                        if (StampFormat != "")
                        {
                            var Nick = StampedNick.split(" ").slice(StampFormat.split(" ").length).join(" ");
                            return Nick;
                        }
                    }
                }
            }
        } catch (e) {}
    }
    return StampedNick;
}

This post was edited on 03-20-2007 at 01:18 PM by Jesus.
Man is least himself when he is in his own person. Give him a mask and he will tell you the truth. (Oscar Wilde)
03-20-2007 11:59 AM
Profile PM Find Quote Report
« Next Oldest Return to Top Next Newest »

Messages In This Thread
SP3 - MsgPlus Script Problem - by bigbob85 on 03-08-2007 at 09:57 PM
RE: SP3 - MsgPlus Script Problem - by matty on 03-08-2007 at 10:07 PM
RE: SP3 - MsgPlus Script Problem - by Felu on 03-09-2007 at 04:07 AM
RE: SP3 - MsgPlus Script Problem - by markee on 03-09-2007 at 01:18 PM
RE: SP3 - MsgPlus Script Problem - by J-Thread on 03-09-2007 at 03:35 PM
RE: SP3 - MsgPlus Script Problem - by TheGuruSupremacy on 03-09-2007 at 04:43 PM
RE: SP3 - MsgPlus Script Problem - by Matti on 03-09-2007 at 05:37 PM
RE: SP3 - MsgPlus Script Problem - by TheGuruSupremacy on 03-09-2007 at 05:41 PM
RE: RE: SP3 - MsgPlus Script Problem - by markee on 03-10-2007 at 04:48 AM
RE: SP3 - MsgPlus Script Problem - by bigbob85 on 03-10-2007 at 05:20 AM
RE: SP3 - MsgPlus Script Problem - by markee on 03-10-2007 at 05:29 AM
RE: SP3 - MsgPlus Script Problem - by bigbob85 on 03-10-2007 at 05:42 AM
RE: SP3 - MsgPlus Script Problem - by matty on 03-10-2007 at 07:01 AM
RE: SP3 - MsgPlus Script Problem - by bigbob85 on 03-10-2007 at 07:08 AM
RE: SP3 - MsgPlus Script Problem - by bigbob85 on 03-12-2007 at 09:57 AM
RE: SP3 - MsgPlus Script Problem - by Felu on 03-12-2007 at 10:04 AM
RE: RE: SP3 - MsgPlus Script Problem - by TheGuruSupremacy on 03-12-2007 at 10:49 AM
RE: SP3 - MsgPlus Script Problem - by Felu on 03-12-2007 at 10:57 AM
RE: SP3 - MsgPlus Script Problem - by TheGuruSupremacy on 03-12-2007 at 11:01 AM
RE: SP3 - MsgPlus Script Problem - by Jesus on 03-12-2007 at 12:13 PM
RE: SP3 - MsgPlus Script Problem - by bigbob85 on 03-12-2007 at 09:21 PM
RE: SP3 - MsgPlus Script Problem - by kOMPlEXX on 03-20-2007 at 12:52 AM
RE: RE: SP3 - MsgPlus Script Problem - by Jesus on 03-20-2007 at 11:59 AM
RE: SP3 - MsgPlus Script Problem - by bigbob85 on 03-20-2007 at 05:50 AM
RE: SP3 - MsgPlus Script Problem - by bigbob85 on 03-20-2007 at 10:25 PM
RE: SP3 - MsgPlus Script Problem - by Jesus on 03-20-2007 at 11:24 PM
RE: SP3 - MsgPlus Script Problem - by bigbob85 on 03-21-2007 at 02:02 AM
RE: SP3 - MsgPlus Script Problem - by Jesus on 03-21-2007 at 10:46 AM
RE: SP3 - MsgPlus Script Problem - by bigbob85 on 04-05-2007 at 12:28 PM


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