[Help] Replacing Text Using Scripts (I think I'm dumb lol) |
Author: |
Message: |
Keikonium
Full Member
Posts: 229 Reputation: 3
35 / /
Joined: Jul 2006
|
O.P. [Help] Replacing Text Using Scripts (I think I'm dumb lol)
Here is the code I am using:
code: function OnEvent_ChatWndSendMessage(ChatWnd, sMessage)
{
if(sMessage == "hye");
{
strReplace("hye" == "hey");
}
}
This shall be my first useful script (only other one I made was a popup toast that said "hello" lol).
This however, doesn't work . I have the scripting documentation open, but its sort of confusing me.
I want my script to replace "hye" with "hey". It shouldn't be that hard (I think ), but I have nooo idea what I am doing wrong @_@. Some help ?
|
|
07-11-2006 10:51 PM |
|
|
noroom
Full Member
www.noroom.tk
Posts: 107 Reputation: 4
Joined: Sep 2003
|
RE: [Help] Replacing Text Using Scripts (I think I'm dumb lol)
code: function OnEvent_ChatWndSendMessage(ChatWnd, sMessage)
{
if(sMessage == "hye");
{
return "hey";
}
}
Read a few tutorials for JScript, or even Java/Javascript. They help a lot.
|
|
07-11-2006 10:53 PM |
|
|
Joereynolds89
Junior Member
Posts: 69
Joined: Jul 2006
|
RE: [Help] Replacing Text Using Scripts (I think I'm dumb lol)
how can u do this with numerous letters instead of words, for example i want a simple function that can change a to A, b to B, c to C in ever line as many times as it occurs, for an example as ive shown above make the entire line from lower to upperclass thanks for any help
|
|
07-11-2006 11:11 PM |
|
|
Keikonium
Full Member
Posts: 229 Reputation: 3
35 / /
Joined: Jul 2006
|
O.P. RE: [Help] Replacing Text Using Scripts (I think I'm dumb lol)
I just figured it out . I had my code all wrong >_>.
I can now replace words, letters, symbols, anything... with anything else .
I am creating a script for this thread: Click Here
It is almost done . Just need to find good replacements for each letter of the english alphabet, and I will be good to go. Then I can work on a script for me .
@Joereynolds89: This is quite simple (after you know how to do it . And I had no clue like 5 minutes ago lol). Use this code:
code: function OnEvent_ChatWndSendMessage(pChatWnd, sMessage)
{
sMessage = sMessage.replace("a","A");
sMessage = sMessage.replace("b","B");
...
sMessage = sMessage.replace("y","Y");
sMessage = sMessage.replace("z","Z");
return sMessage;
}
Just do it for each letter of the alphabet .
|
|
07-11-2006 11:16 PM |
|
|
jmccarroll
Full Member
Posts: 141
40 / / –
Joined: Jun 2003
|
RE: RE: [Help] Replacing Text Using Scripts (I think I'm dumb lol)
quote: Originally posted by Joereynolds89
how can u do this with numerous letters instead of words, for example i want a simple function that can change a to A, b to B, c to C in ever line as many times as it occurs, for an example as ive shown above make the entire line from lower to upperclass thanks for any help
Caps Lock?
|
|
07-11-2006 11:17 PM |
|
|
Joereynolds89
Junior Member
Posts: 69
Joined: Jul 2006
|
RE: [Help] Replacing Text Using Scripts (I think I'm dumb lol)
@ Keikonium
thankyou soo much
EDIT: i did it but it only works for the first a, so if i put a i get A but if i put aaa i get Aaa any ideas?
@ jmccarroll
Yes, i could use caps lock but that wasnt my point, that was an example to explain what i wanted, what it will actually do is completely change the letter
This post was edited on 07-11-2006 at 11:24 PM by Joereynolds89.
|
|
07-11-2006 11:17 PM |
|
|
Keikonium
Full Member
Posts: 229 Reputation: 3
35 / /
Joined: Jul 2006
|
O.P. RE: [Help] Replacing Text Using Scripts (I think I'm dumb lol)
I have no idea Joereynolds89 . I will look into it, but can't promise a solution . My script just blew up lol. I am not sure what I changed, but now it doesn't work at all >.<! I wish there was an undo button >_>.
|
|
07-11-2006 11:33 PM |
|
|
Joereynolds89
Junior Member
Posts: 69
Joined: Jul 2006
|
RE: [Help] Replacing Text Using Scripts (I think I'm dumb lol)
lol, i ended up just using quick texts until i no how then i can make it so every1 else can use
|
|
07-11-2006 11:37 PM |
|
|
Nathan
Veteran Member
Yeah, "large dimensions" ;)
Posts: 2984 Reputation: 76
– / /
Joined: Apr 2005
|
RE: [Help] Replacing Text Using Scripts (I think I'm dumb lol)
|
|
07-11-2006 11:41 PM |
|
|
Silentdragon
Full Member
if(life==null && wrists) EmoAlert();
Posts: 148 Reputation: 2
34 / / –
Joined: Jun 2006
|
RE: [Help] Replacing Text Using Scripts (I think I'm dumb lol)
Hmm you can look at this if you want. I wrote it awhile ago, but decided not to release it. Anyway if you want to use it look at the Al Bhed talker in the talkers folder otherwise you can look at the code for your own idea.
Attachment: Talker.plsc (7.03 KB)
This file has been downloaded 150 time(s).
|
|
07-11-2006 11:46 PM |
|
|
Pages: (3):
« First
[ 1 ]
2
3
»
Last »
|
|