What happened to the Messenger Plus! forums on msghelp.net?
Shoutbox » MsgHelp Archive » Messenger Plus! for Live Messenger » Scripting » Snarl

Snarl
Author: Message:
AnyaAlstreim
New Member
*


Posts: 1
Joined: May 2009
O.P. Snarl
Hi,

Is there a script that would allow WLM updates to be displayed by Snarl (www[dot]fullphat[dot]net/applications/index[dot]html) instead?  So far I couldn't find one, so I was wondering if anyone made one yet?

Thanks

This post was edited on 05-12-2009 at 02:22 PM by AnyaAlstreim.
05-12-2009 02:21 PM
Profile E-Mail PM Find Quote Report
superaktieboy
New Member
*


Posts: 4
Joined: Jun 2010
RE: Snarl
I know this post is quite old, but I would really like to see such script if it's possible!
Thanks
06-21-2010 06:26 PM
Profile E-Mail PM Find Quote Report
matty
Scripting Guru
*****


Posts: 8336
Reputation: 109
39 / Male / Flag
Joined: Dec 2002
Status: Away
RE: Snarl
This was done with Growl... I just cannot find the thread.

[Script Request] Growl Notifications

This post was edited on 06-21-2010 at 06:42 PM by matty.
06-21-2010 06:41 PM
Profile E-Mail PM Find Quote Report
superaktieboy
New Member
*


Posts: 4
Joined: Jun 2010
RE: Snarl
aah cheers.. i've had a go with it.. however, when it comes to "OnEvent_ChatWndReceiveMessage", it seems to send all messages through, i read the scripting documentation, where it says that they are using the "Origin" argument to check whether this is the current user or not.
This is what i have so far, however it is failing miserably.. (the sign in and sign out works fine)

Javascript code:
var signedInUser;
function snarl_notify(Message) {
    new ActiveXObject('WScript.Shell').Exec('C:\\Windows\\snarl_notify.exe snShowMessage 5 "Windows Live Messenger" "'+Message+'" "C:\\Windows\\icon.png"');
}
function OnEvent_ContactSignin(sEmail)  {
    snarl_notify(sEmail+"\nhas just signed in");
}
 
function OnEvent_ContactSignout(sEmail) {
    snarl_notify(sEmail+"\nsigned out");
}
 
function OnEvent_ChatWndReceiveMessage(ChatWnd, Origin, Message, MessageKind) {
    if(signedInUser.Name != Origin) {
        snarl_notify(ChatWnd+'**'Origin++"**"+Message);
    }
    return Message;
}
 
function shorten(sText, max) {
    sNewText = sText.split('', max);
    return sNewText.join('');
}
 
function OnEvent_Signin(sEmail) {
    signedInUser = GetContact(sEmail);
}


so my question, how do i make it so that only the messages from the other end come up? and if possible, only when the window hasn't been created yet (like msn's original behaviour..)

also, how do i make sure msn's original notifiers don't come up?
06-21-2010 08:29 PM
Profile E-Mail PM Find Quote Report
matty
Scripting Guru
*****


Posts: 8336
Reputation: 109
39 / Male / Flag
Joined: Dec 2002
Status: Away
RE: Snarl
Javascript code:
var oChatWnds = {};
 
function OnEvent_ChatWndSendMessage(pChatWnd, sMessage) {
    oChatWnds[pChatWnd.Handle] = sMessage;
}
 
function OnEvent_ChatWndReceiveMessage(pChatWnd, sOrigin, sMessage, nKind) {
    if (oChatWnds[pChatWnd.Handle] === sMessage) {
        delete oChatWnds[pChatWnd.Handle];
    } else {
        snarl_notify(sMessage);
    }
}
 
function OnEvent_ContactSignin(sEmail)  {
    snarl_notify(sEmail+"\nhas just signed in");
}
 
function OnEvent_ContactSignout(sEmail) {
    snarl_notify(sEmail+"\nsigned out");
}
 
function OnEvent_ChatWndDestroyed(pChatWnd) {
    delete oChatWnds[pChatWnd.Handle];
}
 
function snarl_notify(sMessage) {
    new ActiveXObject('WScript.Shell').Exec('C:\\Windows\\snarl_notify.exe snShowMessage 5 "Windows Live Messenger" "'+Message+'" "C:\\Windows\\icon.png"');
}

06-21-2010 09:55 PM
Profile E-Mail PM Find Quote Report
superaktieboy
New Member
*


Posts: 4
Joined: Jun 2010
RE: Snarl
cheers dude that worked :)
06-22-2010 01:09 AM
Profile E-Mail PM Find Quote Report
superaktieboy
New Member
*


Posts: 4
Joined: Jun 2010
RE: Snarl
right, i have the final "product", no clue how to bundle it and all, and to be quite frank, it's worthless since it requires other steps for installation.. first of all download snarl CMD and put the .exe in your windows folder (or anywhere else for that matter)
http://tlhan-ghun.de/?q=node/59

then download the icon attached and put it somewhere,

then copy and paste the following into a new script and edit the top 4 variables.

Javascript code:
/**
 * Just edit the variables.
 */

var boolDontNotifyOnBusy = true; // disable on Busy? true for yes, false for no
var boolNotifyOnSignOut = true; // notify when a contact signs out? true for yes, false for no
var sSnarlCMD = "C:\\Windows\\Snarl_CMD.exe"; // The location to snarl CMD, make sure you escape backslashes (type \\ instead of \)
var sMSNIcon = "C:\\Windows\\icon.png"; // [optional] The location to MSN icon.
 
 
// don't edit anything below this line unless you know what you're doing
 
var oChatWnds = {};
var boolMessengerLocked = false;
 
function OnEvent_ChatWndSendMessage(pChatWnd, sMessage) {
    oChatWnds[pChatWnd.Handle] = sMessage;
}
 
function OnEvent_ChatWndReceiveMessage(pChatWnd, sOrigin, sMessage, nKind) {
 
    if (oChatWnds[pChatWnd.Handle] === sMessage) {
        delete oChatWnds[pChatWnd.Handle];
    } else {
        if (!(Messenger.MyStatus == 4 && boolDontNotifyOnBusy == true)) {
            var re = new RegExp("\([0-9][0-9]:[0-9][0-9]\)", 'ig');
            if(re.exec(sOrigin.substring(0, 7))) {
                sOrigin = sOrigin.substring(7);
            }
            snarl_notify(sOrigin+"\n"+sMessage);
        }
    }
}
 
function OnEvent_ContactSignin(sEmail) {
    snarl_notify(getContactByEmail(sEmail).Name+"\nhas just signed in");
}
 
function OnEvent_ContactSignout(sEmail) {
    if(boolNotifyOnSignOut == true) {
        snarl_notify(getContactByEmail(sEmail).Name+"\nsigned out");
    }
}
 
function OnEvent_ChatWndDestroyed(pChatWnd) {
    delete oChatWnds[pChatWnd.Handle];
}
 
function snarl_notify(sMessage) {
    if(boolMessengerLocked == false && sSnarlCMD != '') {
        sSnarlIcon = '';
        if(sMSNIcon != '') {
            sSnarlIcon = ' "'+sMSNIcon+'"';
        }
        new ActiveXObject('WScript.Shell').Exec(sSnarlCMD+' snShowMessage 5 "Windows Live Messenger" "'+MsgPlus.RemoveFormatCodes(sMessage)+'"'+sSnarlIcon);
    }
}
 
function getContactByEmail(sEmail) {
    var Contacts = Messenger.MyContacts;
    return Contacts.GetContact(sEmail);
}
 
function OnEvent_MessengerUnlocked() {
    boolMessengerLocked = false;
}
 
function OnEvent_MessengerLocked() {
    boolMessengerLocked = true;
}



and matty, thanks for the help.. :)

.png File Attachment: icon.png (70.8 KB)
This file has been downloaded 132 time(s).

This post was edited on 06-22-2010 at 01:47 AM by superaktieboy.
06-22-2010 01:44 AM
Profile E-Mail PM Find Quote Report
whiz
Senior Member
****


Posts: 568
Reputation: 8
– / – / Flag
Joined: Nov 2008
RE: Snarl
Why not put the application and icon in the script folder?  Then you can pack the whole lot together.

To compile a script, you need to put all of the files in a ZIP folder, and then change the extension to ".plsc" (if you can't see extensions, go to Tools > Folder Options > View > Hide extensions for known file types (uncheck).
06-22-2010 09:13 AM
Profile E-Mail PM Find Quote Report
matty
Scripting Guru
*****


Posts: 8336
Reputation: 109
39 / Male / Flag
Joined: Dec 2002
Status: Away
RE: Snarl
quote:
Originally posted by whiz
Why not put the application and icon in the script folder?  Then you can pack the whole lot together.

To compile a script, you need to put all of the files in a ZIP folder, and then change the extension to ".plsc" (if you can't see extensions, go to Tools > Folder Options > View > Hide extensions for known file types (uncheck).
You also need to include a ScriptInfo.xml file...

Also superaktieboy,

Javascript code:
if (!(Messenger.MyStatus == 4 &&  boolDontNotifyOnBusy == true)) {

The above line instead of using 4 you can use
Javascript code:
if (!(Messenger.MyStatus == STATUS_BUSY &&  boolDontNotifyOnBusy == true)) {

06-22-2010 12:58 PM
Profile E-Mail 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