T3XT SCRiiPT |
Author: |
Message: |
Chunk1993
Junior Member
Posts: 78
31 / /
Joined: Jul 2007
|
O.P. T3XT SCRiiPT
Can anyone please make a script that changes all letters to capitals, all i's to small ii and E's to 3's?
Thanks In Advance...
|
|
07-07-2007 04:34 PM |
|
|
toddy
Veteran Member
kcus uoy
Posts: 2573 Reputation: 49
– / /
Joined: Jun 2004
|
RE: T3XT SCRiiPT
code: function OnEvent_ChatWndSendMessage(ChatWnd, Message){
switch (Message){
default:
{
Message = Message.replace(/a/gi,"A");
Message = Message.replace(/b/gi,"B");
Message = Message.replace(/c/gi,"C");
Message = Message.replace(/d/gi,"D");
Message = Message.replace(/e/gi,"3");
Message = Message.replace(/f/gi,"F");
Message = Message.replace(/g/gi,"G");
Message = Message.replace(/h/gi,"H");
Message = Message.replace(/i/gi,"ii");
Message = Message.replace(/j/gi,"J");
Message = Message.replace(/k/gi,"K");
Message = Message.replace(/l/gi,"L");
Message = Message.replace(/m/gi,"M");
Message = Message.replace(/n/gi,"N");
Message = Message.replace(/o/gi,"O");
Message = Message.replace(/p/gi,"P");
Message = Message.replace(/q/gi,"Q");
Message = Message.replace(/r/gi,"R");
Message = Message.replace(/s/gi,"S");
Message = Message.replace(/t/gi,"T");
Message = Message.replace(/u/gi,"U");
Message = Message.replace(/v/gi,"V");
Message = Message.replace(/w/gi,"W");
Message = Message.replace(/x/gi,"X");
Message = Message.replace(/y/gi,"Y");
Message = Message.replace(/z/gi,"Z");
return Message
}
}
}
|
|
07-07-2007 04:55 PM |
|
|
Chunk1993
Junior Member
Posts: 78
31 / /
Joined: Jul 2007
|
O.P. RE: T3XT SCRiiPT
Thanks so much
|
|
07-07-2007 04:59 PM |
|
|
toddy
Veteran Member
kcus uoy
Posts: 2573 Reputation: 49
– / /
Joined: Jun 2004
|
RE: T3XT SCRiiPT
quote: Originally posted by Chunk1993
Thanks so much
most people will hate you tho if you always type in caps.
anyways, updated it abit. so you can enable & disable it
code: function OnGetScriptCommands ()
{
commands = "<ScriptCommands>";
commands += "<Command>";
commands += "<Name>startcaps</Name>";
commands += "<Description>Replace lower Case to caps - Start</Description>";
commands += "</Command>";
commands += "<Command>";
commands += "<Name>stopcaps</Name>";
commands += "<Description>Replace lower Case to caps - Stop</Description>";
commands += "</Command>";
commands += "</ScriptCommands>";
return commands;
}
var sEnabled = false;
function OnEvent_ChatWndSendMessage(ChatWnd, Message){
switch (Message){
case "/startcaps":
sEnabled = true
return '';
case "/stopcaps":
sEnabled = false;
return '';
default:
if (sEnabled = true){
Message = Message.replace(/a/gi,"A");
Message = Message.replace(/b/gi,"B");
Message = Message.replace(/c/gi,"C");
Message = Message.replace(/d/gi,"D");
Message = Message.replace(/e/gi,"3");
Message = Message.replace(/f/gi,"F");
Message = Message.replace(/g/gi,"G");
Message = Message.replace(/h/gi,"H");
Message = Message.replace(/i/gi,"ii");
Message = Message.replace(/j/gi,"J");
Message = Message.replace(/k/gi,"K");
Message = Message.replace(/l/gi,"L");
Message = Message.replace(/m/gi,"M");
Message = Message.replace(/n/gi,"N");
Message = Message.replace(/o/gi,"O");
Message = Message.replace(/p/gi,"P");
Message = Message.replace(/q/gi,"Q");
Message = Message.replace(/r/gi,"R");
Message = Message.replace(/s/gi,"S");
Message = Message.replace(/t/gi,"T");
Message = Message.replace(/u/gi,"U");
Message = Message.replace(/v/gi,"V");
Message = Message.replace(/w/gi,"W");
Message = Message.replace(/x/gi,"X");
Message = Message.replace(/y/gi,"Y");
Message = Message.replace(/z/gi,"Z");
return Message
}
}
}
This post was edited on 07-07-2007 at 05:25 PM by toddy.
|
|
07-07-2007 05:25 PM |
|
|
Chunk1993
Junior Member
Posts: 78
31 / /
Joined: Jul 2007
|
O.P. RE: T3XT SCRiiPT
Probably yeah - but oh well, thanks again
|
|
07-07-2007 05:27 PM |
|
|
Volv
Skinning Contest Winner
Posts: 1233 Reputation: 31
35 / /
Joined: Oct 2004
|
RE: T3XT SCRiiPT
toddy, what happens if i type the message "E" - unless i've missed something your script won't pick it up
EDIT: nevermind, misread reg expression
A much better alternative would be to use JScript's in-built toUpperCase() function.
Message = Message.toUpperCase();
Message = Message.replace(/E/g,"3");
Message = Message.replace(/I/g,"ii");
This post was edited on 07-07-2007 at 06:15 PM by Volv.
|
|
07-07-2007 06:10 PM |
|
|
John Anderton
Elite Member
Posts: 3908 Reputation: 80
37 / /
Joined: Nov 2004
Status: Away
|
RE: T3XT SCRiiPT
quote: Originally posted by toddy
if (sEnabled = true){
I hope you mean
code: if (sEnabled == true)
Else your code will always be switched on
[
KarunAB.com]
[img]http://gamercards.exophase.com/459422.png[
/img]
|
|
07-07-2007 06:15 PM |
|
|
Chunk1993
Junior Member
Posts: 78
31 / /
Joined: Jul 2007
|
O.P. RE: T3XT SCRiiPT
I wondered why it wasn't working! I had to turn it on and off manually. Thanks it works now!
|
|
07-07-2007 06:19 PM |
|
|
toddy
Veteran Member
kcus uoy
Posts: 2573 Reputation: 49
– / /
Joined: Jun 2004
|
|
07-07-2007 08:33 PM |
|
|
markee
Veteran Member
Posts: 1622 Reputation: 50
36 / /
Joined: Jan 2006
|
RE: T3XT SCRiiPT
quote: Originally posted by John Anderton
quote: Originally posted by toddy
if (sEnabled = true){
I hope you mean
code: if (sEnabled == true)
I hope you mean
code: if(sEnabled === true)
Else your code will take longer to do the same thing
* markee runs
|
|
07-08-2007 02:56 PM |
|
|
|
|