quote:
Originally posted by CookieRevised
quote:
Originally posted by Eagle_Erwin
I'm trying to make a script that closes the conversation-window when a contact signs out.
The code I have now:
(...)
But, this doesn't work. What is wrong in this script, or what script can I use to close the conversation window of the person that signs out?
There is too much wrong to list, so here is the fixed script. Things you got wrong are corrected in in red:
code:
function OnEvent_ContactSignout(Email) {
var contact = Email;
var chats = Messenger.CurrentChats;
var e = new Enumerator(chats);
for(; !e.atEnd(); e.moveNext()) {
var chat = e.item();
var f = new Enumerator(chat.Contacts);
for(; !f.atEnd(); f.moveNext()) {
var contact1 = f.item();
if (contact == contact1.Email) {
Interop.Call("User32", "SendMessageA", chat.Handle, 0x10, 0, 0)
break;
}
}
}
}
But I also advise not to use this script as-is. 2 major drawbacks:
1) It will also close conversation with multiple contacts whenever 1 of those contacts signs out
2) Closing a convo automatically like that will make you often miss messages send by people
Thank you very much, never doubt about it: it works!
And about your advice: The script is used in a WLM-bot, so multiple contacts in one chat doesn't exists in this case. And about your second drawback: Because it is a bot, it doen't matter to ME what the last was the contact said, as long as the bot knows it. And the bot is fast enough, it will 'read' it