Shoutbox

[request]Key press 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: [request]Key press notifier (/showthread.php?tid=67506)

[request]Key press notifier by blow on 10-20-2006 at 04:33 PM

Hi all, im new, i search a way to know when a contact in my list open my chat window and starts a conversation whit me.
I know the "Live Notifier" script do it, but i dont understand how it works...

You can help me? :)


RE: [request]Key press notifier by Zahid™ on 10-20-2006 at 04:57 PM

Do you have Messenger Plus Live installed? If you do then just click on the script after downloading and install it, and then you can change its options.


RE: [request]Key press notifier by CookieRevised on 10-20-2006 at 05:55 PM

quote:
Originally posted by blow
Hi all, im new, i search a way to know when a contact in my list open my chat window and starts a conversation whit me.
I know the "Live Notifier" script do it, but i dont understand how it works...

You can help me? :)
Your thread title and what you request in the post are two different things.

Detecting a key press is something different than detecting a conversation window being opened.

As for detecting a conversation being opened, please search the forums. There are already a massive amount of threads about that (search for "notifier").

Be advised that such "open window notifiers" do no longer work anymore due to protocol changes. The Live Notifier script isn't good either for detecting opening conversation windows. It simply doesn't work anymore (despite what still some people want to believe or say).

see "The open/closed window notifier feature" for a big discussion about this.

If anything, such tools can only detect "sessions" being opened. And a session can mean a lot of things, of which an open conversation is only 1 small thing. And sessions are triggered by a lot of things.

Such notifier tools work by sniffing the protocol for specific system messages between your messenger client and the client of your contacts and/or messenger servers.

The protocol is the internal language which Messenger uses to talk to its servers and to establish a communication line and to get and send data.
RE: [request]Key press notifier by blow on 10-20-2006 at 06:46 PM

mmm i think i dont understand.
I have to write a script whit some feauture, one of this is know when a contact in my list is typying to me,like when i have the chat window open,i can see the icon that show when contact is typing.
So i have to intercept the event that allow us to see, when we chat whit anybody,if he is typying or not,but when the window is closed too.
Is it possible whit script?

I have downloaded Live Notifier script, i have look the code, but i haven't understand how it work, i think it use only a dll...


RE: [request]Key press notifier by CookieRevised on 10-21-2006 at 04:22 AM

blow,

quote:
Originally posted by CookieRevised
Such notifier tools work by sniffing the protocol for specific system messages between your messenger client and the client of your contacts and/or messenger servers.

The protocol is the internal language which Messenger uses to talk to its servers and to establish a communication line and to get and send data.
Every notifier will work like this (including one which will catch the "user is typing" message). And that is what that DLL from Live Notifier, or the OCX from Pai's ActiveX Xniff sniffer does.

With the OCX from Pai's ActiveX Xniff sniffer you can make your own sniffer. Study the protocol* and see that post about the Xniff sniffer how to program it.

For detecting a "user is typing" message you need to check on the incomming protocol message "MSG" with contents
quote:
MIME-Version: 1.0
Content-Type: text/x-msmsgscontrol
TypingUser: contact@mail.com



[*] http://www.hypothetic.org/docs/msn/index.php  (site is not updated in a long time so it doesn't contain all the ins and outs of the new protocol versions, though it will give you the most detailed explanation there is to find)
http://msnpiki.msnfanatic.com/ (has some (more up to date) info too but not quite as much as on hypothetic.org)

RE: [request]Key press notifier by blow on 10-21-2006 at 03:03 PM

thank your very useufull!

A small thing...now im trying the packets snuffing, but i think i can see only packets thaht incoming from port 1863(msn server port?) but not packets outcoming, so if i send a messag i see nothing, why?


RE: [request]Key press notifier by Deco on 10-21-2006 at 04:04 PM

do you have a loop to get the messages that have the destport 1863?

If you search in the forums for Xniff release post.. there's an example link to get all messages from MSN..

If the example doesn't work for you.. try sniffing ALL the packets , send a test message to a friend and stop the script so you can locate the message you sent in the debugging window.. maybe for some odd reason you're sending messages to a different port and that way you'll bee able to find it.

Good luck!


RE: [request]Key press notifier by blow on 10-21-2006 at 06:47 PM

i sniff all packets send/receive by my ip in all ports, i see all packets but when i send a msg to my friend i cant see it in trace window..contrarily i see msg send at me by my friends.
This is code:

code:
function xniff:: OnData  (srcip,srcport,destip,destport,data,datalen){
     Debug.Trace(srcip+"->"+destip+"/"+srcport+"->"+destport+"("+datalen+")"+": "+data);
}

So i see all packets, but i cant find outcoming msg packet.
RE: [request]Key press notifier by CookieRevised on 10-21-2006 at 07:04 PM

I think you misinterpret the parameters and thus the messages. Or you are so overwhelmed with many messages you wont notice the outgiong messages.

The outgoing messages are the messages with the parameter destport being "1863". And thus that is all you need to test on: if (destport == '1863') if (datalen > 0) Debug.Trace('» (' + datalen + ') ' + data);


The second example given in that thread for viewing all packets can be used without any modification. Use that as your test script instead of the one you quoted here.

But note that it is possible that those sniffers will not work if you have a wireless connection.

PS: to check on "user is typing" messages you need to check on incomming messages, not outgoing.


RE: [request]Key press notifier by blow on 10-21-2006 at 07:12 PM

The problem is there aren't packets whit destination port=1863...
Only packet whit source port=1863.
This mean i cant see outcoming packets...

ps.i have already find my interest, this is only a small thing :D


RE: [request]Key press notifier by Jesus on 10-23-2006 at 09:25 AM

I made a script like this a while ago.
It displays a toast when someone is typing to you and you don't have a conversation window open with that contact.
If you click the toast it will (ofcourse) open a convo with the contact.

I can upload it if anyone's interested.


RE: [request]Key press notifier by Jimbo on 10-23-2006 at 09:34 AM

quote:
Originally posted by Jesus
I made a script like this a while ago.
It displays a toast when someone is typing to you and you don't have a conversation window open with that contact.
If you click the toast it will (ofcourse) open a convo with the contact.

I can upload it if anyone's interested.
i'm very interested, please upload it. sounds great. So it tells you if someone is typing a message to you? Thats wicked if it does

RE: [request]Key press notifier by Jesus on 10-23-2006 at 11:53 AM

Here it is,
please note this line:

code:
xniff.IP = getLocalIp(); // assign your last local IP address, automatically detected (if you want to force a specific ip to listen to, just set it as a string 'XXX.XXX.XXX.XXX')

if you have multiple network adapters (or if you have VMware or something like that installed), just replace getLocalIp() with the IP address of the network adapter you use to connect to the internet, eg:
code:
xniff.IP = "10.0.0.1"; // assign your last local IP address, automatically detected (if you want to force a specific ip to listen to, just set it as a string 'XXX.XXX.XXX.XXX')
like it says in the comment ;)

also, Xniff might have problems with wireless connections. I don't know the ins and outs about that, but if you're having problems on wireless, it might be that.

have fun :)

edit: oops, forgot to include the script:P

edit2: oh and it's in dutch... but it's only 1 line to translate: " is een bericht aan het typen." is dutch for " is typing a message."
RE: [request]Key press notifier by Jimbo on 10-23-2006 at 12:50 PM

quote:
Originally posted by Jesus
Here it is,
please note this line:
code:
xniff.IP = getLocalIp(); // assign your last local IP address, automatically detected (if you want to force a specific ip to listen to, just set it as a string 'XXX.XXX.XXX.XXX')

if you have multiple network adapters (or if you have VMware or something like that installed), just replace getLocalIp() with the IP address of the network adapter you use to connect to the internet, eg:
code:
xniff.IP = "10.0.0.1"; // assign your last local IP address, automatically detected (if you want to force a specific ip to listen to, just set it as a string 'XXX.XXX.XXX.XXX')
like it says in the comment ;)

also, Xniff might have problems with wireless connections. I don't know the ins and outs about that, but if you're having problems on wireless, it might be that.

have fun :)

edit: oops, forgot to include the script:P

edit2: oh and it's in dutch... but it's only 1 line to translate: " is een bericht aan het typen." is dutch for " is typing a message."
Thanks thats good. I don't think i ill have to change anything but ... i might.
RE: [request]Key press notifier by CookieRevised on 10-23-2006 at 07:41 PM

quote:
Originally posted by Jesus
I made a script like this a while ago.
It displays a toast when someone is typing to you and you don't have a conversation window open with that contact.
If you click the toast it will (ofcourse) open a convo with the contact.
(y)

though some notes:

1) The script has problems when you use polygamy. When a user has two messengers open this can easly be checked upon with:
code:
var Email = arrdata[1]; // index 12 should give the same email
if (Email !== Messenger.MyEmail) {
... do your stuff
}
2) You assume nick is always in the contactlist. This might not be so in a multi-contact conversation. So additional checking is required there too. Or don't grab the nickname from Messenger.MyContacts.GetContact(Email).Name but grab it from the protocol message directly (decodeURI(arrdata[2])).

3) the global array found isn't needed. The found variable can be a local boolean.

4) Although not so crucial in this script, you should be carefull in using timers like that. The timer will still be running when it was started right before the user signs out (and another one signs in). This makes that your array will be used for other users also and in some scripts (this one too, in a specific situation) this will lead to errors or even manipulation of the contactlist of the wrong user.

5) in ScriptInfo.xml: the ocx is a ActiveX DLL, this should be listed in <OleFiles>, not <DotNetFiles>.

;)

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





This is my version of the script, made from scratch but with your idea:
RE: RE: [request]Key press notifier by Jesus on 10-24-2006 at 01:04 AM

Hey Cookie, thanks for your reply ;)
you have indeed got some points here, but i'll respond to them one by one.

quote:
Originally posted by CookieRevised
(y)

though some notes:

1) The script has problems when you use polygamy. When a user has two messengers open this can easly be checked upon with:
code:
var Email = arrdata[1]; // index 12 should give the same email
if (Email !== Messenger.MyEmail) {
... do your stuff
}

You're right here, but i don't use polygamy so I didn't bother ;)

quote:
2) You assume nick is always in the contactlist. This might not be so in a multi-contact conversation. So additional checking is required there too. Or don't grab the nickname from Messenger.MyContacts.GetContact(Email).Name but grab it from the protocol message directly (decodeURI(arrdata[2])).

If the nick in the toast is not in my list, I don't want to see a toast if they're typing to me (someone else might, but I don't), apart from that I've blocked everyone who's not on my list ;) In multi contact convo's, I wouldn't want a toast for everyone that's typing in there. I see now that I might get a toast like "undefined is typing a message", but i'd fix that by checking if (nick != undefined), so I only get toasts from users on my list.
Also, wouldn't grabbing emails that are NOT on your contactlist cause trouble with the toasts callback function?
quote:
3) the global array found isn't needed. The found variable can be a local boolean.
You're right, I got confused because I first wanted to merge both arrays into one, but for some reason dropped that plan and did it this way.
quote:
4) Although not so crucial in this script, you should be carefull in using timers like that. The timer will still be running when it was started right before the user signs out (and another one signs in). This makes that your array will be used for other users also and in some scripts (this one too, in a specific situation) this will lead to errors or even manipulation of the contactlist of the wrong user.
I don't see how my script can manipulate anyones contactlist.
But then again, I don't know that much about scripting to know what's wrong with it :P
I see you used the same (or at least very similar) method, except for the my@email.com: in front of it.

quote:
5) in ScriptInfo.xml: the ocx is a ActiveX DLL, this should be listed in <OleFiles>, not <DotNetFiles>.
lol, I took that right out of the Xniff thread, this post, worked for me (probably because I had already registered the ocx)
quote:
;)

my version of the script:

(Y)