Shoutbox

/invite not initiating OnEvent_ChatWndContactAdded? - 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: /invite not initiating OnEvent_ChatWndContactAdded? (/showthread.php?tid=66155)

/invite not initiating OnEvent_ChatWndContactAdded? by Robin4286 on 09-12-2006 at 11:24 PM

It seems that sending /invite using scripts only activates OnEvent_ChatWndContactAdded some of the time. Is there a method to get it to work all of the time using scripts(aka an alternate method to add contacts using scripts)?

Edit: Also, if anyone can help me with how to use timers that would be great too!


RE: /invite not initiating OnEvent_ChatWndContactAdded? by deAd on 09-13-2006 at 12:02 AM

There is not an alternate method. However, after you send the /invite command, you can actually "throw" the event yourself. You'll need to pass all the proper parameters, but you should have access to all those when you invite the contact. The OnEvent_ChatWndContactAdded should be executed like a normal function, because that's all it is.


RE: /invite not initiating OnEvent_ChatWndContactAdded? by Robin4286 on 09-13-2006 at 12:10 AM

Hmmmmm well in that case i think i need to know how to use timers then. Can anyone help with this?


RE: /invite not initiating OnEvent_ChatWndContactAdded? by NanaFreak on 09-13-2006 at 12:13 AM

learn from the scripting documentation its easy


RE: /invite not initiating OnEvent_ChatWndContactAdded? by deAd on 09-13-2006 at 12:15 AM

Yes, the documentation is your friend. Timers are extremely simple and straight-forward.

How would a timer help you get an event called anyways?


RE: /invite not initiating OnEvent_ChatWndContactAdded? by Robin4286 on 09-13-2006 at 12:28 AM

okay, got timers to work, didn't know you needed to put a MsgPlus. next to it. The documentation should be more clear.

Anyways is there a way to close an open chat window using scripts?


RE: /invite not initiating OnEvent_ChatWndContactAdded? by NanaFreak on 09-13-2006 at 12:31 AM

quote:
Originally posted by Shondoit
D'oh, what a remark Mentality :S

code:
var Email = "user@provider.com"

function OnEvent_MyStatusChange (NewStatus) {
   Contact = Messenger.MyContacts.GetContact(Email)
   Messenger.OpenChat(Contact)
}
Different status codes:
2 - Appear Offline
3 - Online
4 - Busy
5 - Be Right Back
6 - Idle
7 - Away
8 - In a Call
9 - Out to Lunch
this might help for opening

will edit with close

close:
code:
ChatWnd.SendMessage('/close');

RE: RE: /invite not initiating OnEvent_ChatWndContactAdded? by markee on 09-13-2006 at 01:18 AM

quote:
Originally posted by Jay_Jay
quote:
Originally posted by Shondoit
D'oh, what a remark Mentality :S

code:
var Email = "user@provider.com"

function OnEvent_MyStatusChange (NewStatus) {
   Contact = Messenger.MyContacts.GetContact(Email)
   Messenger.OpenChat(Contact)
}
Different status codes:
2 - Appear Offline
3 - Online
4 - Busy
5 - Be Right Back
6 - Idle
7 - Away
8 - In a Call
9 - Out to Lunch
this might help for opening

will edit with close

close:
code:
ChatWnd.SendMessage('/close');


quote:
Originally posted by CookieRevised in [url=http://shoutbox.menthix.net/showthread.php?tid=65322
Script Request - Ignore specific contacts[/url]]    code:ChatWnd.SendMessage("/close")

Use the sendmessage api to close the window. This is better because you don't need to send a message to the conversation in that way (for various reasons you wont always be able to send a message to the conversation).

If you can, try using the API instead (though /close will work for now until you are a more advanced scripter).