I've been thinking... - 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: I've been thinking... (/showthread.php?tid=94070) I've been thinking... by whiz on 03-11-2010 at 08:26 PM
I've seen a few questions about an event for when an email is received. And I remembered this. RE: I've been thinking... by matty on 03-15-2010 at 12:54 PM Yes it could. RE: I've been thinking... by whiz on 03-17-2010 at 08:19 PM
Something I just wrote out. Except it doesn't seem to detect all types of events. Any ideas? js code: RE: I've been thinking... by Spunky on 03-17-2010 at 09:08 PM
Using something like xniff this is a breeze, but I suppose it all depends if that's an option. RE: I've been thinking... by whiz on 03-18-2010 at 07:04 PM
It's difficult for me to test, since I don't have that many contacts, and I have Messenger Plus! event notifications for everything, but after changing a few settings, I have so far worked out that "<user> has just signed in" (contact online) notifications are detected, but "<user> says: <message>" (new message) notifications don't. quote:Possibly, but the "MSN Popup Spy" script that I based it on only searched for one class, and it seemed to detect all types of notifications. RE: I've been thinking... by CookieRevised on 03-19-2010 at 11:29 AM
quote: Popup is a simple numerical variable (which is already the handle of the window), it isn't a Plus! object. So it can't have the Handle property. RE: I've been thinking... by Matti on 03-19-2010 at 05:31 PM
You might also want to make Popups an object instead of an array, like so: js code:The reason for this is that when you assign an element on a given index, the engine will have to create empty elements for all unassigned indexes before that index. You can see this for yourself with this sample code: js code:As you can see, indexes 0 to 8 have to be assigned to undefined before index 9 can be set. We don't need this at all, and when working with big index numbers such as window handles which can range from 0 to 2,147,483,647 this may turn out pretty nasty. I could be wrong about this though, however I still find using arrays for this case inappropriate. I find it to be better practice to assign to an object property when you only need a collection of items and don't actually need a numbered list. It won't cost you in file size either, since {} takes up as much bytes as [], so why not? RE: I've been thinking... by Mnjul on 03-19-2010 at 06:38 PM
quote:Actually no, JScript arrays are sparse. No empty elements are created. The "elements" of 0~8 in your example simply don't exist. RE: I've been thinking... by Spunky on 03-19-2010 at 06:43 PM
quote: quote: That's what I thought until I ran it... RE: I've been thinking... by Mnjul on 03-19-2010 at 07:11 PM Yeah, the length is 10 because the element with the largest index has index of 9, and join iterates from 0 to length-1, using empty strings for those undefined or null's - this doesn't contradict with what I said at all RE: I've been thinking... by Matti on 03-19-2010 at 07:16 PM Well, I wasn't sure about the inner workings of arrays, but still I believe that using an object here is better than an array. Why would you need to create an instance of an array when you're not planning to use any of the extra functionality it offers (such as length, push, pop, slice,...)? Still, I think it's an overkill, but perhaps that's just my opinion. RE: I've been thinking... by whiz on 03-19-2010 at 08:06 PM
Fair enough, I'll change it later (I can't test it right now). |