What happened to the Messenger Plus! forums on msghelp.net?
Shoutbox » MsgHelp Archive » Messenger Plus! for Live Messenger » Scripting » A Radio Code script

A Radio Code script
Author: Message:
markee
Veteran Member
*****

Avatar

Posts: 1622
Reputation: 50
36 / Male / Flag
Joined: Jan 2006
RE: A Radio Code script
Have a try at this:
code:
var letters = {
    "a":"ALPHA",
    "b":"BRAVO",
    "c":"CHARLIE",
    "d":"DELTA",
    "e":"ECHO",
    "f":"FOXTROT",
    "g":"GOLF",
    "h":"HOTEL",
    "i":"INDIA",
    "j":"JULIET",
    "k":"KELO",
    "l":"LIMA",
    "m":"MIKE",
    "n":"NOVEMBER",
    "o":"OSCAR",
    "p":"PAP",
    "q":"QUEBEC",
    "r":"ROMEO",
    "s":"SIRREA",
    "t":"TANGO",
    "u":"UNIFORM",
    "v":"VICTOR",
    "w":"WHISKEY",
    "x":"XRAY",
    "y":"YANKEE",
    "z":"ZULU",
    "1":"ONE",
    "2":"TWO",
    "3":"THREE",
    "4":"FOUR",
    "5":"FIVE",
    "6":"SIX",
    "7":"SEVEN",
    "8":"EIGHT",
    "9":"NINE",
    "0":"ZERO"
}
function OnEvent_ChatWndSendMessage(ChatWnd, sMessage){
    if (/^\/rdocde(?:\s+([\s\S]*)|$)/i.exec(sMessage) !== null) {
        var parameter = RegExp.$1.toLowerCase();
        for(key in letters){
        Debug.Trace(key+"\t"+letters[key]);
            //remove this line if you want double spaces at the end of words
            parameter = parameter.replace(RegExp(key+"\b","g"),letters[key]);
            parameter = parameter.replace(RegExp(key,"g"),letters[key]+" ");
        }
        ChatWnd.SendMessage(parameter);
        return "";
    }
}
function OnGetScriptCommands(){
    return "<ScriptCommands><Command><Name>Radio Code</Name><Description>Convert your message to radio code</Description><Parameters>Message</Parameters></Command>";
}
[Image: markee.png]
05-18-2007 09:56 AM
Profile PM Find Quote Report
« Next Oldest Return to Top Next Newest »

Messages In This Thread
A Radio Code script - by EaglesNestOne on 05-18-2007 at 08:58 AM
RE: A Radio Code script - by markee on 05-18-2007 at 09:56 AM
RE: A Radio Code script - by EaglesNestOne on 05-18-2007 at 09:58 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