Shoutbox

[Help]Closing a window upon remote text. - 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: [Help]Closing a window upon remote text. (/showthread.php?tid=84019)

[Help]Closing a window upon remote text. by yoshiko on 05-30-2008 at 10:31 AM

Hello.

First, i'm sorry if this has been asked before, i've been looking for a while through already done scripts, the official documentation, and searchs through this subforum.

I want to add a small multi-contact chat feature to my script (JabberChatroom-Alike), so the first thing i need is try to %$· close a window.

I realized that for closing the window, i could require use the command /close , so, in this code:

code:
    if(Message.charAt(0)=="." && Message.charAt(1)=="/" && Message.charAt(2)=="x" && Message.charAt(3)==" "){
   
    }
i tried to add the SendMessage("/close"); command, and also calling the On_ChatWndSendMessage(ChatWnd, Message); , but seems senseless, to not say i also tried to do something like ChatWnd.Close , but didnt work.

So, may i ask for guidance? Thank you in advance ^^
RE: [Help]Closing a window upon remote text. by foaly on 05-30-2008 at 11:47 AM

well that code has to be in de onrecieved event... so you'll get something like this:

code:
function OnEvent_ChatWndReceiveMessage(ChatWnd, Origin, Message, MsgKind){
  if(Message.charAt(0)=="." && Message.charAt(1)=="/" && Message.charAt(2)=="x" && Message.charAt(3)==" "){
  ChatWnd.SendMessage("/close");
}
}


that should work...
RE: RE: [Help]Closing a window upon remote text. by yoshiko on 05-30-2008 at 11:54 AM

quote:
Originally posted by foaly
well that code has to be in de onrecieved event... so you'll get something like this:

code:
function OnEvent_ChatWndReceiveMessage(ChatWnd, Origin, Message, MsgKind){
  if(Message.charAt(0)=="." && Message.charAt(1)=="/" && Message.charAt(2)=="x" && Message.charAt(3)==" "){
  ChatWnd.SendMessage("/close");
}
}


that should work...

The code was already on the recievemessage function, though i didnt to paste the full code because there are snippets i dont want to give by now ^^

I was pretty looking for this:
code:
ChatWnd.SendMessage("/close");
Thank you! ^^

EDIT:
So, now i'm facing another problem.

I'm using ChatWnd.SendMessage(); to send messages i recieve to the rest of open windows, using /msgall , but it seems to send the same message various times (3 messages of around 10 lines, wich only the last line of those currently has the message).

So, ideas? O.o