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

How to replace messeges
Author: Message:
Barathrum
Junior Member
**

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

Posts: 42
30 / Male / Flag
Joined: Nov 2009
O.P. How to replace messeges
I need script that does following:

Anything I type in chat window will be replaced with "/colorize" + text that was originaly writen

Example if i write in chat window "Hello, everyone" it will ouput "/colorize Hello, everyone"

Hope you understand what i mean.

Thanks for help
01-09-2010 09:55 PM
Profile E-Mail PM Find Quote Report
Spunky
Former Super Mod
*****

Avatar

Posts: 3658
Reputation: 61
36 / Male / Flag
Joined: Aug 2006
RE: How to replace messeges
js code:
function OnEvent_ChatWndSendMessage(ChatWnd, Message){
return "/colorize " + Message
}

Although someone may want to add checks for things like commands being typed, this is a very basic way of doing it
<Eljay> "Problems encountered: shit blew up" :zippy:
01-10-2010 12:07 AM
Profile PM Find Quote Report
Barathrum
Junior Member
**

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

Posts: 42
30 / Male / Flag
Joined: Nov 2009
O.P. RE: How to replace messeges
Strange it does work, but when i try to send it simply says "The command you entered was not recognized" But when I manualy write infront a text /colorize and having this script disabled it works...
01-10-2010 11:03 AM
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: How to replace messeges
Unfortunately that's a nasty glitch from the Plus! engine. When an event is fired, such as OnEvent_ChatWndSendMessage, Plus! executes the event handlers from all enabled scripts in alphabetical order (A to Z).

If your script is named "My Script" and the Colorizer script is called "Colorizer", Colorizer will be executed first. It sees no command so it ignores the message. Your script then adds the command in front but it is no longer parsed by the Colorizer script.

Currently, the only workaround is to name your script something like "AAA - My Script" to make it execute its handlers before the Colorizer script. Another way would be to modify the Colorizer script yourself by removing the requirement for the /colorizer command.

Still, I don't recommend doing this for all messages. Adding /colorizer to every message without proper checks will block all other command from Plus! and any other script. Use some preliminary checks to make sure you're processing only non-command messages.
Plus! Script Developer | Plus! Beta Tester | Creator of Countdown Live | Co-developer of Screenshot Sender 5

Found my post useful? Rate me!
01-10-2010 02:40 PM
Profile E-Mail PM Web Find Quote Report
Barathrum
Junior Member
**

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

Posts: 42
30 / Male / Flag
Joined: Nov 2009
O.P. RE: How to replace messeges
Well now I simply made that colorizer simply works for any message writen not with /colorize command . This seems like the best way :). Thank you both for answering.

This post was edited on 01-10-2010 at 03:18 PM by Barathrum.
01-10-2010 03:17 PM
Profile E-Mail PM Find Quote Report
« 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