quote:
Originally posted by 5n4k3
I came across another problem with the script:
js code:
function OnEvent_ChatWndSendMessage( ChatWnd, Message )
{
// See if I'm not busy yet
if( Messenger.MyStatus !== 4 ) {
// Set to busy
Messenger.MyStatus = 4;
}
// Return the unmodified message
// Never forget to return something for ChatWndSendMessage!
return Message;
}
When my auto-message responds it changes my status to busy. How do I fix that?
EDIT: Spent some time on it and I'm thinking I should use something like
js code:
{
if(Message == "<insert my auto-message>"
Messenger.MyStatus = 7;
}
But it doesn't work.
~ 5n4k3
When the auto message is sent, messenger appears to see it as it being sent in the format "AutoMessage: <automessage>" (test it yourself by creating a toast to popup with every message you send, when "you" send an automessage, it comes up in this format). Therefore, a possible solution would be to check if the message sent starts with "AutoMessage: " ...
javascript code:
function OnEvent_ChatWndSendMessage( ChatWnd, Message )
{
//search message for "AutoMessage :"
var automsg = Message.search("AutoMessage :");
if(automsg == -1){
// See if I'm not busy yet
if( Messenger.MyStatus !== 4 ) {
// Set to busy
Messenger.MyStatus = 4;
}
}
// Return the unmodified message
// Never forget to return something for ChatWndSendMessage!
return Message;
}
Note: this would just check if your message has "AutoMessage :" in, so if you typed a message with this in it obviously would pick it up, so a better solution might be to check the position?
Still, it's not the most elegant of solutions... As Matti proved earlier there's more than one way to solve a problem.