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

Pages: (2): « First [ 1 ] 2 » Last »
Delayed Writing
Author: Message:
Barathrum
Junior Member
**

Avatar
.......................

Posts: 42
30 / Male / Flag
Joined: Nov 2009
O.P. Delayed Writing
1. Is it possible to make a script that does the following:

Whenever I write anything, it will write the message character by character with delay of 0.5 second. So example:

"Hello"   will become:

H  <0,5s> e <0,5s> l <0,5s> l <0,5s> o <0,5s>

It should write it in same message, not new line for each character.



2. Second question:

I have this script here:

code:
function OnEvent_ChatWndSendMessage(ChatWnd, Message){
return "msg = [ " + Message + " ]"
}



How would I make everything except the Message some color?
06-04-2010 03:40 PM
Profile E-Mail PM Find Quote Report
matty
Scripting Guru
*****


Posts: 8336
Reputation: 109
39 / Male / Flag
Joined: Dec 2002
Status: Away
RE: Delayed Writing
You cannot have WLM send a message character by character and have it appear on the same line. This is impossible. However you can have it send the messages on different lines.

As for the other question you can use [c][/c] tags... for instance [c=4]test[/c] would be test
06-04-2010 05:00 PM
Profile E-Mail PM Find Quote Report
Barathrum
Junior Member
**

Avatar
.......................

Posts: 42
30 / Male / Flag
Joined: Nov 2009
O.P. RE: Delayed Writing
Oh too bad, can you post for on new line code someone?

Thank you, also I'll use the colors now.
06-04-2010 07:50 PM
Profile E-Mail PM Find Quote Report
matty
Scripting Guru
*****


Posts: 8336
Reputation: 109
39 / Male / Flag
Joined: Dec 2002
Status: Away
RE: Delayed Writing
Untested...

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);
}

This post was edited on 06-05-2010 at 12:54 PM by matty.
06-04-2010 08:17 PM
Profile E-Mail PM Find Quote Report
Matti
Elite Member
*****

Avatar
Script Developer and Helper

Posts: 1646
Reputation: 39
32 / Male / Flag
Joined: Apr 2004
RE: Delayed Writing
You might want to change the 5000 ms delay into a 500 ms delay, it'd take a really long time before the message is fully transmitted. (Typo I guess? :P)

Also, wouldn't the built-in flood protection prevent the script from working correctly? The counter from the amount of messages sent by the script can be reset when the user sends a message himself, but this is also prevented by the script. The user can't reset the counter because all messages are intercepted (unless of course he sends a /command).

It just doesn't seem a good idea to try this, there are too many obstacles which you can't really get around. I believe it would also be very irritating for you contacts to have to wait several seconds before they get your message.
Plus! Script Developer | Plus! Beta Tester | Creator of Countdown Live | Co-developer of Screenshot Sender 5

Found my post useful? Rate me!
06-05-2010 08:08 AM
Profile E-Mail PM Web Find Quote Report
Barathrum
Junior Member
**

Avatar
.......................

Posts: 42
30 / Male / Flag
Joined: Nov 2009
O.P. RE: Delayed Writing
Error:


Script has been stopped
Script is starting
Script is now loaded and ready
Function called: OnEvent_ChatWndSendMessage
Error: Object expected (code: -2146823281)
       File: Delayed Typing.js. Line: 20.
Function OnEvent_Timer returned an error. Code: -2147352567

This post was edited on 06-05-2010 at 10:51 AM by Barathrum.
06-05-2010 10:49 AM
Profile E-Mail PM Find Quote Report
matty
Scripting Guru
*****


Posts: 8336
Reputation: 109
39 / Male / Flag
Joined: Dec 2002
Status: Away
RE: Delayed Writing
quote:
Originally posted by Barathrum
Error:


Script has been stopped
Script is starting
Script is now loaded and ready
Function called: OnEvent_ChatWndSendMessage
Error: Object expected (code: -2146823281)
       File: Delayed Typing.js. Line: 20.
Function OnEvent_Timer returned an error. Code: -2147352567
Fixed... needed to replace ++i with ++oChatWnds[sTimerId].i
06-05-2010 12:55 PM
Profile E-Mail PM Find Quote Report
Barathrum
Junior Member
**

Avatar
.......................

Posts: 42
30 / Male / Flag
Joined: Nov 2009
O.P. RE: Delayed Writing
Now there an other error:

Function called: OnEvent_ChatWndSendMessage
Error: Object doesn't support this property or method (code: -2146827850)
       File: Delayed Typing.js. Line: 21.
Function OnEvent_Timer returned an error. Code: -2147352567
06-05-2010 01:29 PM
Profile E-Mail PM Find Quote Report
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
Barathrum
Junior Member
**

Avatar
.......................

Posts: 42
30 / Male / Flag
Joined: Nov 2009
O.P. RE: Delayed Writing
Error :/


Error: Expected '}' (code: -2146827279)
       File: Delayed Typing.js. Line: 8.
06-05-2010 02:45 PM
Profile E-Mail PM Find Quote Report
Pages: (2): « First [ 1 ] 2 » Last »
« Next Oldest Return to Top Next Newest »


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