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

Pages: (3): « First « 1 2 [ 3 ] Last »
SP3 - MsgPlus Script Problem
Author: Message:
bigbob85
Full Member
***

Avatar
Is Good, Is Bob...

Posts: 128
Reputation: 4
37 / Male / Flag
Joined: Jul 2003
O.P. RE: SP3 - MsgPlus Script Problem
I tried to use that, but it didnt seem to work :S....

Cookies first code though, returns the Messenger.MyName if no chat only name was found. And then with some regexp from dt.

code:
if (!Origin.match(new RegExp("^" + sMyChatName.replace(/([\[\]\|\)\(\*\?\+\.\$\/])/g, '\\$1')))){
    // Yeah yeah yeah, do stuff
}

It is retruning my name :
The "YTN3rd" Bradley
as
/^The "YTN3rd" Bradley/

And the .match( thing is no longer matching them. Any ideas?
03-12-2007 09:21 PM
Profile E-Mail PM Web Find Quote Report
kOMPlEXX
New Member
*

Avatar

Posts: 1
57 / Male / –
Joined: Nov 2004
RE: SP3 - MsgPlus Script Problem
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
03-20-2007 12:52 AM
Profile E-Mail PM Find Quote Report
bigbob85
Full Member
***

Avatar
Is Good, Is Bob...

Posts: 128
Reputation: 4
37 / Male / Flag
Joined: Jul 2003
O.P. RE: SP3 - MsgPlus Script Problem
You've been a member since 04 and this was your first post? :P

Nice work, looks reasonable. I'll test it later.
03-20-2007 05:50 AM
Profile E-Mail PM Web Find Quote Report
Jesus
Scripting Contest Winner
****

Avatar
Koffie, my cat ;)

Posts: 623
Reputation: 15
38 / 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
bigbob85
Full Member
***

Avatar
Is Good, Is Bob...

Posts: 128
Reputation: 4
37 / Male / Flag
Joined: Jul 2003
O.P. RE: SP3 - MsgPlus Script Problem
Jesus, what is a case when kOMPlEXXs script wont work?

Works for me. Dosnt work for a chat only name... yet...
03-20-2007 10:25 PM
Profile E-Mail PM Web Find Quote Report
Jesus
Scripting Contest Winner
****

Avatar
Koffie, my cat ;)

Posts: 623
Reputation: 15
38 / Male / Flag
Joined: Jul 2005
RE: SP3 - MsgPlus Script Problem
quote:
Originally posted by bigbob85
Jesus, what is a case when kOMPlEXXs script wont work?

Works for me. Dosnt work for a chat only name... yet...
quote:
Originally posted on the StuffPlug 3 forums
TimeStamp format as follows:
H = 24 Hour
HH = 24 Hour with leading zero
h = 12 Hour
hh = 12 Hour with leading zero
m = Minutes
mm = Minutes with leading zero
s = Seconds
ss = Seconds with leading zero
t = A/P
tt = AM/PM
Now, say szTimeStamp = "[H:mm]", which has a length of 6.
In this timestamp, H can be any number from 0 to 23 and mm can be any number from 00 to 59.
As long as it's before 10am, H will be replaced with 1 character, eg [9:55], with a length of 6. However, 10 minutes later, it will be [10:05], with a length of 7.
As a result, using this method could get you an extra space before the nickname, or even the last few characters of the timestamp.

The method I used first checks whether timestamps are enabled, and if they are, it counts the amount of spaces in the szTimeStamp registry value and removes the amount of spaces plus one space-separated character blocks from the beginning of the string. Spaces don't get replaced by stuffplug and there's always a space between the timestamp and the nickname. If timestamps are disabled or empty, it returns the string you put in.
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:24 PM
Profile PM Find Quote Report
bigbob85
Full Member
***

Avatar
Is Good, Is Bob...

Posts: 128
Reputation: 4
37 / Male / Flag
Joined: Jul 2003
O.P. RE: SP3 - MsgPlus Script Problem
Ah, to true.

code:
var Nick = StampedNick.split(" ").slice(StampFormat.split(" ").length).join(" ");

What if your timestamp was "H:MM |"
03-21-2007 02:02 AM
Profile E-Mail PM Web Find Quote Report
Jesus
Scripting Contest Winner
****

Avatar
Koffie, my cat ;)

Posts: 623
Reputation: 15
38 / Male / Flag
Joined: Jul 2005
RE: SP3 - MsgPlus Script Problem
I think you mean "H:mm |", anyway that wouldn't matter.
then Nick would be made like this:
StampFormat = "H:mm |";
aStampFormat = StampFormat.split(" ");           //array: H:mm,|
StampLength = StampFormat.split(" ").length;  //value: 2

StampedNick = "11:59 | <insert nick here>";
aStampedNick = StampedNick.split(" ");            //array: 11:59,|,<insert,nick,here>

aNick = aStampedNick.slice(StampLength);     //remove the timestamp (in this case 2 space-separated character blocks, since StampLength = 2)
Nick = aNick.join(" ");                                       //put the nickname back together in a string.

put all these steps together and you get
var Nick = StampedNick.split(" ").slice(StampFormat.split(" ").length).join(" ");

I hope that makes it clear :)

This post was edited on 03-21-2007 at 10:48 AM 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-21-2007 10:46 AM
Profile PM Find Quote Report
bigbob85
Full Member
***

Avatar
Is Good, Is Bob...

Posts: 128
Reputation: 4
37 / Male / Flag
Joined: Jul 2003
O.P. RE: SP3 - MsgPlus Script Problem
Forgot to come back here >_<

Yeah that makes sense.
Ill try write it into a class file, that removes timestamp and returns original name original WLM name.
04-05-2007 12:28 PM
Profile E-Mail PM Web Find Quote Report
Pages: (3): « First « 1 2 [ 3 ] Last »
« 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