Shoutbox

Need a Script maker. - Printable Version

-Shoutbox (https://shoutbox.menthix.net)
+-- Forum: MsgHelp Archive (/forumdisplay.php?fid=58)
+--- Forum: Messenger Plus! for Live Messenger (/forumdisplay.php?fid=4)
+---- Forum: Scripting (/forumdisplay.php?fid=39)
+----- Thread: Need a Script maker. (/showthread.php?tid=92028)

Need a Script maker. by dannyparker on 08-27-2009 at 10:02 PM

Can somebody please make this script if possible..?
A new type of language called "chysdá" its just for abit of fun.

2 word = just turn around. EG - Ok is Ko
3- 6 = 2 words forward. EG Bored Is Debor
7- what ever = 2 words forward one off. EG Dictionary is Rdictiona

If this was made i think the person that made it would be very smart :)


RE: Need a Script maker. by tribbium on 08-29-2009 at 10:47 AM

Thankfully for you, I was bored and sick of looking at jquery stuff so here is your script in its entirety:

Packaged file is below the code.

code:
function OnEvent_ChatWndSendMessage (ChatWnd, message){
    var translated_message = "";

    var non_words = /\W/g;
    var separators = message.match (non_words);
    if (separators == null){
        separators = new Array ("");
    }
    else if (message.indexOf (separators [0]) != 0){ //checks for leading non-word
        separators.unshift ("");
    }
    var words = message.split (non_words);
   
    for (var i in words){
        translated_message += separators [i];
        //vague instructions, made first letter of each word capitalized
        words [i] = words [i].toLowerCase ();
       
        if (words [i].length == 1){
            translated_message += words [i];
        }else if (words [i].length < 7){
            translated_message += words [i].charAt (words [i].length - 1).toUpperCase ()
                            + words [i].charAt (words [i].length - 2)
                            + words [i].substr (0, words [i].length - 2);
        }else{
            translated_message += words [i].charAt (words [i].length - 2).toUpperCase ()
                            + words [i].substr (0, words [i].length - 2);
        }
    }
    if (separators.length > words.length){ //checks for trailing non-word
        translated_message += separators [separators.length - 1];
    }
    return translated_message;
}

RE: Need a Script maker. by dannyparker on 08-29-2009 at 02:19 PM

Thanks!


RE: Need a Script maker. by dannyparker on 08-29-2009 at 02:36 PM

Just One thing, How do i stop it? People start to think im crazy when i dont stop talking it :D


RE: Need a Script maker. by Matti on 08-29-2009 at 06:19 PM

quote:
Originally posted by dannyparker
Just One thing, How do i stop it? People start to think im crazy when i dont stop talking it :D
  1. Open the Plus! preferences by clicking the Plus! button in the contact list and choosing "Preferences" or by typing "/prefs" in any chat window.
  2. Go to the Scripts panel.
  3. Uncheck the "Chysdá" script.
  4. Click OK, the script is now disabled.
If this solution seems to tedious for you, you might want to add some code to store the state of the script and switch the state through the script menu or a chat command.