Shoutbox

[Release] MsgHelp Private Message Notifier - 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: [Release] MsgHelp Private Message Notifier (/showthread.php?tid=69226)

[Release] MsgHelp Private Message Notifier by mickael9 on 12-06-2006 at 11:01 PM

Hi,

This script will notify you when you recieve a new private message on this forum :p

[Image: screenshotdn7.jpg]

Known problems:

  • [FIXED] Clears your unread posts list :(

Current version : 0.5

Uninstall old version before installing.
RE: [Release] MsgHelp Private Message Notifier by matty on 12-06-2006 at 11:07 PM

Awesome, I doubt I would use it as I am always logged in and its usually open so.


RE: [Release] MsgHelp Private Message Notifier by Nagamasa on 12-06-2006 at 11:13 PM

If it clears you unread posts list, is it possible for it to detect the 'new' PMs instead of 'unread' PMs?

Nagamasa.

P.S I probably wont use the script, but it depends...


RE: RE: [Release] MsgHelp Private Message Notifier by mickael9 on 12-06-2006 at 11:25 PM

quote:
Originally posted by Nagamasa
If it clears you unread posts list, is it possible for it to detect the 'new' PMs instead of 'unread' PMs?

Nagamasa.

P.S I probably wont use the script, but it depends...

I was talking about unread posts (= new posts), not unread PMs :S
RE: [Release] MsgHelp Private Message Notifier by Nagamasa on 12-06-2006 at 11:36 PM

quote:
Originally posted by mickael9
I was talking about unread posts (= new posts), not unread PMs :S

Ahh...ok. Now I understand...
RE: [Release] MsgHelp Private Message Notifier by Spunky on 12-07-2006 at 12:19 AM

"Doesn't appear to be a valid script pack"

Also, there is no need for the enable option in this script


RE: [Release] MsgHelp Private Message Notifier by mickael9 on 12-07-2006 at 11:23 AM

quote:
Originally posted by SpunkyLoveMuff
"Doesn't appear to be a valid script pack"

Also, there is no need for the enable option in this script
Fixed, re-download :P

Edit : v0.2 is out :p
RE: [Release] MsgHelp Private Message Notifier by Matti on 12-07-2006 at 04:12 PM

I like it! But I'd recommend you to widen the text labels a bit, so it can fit the translations. (e.g. the word "Activeren" doesn't fit in the check box for Enable)

Very good script! (y)


RE: RE: [Release] MsgHelp Private Message Notifier by mickael9 on 12-07-2006 at 04:25 PM

quote:
Originally posted by Mattike
I like it! But I'd recommend you to widen the text labels a bit, so it can fit the translations. (e.g. the word "Activeren" doesn't fit in the check box for Enable)
Fixed ;)

quote:
Originally posted by Mattike
Very good script! (y)

Thanks :)
RE: RE: RE: [Release] MsgHelp Private Message Notifier by Matti on 12-07-2006 at 04:42 PM

quote:
Originally posted by mickael9
Fixed ;)
Thanks! :) Dutch translation works great now:
code:
<?xml version="1.0" encoding="utf-16" ?>
<!-- Dutch translation by Mattike -->
<Lang>
  <String Name="NewPM">Je hebt een nieuw persoonlijk bericht!&#x0A;Onderwerp:</String>
  <String Name="ConfigUserName">Gebruiker:</String>
  <String Name="ConfigPassword">Wachtwoord:</String>
  <String Name="ConfigLanguage">Taal:</String>
  <String Name="ConfigCheckEvery">Controleer op nieuwe pm's iedere:</String>
  <String Name="ConfigMinutes">minuten</String>
  <String Name="ConfigEnable">Activeren</String>
  <String Name="ConfigOK">OK</String>
  <String Name="ConfigCancel">Annuleren</String>
</Lang>

RE: RE: RE: RE: [Release] MsgHelp Private Message Notifier by J-Thread on 12-07-2006 at 05:02 PM

quote:
Originally posted by Mattike
code:
  <String Name="ConfigCheckEvery">Controleer op nieuwe pm's iedere:</String>

I'd make it:
code:
<?xml version="1.0" encoding="utf-16" ?>
  <String Name="ConfigCheckEvery">Controleer op nieuwe PB's iedere:</String>
Because it comes from Personal Message, which is usually translated as "Persoonlijk Bericht" in Dutch;)
RE: RE: RE: RE: [Release] MsgHelp Private Message Notifier by mickael9 on 12-07-2006 at 05:03 PM

quote:
Originally posted by Mattike
quote:
Originally posted by mickael9
Fixed ;)
Thanks! :) Dutch translation works great now:
code:
<?xml version="1.0" encoding="utf-16" ?>
<!-- Dutch translation by Mattike -->
<Lang>
  <String Name="NewPM">Je hebt een nieuw persoonlijk bericht!&#x0A;Onderwerp:</String>
  <String Name="ConfigUserName">Gebruiker:</String>
  <String Name="ConfigPassword">Wachtwoord:</String>
  <String Name="ConfigLanguage">Taal:</String>
  <String Name="ConfigCheckEvery">Controleer op nieuwe pm's iedere:</String>
  <String Name="ConfigMinutes">minuten</String>
  <String Name="ConfigEnable">Activeren</String>
  <String Name="ConfigOK">OK</String>
  <String Name="ConfigCancel">Annuleren</String>
</Lang>


How do you say "Settings" in Dutch ? (window title / menu caption) ? :p
RE: [Release] MsgHelp Private Message Notifier by foaly on 12-07-2006 at 05:06 PM

quote:
Originally posted by mickael9
How do you say "Settings" in Dutch ? (window title / menu caption) ?
Instellingen
RE: RE: [Release] MsgHelp Private Message Notifier by mickael9 on 12-07-2006 at 06:05 PM

quote:
Originally posted by foaly
quote:
Originally posted by mickael9
How do you say "Settings" in Dutch ? (window title / menu caption) ?
Instellingen


Can you translate this ? :P
code:
<String Name="Error">Error</String>
<String Name="ConfigErrorSpecifyUserName">Plase specify an user name</String>
<String Name="ConfigErrorSpecifyPassword">Please specify a password</String>
<String Name="ConfigErrorIncorrectCheckInterval">Incorrect check interval</String>


RE: [Release] MsgHelp Private Message Notifier by CookieRevised on 12-07-2006 at 06:27 PM

quote:
Originally posted by SpunkyLoveMuff
"Doesn't appear to be a valid script pack"

Also, there is no need for the enable option in this script
Yes there is. If the script has a config panel, it is better to be able to activate/deactivate the functions of this script from there instead of depending on the user to navigate thru the Plus! settings...

quote:
Originally posted by Mattike
Thanks! :) Dutch translation works great now:
code:
<String Name="ConfigUserName">Gebruiker:</String>

Make that "Gebruikersnaam:"

quote:
Originally posted by foaly
quote:
Originally posted by mickael9
How do you say "Settings" in Dutch ? (window title / menu caption) ?
Instellingen
...or "Configuratie", or "Voorkeuren" or "Opties" or ...

It depends on where they are used and what they exactly are... anyways, in this case I also would indeed say "instellingen".

quote:
Originally posted by mickael9
Can you translate this ? :P
code:
<String Name="Error">Error</String>
<String Name="ConfigErrorSpecifyUserName">Plase specify an user name</String>
<String Name="ConfigErrorSpecifyPassword">Please specify a password</String>
<String Name="ConfigErrorIncorrectCheckInterval">Incorrect check interval</String>


Geef een gebruikersnaam op:
Geef een wachtwoord op:
Foutief controle-interval


-------------

And I dunno what the default check-interval is, but I would make that 5 minutes, certainly not 1 minute!

Although the forum servers could maybe deal with the amount of traffic this generates, such a short interval causes unneeded traffic. And it is for most people not needed to check every minute either.
RE: RE: [Release] MsgHelp Private Message Notifier by mickael9 on 12-07-2006 at 06:40 PM

quote:
Originally posted by CookieRevised

Geef een gebruikersnaam op:
Geef een wachtwoord op:
Foutief controle-interval

code:
<String Name="Error">Error</String>
? :S

quote:
Originally posted by CookieRevised

And I dunno what the default check-interval is, but I would make that 5 minutes, certainly not 1 minute !
Default is 5 minutes ;)
RE: RE: RE: [Release] MsgHelp Private Message Notifier by CookieRevised on 12-07-2006 at 06:59 PM

quote:
Originally posted by mickael9
code:
<String Name="Error">Error</String>
? :S
"Fout"...

But I would not use "error" as the title of your message boxes.

If the user gets an "error", for what application does he get it? He doesn't know....

Try to avoid the word "error" all together though, unless it is for a severe system error or an error which prevents the application from running.

For message boxes always use the application's title.
RE: [Release] MsgHelp Private Message Notifier by mickael9 on 12-07-2006 at 07:10 PM

0.4 is out :P

- The settings window isn't shown immedialtly (labels text & settings are loaded before)
- Added translations for :

  • the menu and the settings window titlebar / caption.
  • The error messages shown when you leave a field blank in the settings window.

RE: RE: RE: [Release] MsgHelp Private Message Notifier by Matti on 12-07-2006 at 07:33 PM

quote:
Originally posted by CookieRevised
Make that "Gebruikersnaam:"

The problem with that was that it didn't fit, and I thought there was already a lot of space for it. So I kept it simple. :P
RE: [Release] MsgHelp Private Message Notifier by CookieRevised on 12-08-2006 at 02:35 PM

hmmyeah, "login" and "wachtwoord" would be better then...


RE: [Release] MsgHelp Private Message Notifier by mickael9 on 12-21-2006 at 07:21 PM

Mattike, I need you to translate "Check now" in Ducth for the next version.


RE: [Release] MsgHelp Private Message Notifier by Jimbo on 12-21-2006 at 07:25 PM

Isn't it something like "Controle nu"?


RE: [Release] MsgHelp Private Message Notifier by CookieRevised on 12-21-2006 at 11:06 PM

In English, things like that (command verbs) are always in the infinitive form. Many people forget this and interpret the English captions wrong when they translate...

"Check Now" is not "controleer nu" (first person), but "nu controleren" (infinitive)....

Though it depends on what "Check Now" stands for. Checking for updates ("controleren op updates")? Checking something cool out ("zie dit" or something like that... sounds dodgy though)? Checking a setting ("nu selecteren")? etc...

When you need something translated, _always_ place it in the correct context since stuff can rarely be translated literally and still be correct in the context. Also the size available is of importance. Aka: requesting something to be translated without these two important things is useless.


RE: RE: [Release] MsgHelp Private Message Notifier by mickael9 on 12-22-2006 at 05:14 PM

quote:
Though it depends on what "Check Now" stands for. Checking for updates ("controleren op updates")? Checking something cool out ("zie dit" or something like that... sounds dodgy though)? Checking a setting ("nu selecteren")? etc...

"Check for new private messages." :P
RE: [Release] MsgHelp Private Message Notifier by CookieRevised on 12-22-2006 at 10:36 PM

quote:
Originally posted by mickael9
quote:
Though it depends on what "Check Now" stands for. Checking for updates ("controleren op updates")? Checking something cool out ("zie dit" or something like that... sounds dodgy though)? Checking a setting ("nu selecteren")? etc...

"Check for new private messages." :P
Then I would say "Nu controleren".

-------------

btw, can I suggest another way of logging in?

The current method logs people out, even if they don't wanna. Also, all the steps you do aren't needed.

Just go directly to "http://shoutbox.menthix.net/private.php?fid=1" and if a page appears that the user isn't logged in, only then explicitly log in (and back out later). If that page isn't shown, the user is already logged in and you will go directly to the inbox. In the latter case, you should not log out either.

-------------

Another suggestion: The title of the script is "MsgHelp Private Message Notifier". This is too long to be shown in the script list. Also you use "MsgHelp PM Notifier" as title for the prefs window, which is inconsistant with the script's title. So, to strike two flies at the same time, I would stick to "MsgHelp PM Notifier" for the script title and message boxes, etc too.

-------------

Other stuff to optimize:

code:
String.prototype.isEmpty = function()
{
    if (this.replace(/^ +/, '').replace(/ +$/, '') == '')
        return true;
   
    return false;
}
To trim a string from spaces, you can use this.replace(/^ +| +$/g, '')
Also, you don't need an IF THEN if you directly return true or false according to the check.
thus:
code:
String.prototype.isEmpty = function()
{
    return (this.replace(/^ +| +$/g, '') === '')
}
(and instead of a space, maybe better use a spacing character which is  \s

-------------

In the Settings.Set prototype I would suggest to add a third parameter which defines the type of registry key you're going to write. As it is now, you only write strings, but CheckInterval and Enable are better to be written as DWORDs.

-------------

Instead of using == and != here and there, use === and !==.
See JScript 5.6 documentation or one of my forum posts why.

-------------

I see you check on no/empty input and then set the focus to that control... All I can say is (y)(y)(y) for this. Most complete and user friendly checking I've seen.

You also don't write settings to the registry when it is not needed (eg: when starting up or when user hasn't changed anything), also (y) (some scripts do write (default) stuff to the registry, eg: when they can't find a setting, which is (n)).

Example for all :D

-------------

Related to the above, check if the CheckInterval isn't greater than
86400000/60/1000 = 1440, since a timer value can't be bigger than 86400000.

Don't forget to change function SettingsOK too.

-------------

code:
function Logout_Callback()
{
    if (objXmlHttp.readyState == 4)
    {
        Login();
    }
}
Isn't that going to give an endless loop when there is some fault where the user of the script isn't the user who was logged in??? trying to log in, different user detected, log out, trying to log in, different user detected, log out, trying to log in, etc...

I can understand you first log out and then try to log in with the correct user, but the way it is implemented will also make that you constantly loop when the logging in fails and when again another user is shown.

Either do it differently, or make it only check a certain amount of times and then showing an error.

-------------

code:
function OnEvent_Initialize(blnMessengerStart)
{
    LoadStrings();
   
    if (SettingsOK())
        StartTimerAndCheck();

    else
        ShowConfigDialog();
}
Do not use OnEvent_Initialize to load the settings. Use OnEvent_SignIn or even better OnEvent_SigninReady which makes your script user specific (also store your settings user specific!!!), which is very very very mandatory for something like this!!! (And don't forget to cancel the timer when the user signs out of course).

-------------

code:
function OnEvent_Timer(strTimerId)
{
    if (strTimerId == 'CheckTimer')
    {
        StartTimerAndCheck();
    }
}
Since you only use one timer, you don't need to check upon the timer id. And thus:
code:
function OnEvent_Timer()
{
    StartTimerAndCheck();
}
Same goes for the event OnEvent_MenuClicked.

-------------

code:
function OnGetScriptMenu(intLocation)
{
    var strMenu = '<ScriptMenu>';
    strMenu    +=     '<MenuEntry Id="mnuSettings">' + Lang.Settings + '</MenuEntry>';
    strMenu    += '</ScriptMenu>';
   
    return strMenu;
}
No need for the variable and parameters:
code:
function OnGetScriptMenu()
{
    return '<ScriptMenu>'
      +      '<MenuEntry Id="mnuSettings">' + Lang.Settings + '</MenuEntry>'
      +    '</ScriptMenu>';
}

-------------

if (objFileName.match(/^(.*)\.xml$/i))
=>
if (objFileName.match(/^(.+)\.xml$/i))

RE: RE: [Release] MsgHelp Private Message Notifier by mickael9 on 12-23-2006 at 09:40 AM

quote:
btw, can I suggest another way of logging in?

The current method logs people out, even if they don't wanna. Also, all the steps you do aren't needed.

Just go directly to "http://shoutbox.menthix.net/private.php?fid=1" and if a page appears that the user isn't logged in, only then explicitly log in (and back out later). If that page isn't shown, the user is already logged in and you will go directly to the inbox. In the latter case, you should not log out either.

OK ...

quote:
Another suggestion: The title of the script is "MsgHelp Private Message Notifier". This is too long to be shown in the script list. Also you use "MsgHelp PM Notifier" as title for the prefs window, which is inconsistant with the script's title. So, to strike two flies at the same time, I would stick to "MsgHelp PM Notifier" for the script title and message boxes, etc too.
OK ...

quote:
code:
String.prototype.isEmpty = function()
{
    if (this.replace(/^ +/, '').replace(/ +$/, '') == '')
        return true;
   
    return false;
}
To trim a string from spaces, you can use this.replace(/^ +| +$/g, '')
Also, you don't need an IF THEN if you directly return true or false according to the check.
thus:
code:
String.prototype.isEmpty = function()
{
    return (this.replace(/^ +| +$/g, '') === '')
}
(and instead of a space, maybe better use a spacing character which is  \s
OK ... :P

quote:
In the Settings.Set prototype I would suggest to add a third parameter which defines the type of registry key you're going to write. As it is now, you only write strings, but CheckInterval and Enable are better to be written as DWORDs.
I think I will detect the type of the variable instead ^^

quote:
Instead of using == and != here and there, use === and !==.
See JScript 5.6 documentation or one of my forum posts why.
Hum ... but String.replace returns a string, so I don't need === no ?

quote:
I see you check on no/empty input and then set the focus to that control... All I can say is (y)(y)(y) for this. Most complete and user friendly checking I've seen.

You also don't write settings to the registry when it is not needed (eg: when starting up or when user hasn't changed anything), also (y) (some scripts do write (default) stuff to the registry, eg: when they can't find a setting, which is (n)).

Example for all :D
(H)

quote:
Related to the above, check if the CheckInterval isn't greater than
86400000/60/1000 = 1440, since a timer value can't be bigger than 86400000.

Don't forget to change function SettingsOK too.
True ...


quote:
code:
function Logout_Callback()
{
    if (objXmlHttp.readyState == 4)
    {
        Login();
    }
}
Isn't that going to give an endless loop when there is some fault where the user of the script isn't the user who was logged in??? trying to log in, different user detected, log out, trying to log in, different user detected, log out, trying to log in, etc...

I can understand you first log out and then try to log in with the correct user, but the way it is implemented will also make that you constantly loop when the logging in fails and when again another user is shown.

Either do it differently, or make it only check a certain amount of times and then showing an error.
Mhhhh ...

quote:
code:
function OnEvent_Initialize(blnMessengerStart)
{
    LoadStrings();
   
    if (SettingsOK())
        StartTimerAndCheck();

    else
        ShowConfigDialog();
}
Do not use OnEvent_Initialize to load the settings. Use OnEvent_SignIn or even better OnEvent_SigninReady which makes your script user specific (also store your settings user specific!!!), which is very very very mandatory for something like this!!! (And don't forget to cancel the timer when the user signs out of course).

I will allow the user to leave the fields blank when the "Enable" checkbox is disabled
Maybe change the label to "Enable for the current account"

quote:
code:
function OnEvent_Timer(strTimerId)
{
    if (strTimerId == 'CheckTimer')
    {
        StartTimerAndCheck();
    }
}
Since you only use one timer, you don't need to check upon the timer id.

And thus:
code:
function OnEvent_Timer()
{
    StartTimerAndCheck();
}

OK ...

quote:
Same goes for the event OnEvent_MenuClicked.

In the next version, there is a new menu : "Check now" :P

quote:
code:
function OnGetScriptMenu(intLocation)
{
    var strMenu = '<ScriptMenu>';
    strMenu    +=     '<MenuEntry Id="mnuSettings">' + Lang.Settings + '</MenuEntry>';
    strMenu    += '</ScriptMenu>';
   
    return strMenu;
}
No need for the variable and parameters:
code:
function OnGetScriptMenu()
{
    return '<ScriptMenu>'
      +      '<MenuEntry Id="mnuSettings">' + Lang.Settings + '</MenuEntry>'
      +    '</ScriptMenu>';
}

Right

quote:
if (objFileName.match(/^(.*)\.xml$/i))
=>
if (objFileName.match(/^(.+)\.xml$/i))

Oh yes ;)
RE: [Release] MsgHelp Private Message Notifier by mickael9 on 12-23-2006 at 01:04 PM

0.5 is out :D


RE: RE: RE: [Release] MsgHelp Private Message Notifier by CookieRevised on 12-23-2006 at 06:23 PM

quote:
Originally posted by mickael9
quote:
In the Settings.Set prototype I would suggest to add a third parameter which defines the type of registry key you're going to write. As it is now, you only write strings, but CheckInterval and Enable are better to be written as DWORDs.
I think I will detect the type of the variable instead ^^
Be very carefull in that. Before you know it you write a string instead of a dword or vice versa, etc because you made an error somewhere in your code or whatever. And before you know it you end up with settings which can't be read properly anymore by users who don't have the latest version or by users which has bad settings already in the registry. Then you need to compensate for that in another version, etc... big mess...

The reason to add a third parameter is so you can explicitly set a type, even if you screwed up somewhere in the script or Jscript's registry read function read the wrong type of variable (upon its return you expect it to be a certain type, but you can't be sure. And if you don't check upon it it is very well possible people will encounter errors in the script, etc...)

Types of variables in JScript can switch and change as you go, the benefit of adding a third parameter to this function is exactly to overcome this and write the boolean true or the string "true" as a DWORD... 0x1 for example.

If you're going to auto-detect it, you're better of not changing anything to what it was as auto-detecting will cause more potential errors to happen.

All this is also related to the use of operators like === instead of ==, etc...

quote:
Originally posted by mickael9
quote:
Instead of using == and != here and there, use === and !==.
See JScript 5.6 documentation or one of my forum posts why.
Hum ... but String.replace returns a string, so I don't need === no ?
You miss the point here. See JScript 5.6 documentation or one of my forum posts why. ;)

quote:
Originally posted by mickael9
quote:
code:
function OnEvent_Initialize(blnMessengerStart)
{
    LoadStrings();
   
    if (SettingsOK())
        StartTimerAndCheck();

    else
        ShowConfigDialog();
}
Do not use OnEvent_Initialize to load the settings. Use OnEvent_SignIn or even better OnEvent_SigninReady which makes your script user specific (also store your settings user specific!!!), which is very very very mandatory for something like this!!! (And don't forget to cancel the timer when the user signs out of course).
I will allow the user to leave the fields blank when the "Enable" checkbox is disabled. Maybe change the label to "Enable for the current account".
All that has got nothing to do with the fact that you don't store, read and handle settings user-specific.

quote:
Originally posted by mickael9
quote:
Same goes for the event OnEvent_MenuClicked.
In the next version, there is a new menu : "Check now" :P
In that case I'll sush ;)

PS: but if that was why you needed the translation, I would translate it like "Controleren op nieuwe prive berichten" (but this is of course very long).

Otherwise the user might mistaken it for checking on an update of the script.
The same goes for the English version, Don't just say "Check Now", but "Check on new private messages"

So you see, placing things in exact and detailed context and where it is going to be used exactly is extremely important in translating, just as what the translation means (eg: "check on new pms") and what is shown (eg: "Check now") can be/mean a huge difference.

RE: [Release] MsgHelp Private Message Notifier by dekline on 12-31-2006 at 01:21 PM

Hello!

I have a question:

Can I make this script for another forum and can you tell me how?
Do I change the url of all things, beeing in your script and change it with my forum-url?!