What happened to the Messenger Plus! forums on msghelp.net?
Shoutbox » MsgHelp Archive » Messenger Plus! for Live Messenger » Scripting » Plug-Ins » Readable Misspeller StuffPlug NG Talker

Pages: (2): « First [ 1 ] 2 » Last »
Readable Misspeller StuffPlug NG Talker
Author: Message:
Improfane
Junior Member
**

Avatar
Woooohoo Bunny!

Posts: 28
Joined: May 2003
O.P. Cool  Readable Misspeller StuffPlug NG Talker
Hello,

Tihs sfufuptlg takler, sbarlmecd up the midlde ptars of words so that dtpiise mlelgsnipiss, you can read them elfrleosftsy!

or if you prefer:

This stuffplug talker, scrambled up the middle parts of words so that dispite misspellings, you can read them effortlessly!

It is based on the concept: http://216.239.59.104/search?q=cache:R79FQj60fnkJ...t.davis/Cmabrigde/
I found this fascinating so I made a talker to do it for me.

Save as "talker.unread.js" in your StuffPlug NG Talker folder and use:
/xtalk unread <your text here>
or to make all your messages use it;
/xautotalker unread
to use!

code:
// Unreader written by Improfane 2005
// Please do not remove this message
// original concept: http://216.239.59.104/search?q=cache:R79FQj60fnkJ...t.davis/Cmabrigde/ (Google Cache)

var words = /[a-z]+/gi ;
// regular expression to grab all words

function talker(input) {
return readable_scrambler(input) ;
}

function readable_scrambler(input) { // makes a readable scramble of an entire string
var matches = input.match(words) ; // list of all words
for (cur_word=0; cur_word < matches.length ; cur_word++) { // cycle through each word
    word = matches[cur_word] ;
    input = input.replace(word, readable_word_scramble(word) ) ;
    }
return input ;
}

function readable_word_scramble(word) { // scrambles the middle part of a string
cur_word_length = word.length ; // current word length

if (cur_word_length>3) { // prevents redundant scrambling
cur_word_middle = word.substring(1,cur_word_length-1) ; // the middle part of the word, from the 2nd letter to the 2nd to last letter
new_middle = scramble(cur_word_middle) ; // scrambles the middle word
return word.replace(cur_word_middle,new_middle) ;
} else return word ;
}

function scramble(input) { // scrambles any input
// written by Improfane 2005
if (input.length<=1) return input ; // nothing at all to scramble
var new_word = "" ;

for (cur_letter=0 ; cur_letter = input.length ; cur_letter++) { // cycle through each letter
random_letter = input.charAt(ranNum(0,input.length)) // get random letter from the possible characters available
input = input.replace(random_letter,"") ; // remove the used letter from the possible characters available
new_word += random_letter ; // adds the random letter to the new string
    }
return new_word ;
}

function ranNum(nFrom,nTo) {
return Math.floor(nFrom + (nTo-nFrom + 1) * Math.random()) ;
// returns a random number
}


It is having some problems with 3 letter words, I'll figure it out, eventually.

[ I haven't visited these forums for a while so here is my response to CookieRevised's post: http://shoutbox.menthix.net/showthread.php?tid=51...d=548567#pid548567 ]
I wrote a generic scrambling function that is irrelevant to the talker above.

All this does is scramble whatever you feed it.

The talker, takes the 2nd letter to the 2nd to last letter and feeds it to the scrambler.

Understand? This is why only the middle letters get scrambled. However, I encountered a bug where despite this, the entire 3 letter string would be passed and therefore scrambled: "the" -> "teh" where instead it should be "the" as the "e" has nowhere to move.

That's why there isn't anything flawed with the scrambler.

I've realised that if it was to be completely modular, the actual talker would be a separate module, named something like "ReadableMispell()" that would itself check the letter length, and inturn call upon the scrambling module.

You didn't say that, you said my scrambling routine was broken.

Instead, I only used a scrambler routine that I've already written in a previous project. Where the length was irrelevant - it was a password generator I believe.

What you are saying would be correct if my scrambler was specific to this project, alas it is not, the check of length would be redundant.

If you want to talk efficiency, I understand your point as scrambling twice is pointless when you can simply check length and therefore valid. I didn't realise you meant this.

After re-reading this (just checking my Google trail)
It doesn't seem to be understood what I mean by modularity. J-Thread wants to remove all the functions and put it as messiness. Cookie didn't need to be an ass about it, either. Explain in English rather than randomly exclaim 'Fix your scrambler' and not tell me how. As far as I'm aware, the word scrambler is not broken. The word one was.

I'd rather not tie the the talker and the word randomizer together. I'd rather be able to reuse it later on. Hence the generic word and scrambler functions.

The only bug was the making [the] to [teh]. The length check is necessary to fix this unless you put word dependent stuff in the first loop. Cleanliness and readability is my mantra.

You can use the scramble function above to mix up any string of characters, for example:
a password, scramble("abcdefghijklmnopqrstuvwxyz0123456789").substring(0,8);

In hindsight, the word check should probably be in the main loop.

This post was edited on 09-26-2007 at 06:04 PM by Improfane.
10-08-2005 10:32 AM
Profile E-Mail PM Find Quote Report
t1a0s
Full Member
***

Avatar

Posts: 107
Reputation: 3
34 / Male / Flag
Joined: Oct 2004
RE: Readable Misspeller StuffPlug NG Talker
Awesome, i really like it :) Gr8 for annoying people with :P

Member since 7330 days, 1 hour, 19 minutes, 20 seconds ago.
10-08-2005 11:47 AM
Profile E-Mail PM Find Quote Report
DragonX
Full Member
***

Avatar

Posts: 226
Reputation: 10
40 / Male / –
Joined: Aug 2005
RE: Readable Misspeller StuffPlug NG Talker
quote:
Originally posted by Improfane
It is having some problems with 3 letter words, I'll figure it out, eventually.
If yur messing up the middle letters of a word, wouldn't it be normal that u have trouble with a 3 letter word, since there's only 1 letter in the middle ?
[Image: dsd-mi_616175.png]
10-08-2005 11:54 AM
Profile E-Mail PM Web Find Quote Report
qgroessl
Veteran Member
*****


Posts: 1615
Reputation: 22
33 / – / Flag
Joined: Jul 2005
Status: Away
RE: Readable Misspeller StuffPlug NG Talker
quote:
Originally posted by DragonX
If yur messing up the middle letters of a word, wouldn't it be normal that u have trouble with a 3 letter word, since there's only 1 letter in the middle ?

:p haha.... That's what I was thinking... It's that if you have words as long as the first and the last letters are in the right place, you should be able to read them.... I guess I'm not awake enough this morning to get that though... As I really had no clue what you said in your post until you translated it.

Anyways... Looks good.
10-08-2005 12:09 PM
Profile PM Find Quote Report
Impheatus
Junior Member
**

Avatar

Posts: 43
40 / Male / –
Joined: Nov 2004
RE: Readable Misspeller StuffPlug NG Talker
quote:
Originally posted by DragonX
quote:
Originally posted by Improfane
It is having some problems with 3 letter words, I'll figure it out, eventually.
If yur messing up the middle letters of a word, wouldn't it be normal that u have trouble with a 3 letter word, since there's only 1 letter in the middle ?
LOL... Well, the 3-letter words would stay exactly the same way, as there is only one variable and it can't switch places to anywhere.
10-08-2005 02:38 PM
Profile E-Mail PM Find Quote Report
cardshark
Junior Member
**

Avatar
Insanity at its Finest

Posts: 88
Reputation: 3
40 / Male / –
Joined: Apr 2005
RE: Readable Misspeller StuffPlug NG Talker
The only problem with that is the same issue people had with the report in the first place: it is not entirely accurate. There are too many words in the English language that have the same letters that if you are trying to unscramble them, you aren't sure which word you are supposed to read it as, even if you can get it based on the context of the sentence (ie. weird and wired, from and form, etc).
10-08-2005 03:41 PM
Profile E-Mail PM Find Quote Report
Improfane
Junior Member
**

Avatar
Woooohoo Bunny!

Posts: 28
Joined: May 2003
O.P. RE: Readable Misspeller StuffPlug NG Talker
Thanks for the replies.

I'm aware that with 3 letter words there is no letters to scramble, but then if everything was scrambled it would be very difficult to read at all.

Words like: the, and, you, for and whatever else help you make sense of the words that are scrambled.

Good Luck and Hppay mpnsllieig!
10-08-2005 04:51 PM
Profile E-Mail PM Find Quote Report
spokes
Full Member
***

Avatar
I <3 Rollerblading

Posts: 423
Reputation: 10
34 / Male / Flag
Joined: May 2004
RE: Readable Misspeller StuffPlug NG Talker
stuffplug comes with this talker...or at least mine did

[Image: sig15ws.png]
10-08-2005 05:44 PM
Profile E-Mail PM Web Find Quote Report
prashker
Veteran Member
*****


Posts: 5109
Reputation: 104
– / Male / –
Joined: Mar 2005
Status: Away
RE: Readable Misspeller StuffPlug NG Talker
quote:
Originally posted by Improfane
the, and, you,


teh :P adn:P yuo:P

I read those perfectly before
10-08-2005 05:56 PM
Profile PM Find Quote Report
J-Thread
Full Member
***

Avatar

Posts: 467
Reputation: 8
– / Male / –
Joined: Jul 2004
RE: Readable Misspeller StuffPlug NG Talker
quote:
It is having some problems with 3 letter words, I'll figure it out, eventually.

The answer is really obvisious.... But well, i'll help you, here it is.
code:
function talker(input) {
// Unreader written by Improfane 2005
// Please do not remove this message
// original concept: http://216.239.59.104/search?q=cache:R79FQj60fnkJ...t.davis/Cmabrigde/ (Google Cache)
var words = /[a-z]+/gi
// regular expression to grab all words

input_length = input.length ; // length of entire string
var matches = input.match(words) ; // list of all words
for (cur_word=0; cur_word < matches.length ; cur_word++) { //cycle through each word
word = matches[cur_word] // current word
cur_word_length = word.length ; // current word length
if(cur_word_length > 3) {
cur_word_middle = word.substring(1,cur_word_length-1) ; // the middle part of the word, from the 2nd letter to the 2nd to last letter

new_middle = scramble(cur_word_middle) ; // scrambles the middle word

input = input.replace(cur_word_middle, new_middle ) ; // makes change to original string
}
}

return input
}

function scramble(input) { // scrambles any input
// written by Improfane 2005
var new_word = "" ;

for (cur_letter=0 ; cur_letter = input.length ; cur_letter++) { // cycle through each letter
random_letter = input.charAt(ranNum(0,input.length)) // get random letter from the possible characters available
input = input.replace(random_letter,"") ; // remove the used letter from the possible characters available
new_word += random_letter ; // adds the random letter to the new string
}
return new_word ; // returns the scrambled word
}


function ranNum(nFrom,nTo) {
return Math.floor(nFrom + (nTo-nFrom + 1) * Math.random()) ;
// returns a random number
}
10-08-2005 10:34 PM
Profile E-Mail PM Find Quote Report
Pages: (2): « First [ 1 ] 2 » 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