What happened to the Messenger Plus! forums on msghelp.net?
Shoutbox » MsgHelp Archive » Messenger Plus! for Live Messenger » Scripting » Delayed Writing

Delayed Writing
Author: Message:
whiz
Senior Member
****


Posts: 568
Reputation: 8
– / – / Flag
Joined: Nov 2008
RE: Delayed Writing
quote:
Originally posted by matty
js code:
var oChatWnds = {};

function OnEvent_ChatWndSendMessage(pChatWnd, sMessage) {
    if (sMessage.charAt(0) !== '/' && typeof oChatWnds[pChatWnd.Handle] === 'undefined') {
>>>        oChatWnds[pChatWnd.Handle] = {<<<
>>>            Message : sMessage,<<<
>>>            i : 0<<<
>>>        };<<<
       
        MsgPlus.AddTimer(pChatWnd.Handle, 5000);
       
        return '';
    }
}

function OnEvent_Timer(sTimerId) {
    var oChat = oChatWnds[sTimerId];
    var Message = oChatWnds[sTimerId].Message.charAt(oChatWnds[sTimerId].i);
    if (Message === '/') Message = '//';
    ++oChatWnds[sTimerId].i;
>>>    oChat.SendMessage(Message);<<<
    MsgPlus.AddTimer(sTimerId, 5000);
}

The oChat isn't actually a chat window, but just an object with Message and i properties.

Would this work?
js code:
var oChatWnds = {};

function OnEvent_ChatWndSendMessage(pChatWnd, sMessage) {
    if (sMessage.charAt(0) !== '/' && typeof oChatWnds[pChatWnd.Handle] === 'undefined') {
        oChatWnds[pChatWnd.Handle] = {
            Message : sMessage,
            i : 0,
            Wnd : pChatWnd
        };
       
        MsgPlus.AddTimer(pChatWnd.Handle, 5000);
       
        return '';
    }
}

function OnEvent_Timer(sTimerId) {
    var oChat = oChatWnds[sTimerId];
    var Message = oChatWnds[sTimerId].Message.charAt(oChatWnds[sTimerId].i);
    if (Message === '/') Message = '//';
    ++oChatWnds[sTimerId].i;
    oChat.Wnd.SendMessage(Message);
    MsgPlus.AddTimer(sTimerId, 5000);
}

This post was edited on 06-06-2010 at 09:22 AM by whiz.
06-05-2010 01:36 PM
Profile E-Mail PM Find Quote Report
« Next Oldest Return to Top Next Newest »

Messages In This Thread
Delayed Writing - by Barathrum on 06-04-2010 at 03:40 PM
RE: Delayed Writing - by matty on 06-04-2010 at 05:00 PM
RE: Delayed Writing - by Barathrum on 06-04-2010 at 07:50 PM
RE: Delayed Writing - by matty on 06-04-2010 at 08:17 PM
RE: Delayed Writing - by Matti on 06-05-2010 at 08:08 AM
RE: Delayed Writing - by Barathrum on 06-05-2010 at 10:49 AM
RE: Delayed Writing - by matty on 06-05-2010 at 12:55 PM
RE: Delayed Writing - by Barathrum on 06-05-2010 at 01:29 PM
RE: Delayed Writing - by whiz on 06-05-2010 at 01:36 PM
RE: Delayed Writing - by Barathrum on 06-05-2010 at 02:45 PM
RE: Delayed Writing - by whiz on 06-05-2010 at 03:08 PM
RE: Delayed Writing - by Barathrum on 06-05-2010 at 04:41 PM
RE: Delayed Writing - by whiz on 06-05-2010 at 04:58 PM
RE: Delayed Writing - by Barathrum on 06-05-2010 at 05:29 PM
RE: Delayed Writing - by matty on 06-05-2010 at 06:54 PM
RE: Delayed Writing - by Barathrum on 06-05-2010 at 07:40 PM
RE: Delayed Writing - by matty on 06-06-2010 at 02:12 AM
RE: Delayed Writing - by Barathrum on 06-06-2010 at 07:10 AM


Threaded Mode | Linear Mode
View a Printable Version
Send this Thread to a Friend
Subscribe | Add to Favorites
Rate This Thread:

Forum Jump:

Forum Rules:
You cannot post new threads
You cannot post replies
You cannot post attachments
You can edit your posts
HTML is Off
myCode is On
Smilies are On
[img] Code is On