Shoutbox

[Request]Letter change - 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: [Request]Letter change (/showthread.php?tid=91511)

[Request]Letter change by akyyy on 07-16-2009 at 09:02 PM

I need very simple script.

So.

If I writte specially letter (e.g. á, é)
Script changer a and e!
(6)


RE: [Request]Letter change by MrT on 07-18-2009 at 11:04 AM

function OnEvent_ChatWndSendMessage(ChatWnd, Message) {
msg = Message
msg = msg.replace("á","a");
msg = msg.replace("é","e");
return msg
}

i think it will work


RE: [Request]Letter change by Spunky on 07-18-2009 at 12:04 PM

code:
function OnEvent_ChatWndSendMessage(cw, m) {
  return  m.replace(/a/g,"á").replace(/e/g,"é");
}


Yours won't work if there is more than one instance of "a" or "e"...
A RegExp will do tthe trick and I've shortened the code quite a bit too