Jump to content

Covert a normal string into ASCII caracters?


Invi
 Share

Recommended Posts

I`m trying to make a nick generator, something like Dizzy Nick Creator (i supose all of you knows the programme, isnt it?) so i`m trying to make something similar.

I have two textboxes, one button.

When i writte something into textbox1, and click the button, it appears in the second textbox, but with ASCII caracters, and decorated...

That is what i want my programme do...but the first question i have is...how can i convert a string into ascii caracters like Dizzy Nick Creator does?

Thanks you ^^

Link to comment
Share on other sites

First, you need to realize that any characters printed on a standard keyboard ARE ascii characters. :D

Second, I'm not familiar with this program- I'm basing the rest of this post on the speculation that http://hk.youtube.com/watch?v=SoXK2dL2upw shows a true representation of what you're trying to accomplish

Third, if I were trying to write this program, I'd set it up like so:

Figure out all the different variations you want to have as "decorations", and store them in an array, like so

Global $Deco[3]
$Deco[0]="____oooo0000****"
$Deco[1]="....----****"
$Deco[2]="/\/\/\/\/\/\/"

Next, I'd set up a variable for each "normal" letter that you expect to get inputted, similar to this one for o:

Global $o="òóôõö0"

Now, split the input string into an array (here assumed to be the phrase "AutoIt"), each element containing one character:

Global $SplitString=StringSplit("AutoIt","")

Now, loop through $SplitString, replacing each character with a random alternate lookalike character (this is where the magic happens):

Local $DecoNum=Random(0,UBound($Deco)-1,1)
Global $FinalString=$Deco[$DecoNum]
For $nn=1 To $SplitString[0]
  $FinalString&=StringMid(Eval($SplitString[$nn]),Random(1,StringLen(Eval($SplitString[$nn])),1),1)
Next
$FinalString&=_StringReverse($Deco[$DecoNum])
(note you should use IsDeclared to make sure that the current character HAS alternates defined in the script!)

Finally, display your "stylized" string!

MsgBox(0,"Done",$FinalString)

Hope that points you in the right direction! I've given you a method, now you need to put it all together and apply all the necessary elbow-grease! ;)

Reason for edit: a few typos (I've been spending too much time in JS lately...rand() isn't autoit ;) )

also, it's a bad idea to use $i as the FOR loop key, since each instance of "i" in your input string will be replaced with a number!

Edited by james3mg
"There are 10 types of people in this world - those who can read binary, and those who can't.""We've heard that a million monkeys at a million keyboards could produce the complete works of Shakespeare; now, thanks to the Internet, we know that is not true." ~Robert Wilensky0101101 1001010 1100001 1101101 1100101 1110011 0110011 1001101 10001110000101 0000111 0001000 0001110 0001101 0010010 1010110 0100001 1101110
Link to comment
Share on other sites

I looked again at that video, and noticed that some letters get replaced with multiple characters. For instance "A" might be "/\". That won't work using the method I gave you above. Since I was intrigued, I went on a search to figure out how to use something similar as Eval() with arrays (which Eval() doesn't support, but would allow multiple characters).

Here's what I got:

Global $o[3]
$o[0]="ö"
$o[1]="()"
$o[2]="cͻ"

Global $FinalString=""
Global $SplitString=StringSplit("AutoIt","")

For $nn=1 To $SplitString[0]
  If IsDeclared($SplitString[$nn]) Then
    $FinalString&=Execute("$"&$SplitString[$nn]&"["&Random(0,UBound(Execute("$"&SplitString[$nn]))-1,1)&"]")
  Else
    $FinalString&=$SplitString[$nn]
  EndIf
Next

Yay! ;)

"There are 10 types of people in this world - those who can read binary, and those who can't.""We've heard that a million monkeys at a million keyboards could produce the complete works of Shakespeare; now, thanks to the Internet, we know that is not true." ~Robert Wilensky0101101 1001010 1100001 1101101 1100101 1110011 0110011 1001101 10001110000101 0000111 0001000 0001110 0001101 0010010 1010110 0100001 1101110
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...