Hello. I was wondering if anyone had thought of making a jQuery-esque library for Messenger Plus! Live. I believe this would make it much easier and quicker to develop scripts, much like jQuery is for web dev.
For example, something like the following could be used as a simple googling script: (minus some parsing)
code:
$("ChatWnd").receiveMessage(
function() {
if(this.message.substr(0, 7) === "!google") {
var wnd = this;
$.get(
"http://www.google.com?q=" + this.message.substr(9, this.message.length - 9),
function(data) {
//parse data here
wnd.send(data);
}
);
}
}
);
I was thinking we could store everything in like an xml data structure, and access it via $(). Like, $("ChatWnd") would select all the ChatWnds, $("ScriptMenu") would select the menu, etc... Or we could do it like $.chatWnd and $.scriptMenu or something... I really don't know atm.
Would anyone be interested in working on this with me?
Edit: Let me clarify on "we could store everything in like an xml data structure".
An example with a LOT of stuff missing:
code:
<Root>
<ChatWnds>
<ChatWnd>
<Handle>{ json rep for HWND object, etc. }</Handle>
<Contacts>
<Contact>
<Blocked>false</Blocked>
<Email>lol@u.com</Email>
<Name>Amec</Name>
<PersonalMessage>Yo.</PersonalMessage>
</Contact>
<Contact>
<Blocked>false</Blocked>
<Email>lol@me.com</Email>
<Name>Yep</Name>
<PersonalMessage>Bro.</PersonalMessage>
</Contact>
</Contacts>
</ChatWnd>
</ChatWnds>
</Root>
One could do $("Contact") to get a Contacts object, or $("Contact > Email:contains('lol')") to get a list of Contacts whose email has 'lol' in it. And this shouldn't just apply to ChatWnds, every data structure (Debug, Messenger, MsgPlus, Emoticons, PlusWnd, Interop, ScriptCommands, ScriptMenu, etc.) should be accessible in this structure, which is updated at run time when data changes...