What happened to the Messenger Plus! forums on msghelp.net?
Shoutbox » MsgHelp Archive » Messenger Plus! for Live Messenger » Scripting » [Help] Replacing Text Using Scripts (I think I'm dumb lol)

Pages: (3): « First « 1 [ 2 ] 3 » Last »
[Help] Replacing Text Using Scripts (I think I'm dumb lol)
Author: Message:
Joereynolds89
Junior Member
**


Posts: 69
Joined: Jul 2006
RE: [Help] Replacing Text Using Scripts (I think I'm dumb lol)
its a nice script, i like the jive talker :P haha, very funny :D
07-11-2006 11:57 PM
Profile E-Mail PM Find Quote Report
aNILEator
Skinning Contest Winner
*****

Avatar
...in the wake of the aNILEator

Posts: 3718
Reputation: 90
35 / Male / Flag
Joined: Oct 2003
Status: Away
RE: [Help] Replacing Text Using Scripts (I think I'm dumb lol)
OLD SCRIPT HERE, but it works :P

autocorrector

errrm yeah does what you want, would like to update it one day to have windows/boxs etc and replace words inline rather than after you've sent them but anyway, here is autocorrector

---------------------------------------------------------------------------

To add new words to the list whilst in messenger type

/script ac_add before after - for single word errors eg cheees -> cheese

/script ac_add "before word" "after word" - enclose with "speech marks" for corrections with spaces eg cheeseyfood -> cheesey food

simple :)

---------------------------------------------------------------------------

[Image: icon_flag13.gif]EN Version

[Image: icon_flag12.gif]PT Version
---------------------------------------------------------------------------

As i say though this isn't being developped anymore at the moment, sometime later in the future, maybe, but not now

.plsc File Attachment: Auto Corrector EN.plsc (8.7 KB)
This file has been downloaded 250 time(s).

This post was edited on 07-12-2006 at 07:36 AM by aNILEator.
07-12-2006 07:26 AM
Profile PM Web Find Quote Report
aNILEator
Skinning Contest Winner
*****

Avatar
...in the wake of the aNILEator

Posts: 3718
Reputation: 90
35 / Male / Flag
Joined: Oct 2003
Status: Away
RE: [Help] Replacing Text Using Scripts (I think I'm dumb lol)
PT version

.plsc File Attachment: PT.plsc (4.21 KB)
This file has been downloaded 260 time(s).

This post was edited on 07-12-2006 at 07:36 AM by aNILEator.
07-12-2006 07:29 AM
Profile PM Web Find Quote Report
Joereynolds89
Junior Member
**


Posts: 69
Joined: Jul 2006
RE: [Help] Replacing Text Using Scripts (I think I'm dumb lol)
Can somebody tell me how to modify this to repeat how ever many times the first letter appears, and also how to make it so it dosnt use the replacment if it detects www or http etc!
Im only using capitals as an example, in fact they are different symbols

Joe


code:
function OnEvent_Initialize(MessengerStart)
{
}
function OnEvent_ChatWndSendMessage(pChatWnd, sMessage)
{
sMessage = sMessage.replace("a","A");
sMessage = sMessage.replace("b","B");
sMessage = sMessage.replace("c","C");
sMessage = sMessage.replace("d","D");
sMessage = sMessage.replace("e","E");
sMessage = sMessage.replace("f","F");
sMessage = sMessage.replace("g","G");
sMessage = sMessage.replace("h","H");
sMessage = sMessage.replace("i","I");
sMessage = sMessage.replace("j","J");
sMessage = sMessage.replace("k","K");
sMessage = sMessage.replace("l","L");
sMessage = sMessage.replace("m","M");
sMessage = sMessage.replace("n","N");
sMessage = sMessage.replace("o","O");
sMessage = sMessage.replace("p","P");
sMessage = sMessage.replace("q","Q");
sMessage = sMessage.replace("r","R");
sMessage = sMessage.replace("s","S");
sMessage = sMessage.replace("t","T");
sMessage = sMessage.replace("u","U");
sMessage = sMessage.replace("v","V");
sMessage = sMessage.replace("w","W");
sMessage = sMessage.replace("x","X");
sMessage = sMessage.replace("y","Y");
sMessage = sMessage.replace("z","Z");
return sMessage;
}
function OnEvent_Uninitialize(MessengerExit)
{
}

07-12-2006 01:05 PM
Profile E-Mail PM Find Quote Report
noroom
Full Member
***

Avatar
www.noroom.tk

Posts: 107
Reputation: 4
Joined: Sep 2003
RE: [Help] Replacing Text Using Scripts (I think I'm dumb lol)
Don't Strings have a .toUpperCase() method?
07-12-2006 01:31 PM
Profile E-Mail PM Find Quote Report
Joereynolds89
Junior Member
**


Posts: 69
Joined: Jul 2006
RE: RE: [Help] Replacing Text Using Scripts (I think I'm dumb lol)
quote:
Originally posted by noroom
Don't Strings have a .toUpperCase() method?


Maybe you didnt read my post, you just read the code?

Someone help please :D
07-12-2006 01:37 PM
Profile E-Mail PM Find Quote Report
Keikonium
Full Member
***


Posts: 229
Reputation: 3
35 / Male / Flag
Joined: Jul 2006
O.P. RE: [Help] Replacing Text Using Scripts (I think I'm dumb lol)
for http and www just use:

sMessage = sMessage.replace("http","http");
and
sMessage = sMessage.replace("www","www");

It will see that the message has all of those grouped together, so it will make the group not change. It should work, but I haven't tested it >_>.

As for aaa --> AAA, I still haven't figured that out ^o). I was thinking perhaps:

sMessage = sMessage.replace("a"*,"A"*);

(using * as a random character, so whatever comes after the A will be capital also). This obviously didn't work, and I am sure the solution is simple, but I have no idea lol.

Hopefully somone more experienced in scripting comes along to help you out (Y).

EDIT:

How are you gonna handle links? Even if the "www" and "http" are correct, the address will still be incorrect will it not?

This post was edited on 07-12-2006 at 01:54 PM by Keikonium.
07-12-2006 01:47 PM
Profile E-Mail PM Find Quote Report
Pai
Full Member
***

w00t !

Posts: 203
Reputation: 2
– / Male / –
Joined: Sep 2003
RE: [Help] Replacing Text Using Scripts (I think I'm dumb lol)
To replace all occurrences of one letter, you must use regular expressions. They come in a form of /pattern/switch , and you must use the g switch for global search (for more information on regular expression, google it)

so, the correct code for replacing all occurrences of "a" is:

sMessage = sMessage.replace(/a/g,"A");

(notice you don't use " " in a regular expression)
07-12-2006 01:55 PM
Profile PM Find Quote Report
Joereynolds89
Junior Member
**


Posts: 69
Joined: Jul 2006
RE: [Help] Replacing Text Using Scripts (I think I'm dumb lol)
quote:
Originally posted by Keikonium

How are you gonna handle links? Even if the "www" and "http" are correct, the address will still be incorrect will it not?

i didnt mean the http as in http i meant ignore all changed if http is part of it :( anyone no? ive seen it i just cant remember where! maybe if theres away to say if / is put before the sentence all changes are ignored?? the / isnt sent though

@Pai dosnt seem to work

This post was edited on 07-12-2006 at 02:37 PM by Joereynolds89.
07-12-2006 02:25 PM
Profile E-Mail PM Find Quote Report
Pai
Full Member
***

w00t !

Posts: 203
Reputation: 2
– / Male / –
Joined: Sep 2003
RE: [Help] Replacing Text Using Scripts (I think I'm dumb lol)
Then you did something wrong, because it does work ;)

Test case:
code:
    var str = "aaaaaaaaaaaaaaaaaaa"
    var str1 = str.replace("a","A");
    Debug.Trace(str1);
    var str2 = str.replace(/a/g,"A");
    Debug.Trace(str2);

returns:
code:
Aaaaaaaaaaaaaaaaaaa
AAAAAAAAAAAAAAAAAAA


-----------------------
to ignore links do something like
code:
if (!str.match('www') && !str.match('http')) { // it's not a link }

This post was edited on 07-12-2006 at 05:56 PM by Pai.
07-12-2006 05:48 PM
Profile PM Find Quote Report
Pages: (3): « First « 1 [ 2 ] 3 » Last »
« Next Oldest Return to Top Next Newest »


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