Sign in to follow this  
Followers 0
eekhoorn12

Word Change

10 posts in this topic

#1 ·  Posted (edited)

I need some help with Changing a Word.

For example if you take setlabel wich comes with autoit as an example.

In the file you type a word then you click set label and the word is written in the field above it. Now I want to change the letters so if you type a and then click set label the field above says f or if you type adif is says fink

Hope someone can help me

Edited by eekhoorn12

Share this post


Link to post
Share on other sites



well what would you want it to depend on like the length of the word? like if a word is a certain character long it will say f or if its like longer it will say fi and what are you making this for?

Share this post


Link to post
Share on other sites

It's for a password. I'm making a program that uses an other program.

That program is used to upload files to usenet and many servers require a password. He has protected the password, but it is a verry simple protection.

The maker of the program changes for example the a in an f , the b in an g. So every letter what the user types must be changed in a different letter so i can write it to the ini file of the program.

Share this post


Link to post
Share on other sites

#include <array.au3>
#include <string.au3>

; CAN ONLY USE LETTERS WITH THIS FOR THE RESULT, YOU'LL HAVE TO DO THE NUMBERS SET UP IF YOU WANT TO ALLOW NUMBERS
; THIS IS NOT A VERY SAFE WAY TO DO THIS, NOTICE WHAT I DID FOR THE LAST 5 LETTERS OF THE ALPHABET TO AT LEAST CONFUSE A BIT
; TO MAKE THE DECODER, JUST REPLACE $a_i = $LETTERS[$a_x + 5] WITH THIS $a_i = $LETTERS[$a_x - 5]

$RESULT = InputBox("PASSWORD ENCODER", "ENTER PASSWORD TO ENCODE", "", "", 100, 80)
Dim $LETTERS[31]
$LETTERS[0] = "a"
$LETTERS[1] = "b"
$LETTERS[2] = "c"
$LETTERS[3] = "d"
$LETTERS[4] = "e"
$LETTERS[5] = "f"
$LETTERS[6] = "g"
$LETTERS[7] = "h"
$LETTERS[8] = "i"
$LETTERS[9] = "j"
$LETTERS[10] = "k"
$LETTERS[11] = "l"
$LETTERS[12] = "m"
$LETTERS[13] = "n"
$LETTERS[14] = "o"
$LETTERS[15] = "p"
$LETTERS[16] = "q"
$LETTERS[17] = "r"
$LETTERS[18] = "s"
$LETTERS[19] = "t"
$LETTERS[20] = "u"
$LETTERS[21] = "v"
$LETTERS[22] = "w"
$LETTERS[23] = "x"
$LETTERS[24] = "y"
$LETTERS[25] = "z"
$LETTERS[26] = "0"
$LETTERS[27] = "8"
$LETTERS[28] = "80"
$LETTERS[29] = "08"
$LETTERS[30] = "00"

$END_RESULT = ""
For $x = 1 to StringLen($RESULT)
    For $a_x = 0 To 30
        $i = StringMid($RESULT,$x,1)
        If $i = $LETTERS[$a_x] Then
            $a_i = $LETTERS[$a_x + 5]
            $END_RESULT = $END_RESULT & $a_i
        EndIf
    Next
Next
MsgBox(0, '', $END_RESULT)


[center]Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.[/center]

Share this post


Link to post
Share on other sites

Thanks for the help. I need to change it a bit because it isn't always the fifth letter after it but I wil find a way.

Is there also a way to make a different between small leters and capital letters

Share this post


Link to post
Share on other sites

I always got the 5th letter, the only thing you'll have a problem with is the last 5 letters of the alphabet, but... You could always create a seperate array for that.

I don't understand what you mean make a different....


[center]Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.[/center]

Share this post


Link to post
Share on other sites

That about the fifth problem is solved.

The other thing is that the a is changed into an f, but the A stays the same.

So it must recognise that

Share this post


Link to post
Share on other sites

This is what I have so far:

#include <array.au3>
#include <string.au3>

$RESULT = InputBox("PASSWORD ENCODER", "ENTER PASSWORD TO ENCODE", "", "", 100, 80)
Dim $LETTERS[95]
$LETTERS[0] = "a"
$LETTERS[1] = "b"
$LETTERS[2] = "c"
$LETTERS[3] = "d"
$LETTERS[4] = "e"
$LETTERS[5] = "f"
$LETTERS[6] = "g"
$LETTERS[7] = "h"
$LETTERS[8] = "i"
$LETTERS[9] = "j"
$LETTERS[10] = "k"
$LETTERS[11] = "l"
$LETTERS[12] = "m"
$LETTERS[13] = "n"
$LETTERS[14] = "o"
$LETTERS[15] = "p"
$LETTERS[16] = "q"
$LETTERS[17] = "r"
$LETTERS[18] = "s"
$LETTERS[19] = "t"
$LETTERS[20] = "u"
$LETTERS[21] = "v"
$LETTERS[22] = "w"
$LETTERS[23] = "x"
$LETTERS[24] = "y"
$LETTERS[25] = "z"
$LETTERS[26] = "A"
$LETTERS[27] = "B"
$LETTERS[28] = "C"
$LETTERS[29] = "D"
$LETTERS[30] = "E"
$LETTERS[31] = "F"
$LETTERS[32] = "G"
$LETTERS[33] = "H"
$LETTERS[34] = "I"
$LETTERS[35] = "J"
$LETTERS[36] = "K"
$LETTERS[37] = "L"
$LETTERS[38] = "M"
$LETTERS[39] = "N"
$LETTERS[40] = "O"
$LETTERS[41] = "P"
$LETTERS[42] = "Q"
$LETTERS[43] = "R"
$LETTERS[44] = "S"
$LETTERS[45] = "T"
$LETTERS[46] = "U"
$LETTERS[47] = "V"
$LETTERS[48] = "W"
$LETTERS[49] = "X"
$LETTERS[50] = "Y"
$LETTERS[51] = "Z"
$LETTERS[52] = "!"
$LETTERS[53] = "@"
$LETTERS[54] = "#"
$LETTERS[55] = "$"
$LETTERS[56] = "%"
$LETTERS[57] = "^"
$LETTERS[58] = "&"
$LETTERS[59] = "*"
$LETTERS[60] = "("
$LETTERS[61] = ")"
$LETTERS[62] = "~"
$LETTERS[63] = "`"
$LETTERS[64] = "_"
$LETTERS[65] = "-"
$LETTERS[66] = "+"
$LETTERS[67] = "="
$LETTERS[68] = "{"
$LETTERS[69] = "["
$LETTERS[70] = "}"
$LETTERS[71] = "]"
$LETTERS[72] = ":"
$LETTERS[73] = ";"
$LETTERS[74] = ""
$LETTERS[75] = "'"
$LETTERS[76] = "\"
$LETTERS[77] = "|"
$LETTERS[78] = "<"
$LETTERS[79] = ","
$LETTERS[80] = ">"
$LETTERS[81] = "."
$LETTERS[82] = "?"
$LETTERS[83] = "/"
$LETTERS[84] = "*"
$LETTERS[85] = "1"
$LETTERS[86] = "2"
$LETTERS[87] = "3"
$LETTERS[88] = "4"
$LETTERS[89] = "5"
$LETTERS[90] = "6"
$LETTERS[91] = "7"
$LETTERS[92] = "8"
$LETTERS[93] = "9"
$LETTERS[94] = "0"

$END_RESULT = ""
For $x = 1 to StringLen($RESULT)
    $i = StringMid($RESULT,$x,1)
           If $i = Chr(97) Then
            $a_i = $LETTERS[5]
            $END_RESULT = $END_RESULT & $a_i
       ElseIf $i = $LETTERS[1] Then
            $a_i = $LETTERS[6]
            $END_RESULT = $END_RESULT & $a_i
       ElseIf $i = $LETTERS[2] Then
            $a_i = $LETTERS[7]
            $END_RESULT = $END_RESULT & $a_i
       ElseIf $i = $LETTERS[3] Then
            $a_i = $LETTERS[8]
            $END_RESULT = $END_RESULT & $a_i
       ElseIf $i = $LETTERS[4] Then
            $a_i = $LETTERS[9]
            $END_RESULT = $END_RESULT & $a_i
       ElseIf $i = $LETTERS[5] Then
            $a_i = $LETTERS[10]
            $END_RESULT = $END_RESULT & $a_i
       ElseIf $i = $LETTERS[6] Then
            $a_i = $LETTERS[11]
            $END_RESULT = $END_RESULT & $a_i
       ElseIf $i = $LETTERS[7] Then
            $a_i = $LETTERS[12]
            $END_RESULT = $END_RESULT & $a_i
       ElseIf $i = $LETTERS[8] Then
            $a_i = $LETTERS[13]
            $END_RESULT = $END_RESULT & $a_i
       ElseIf $i = $LETTERS[9] Then
            $a_i = $LETTERS[14]
            $END_RESULT = $END_RESULT & $a_i
       ElseIf $i = $LETTERS[10] Then
            $a_i = $LETTERS[15]
            $END_RESULT = $END_RESULT & $a_i
       ElseIf $i = $LETTERS[11] Then
            $a_i = $LETTERS[16]
            $END_RESULT = $END_RESULT & $a_i
       ElseIf $i = $LETTERS[12] Then
            $a_i = $LETTERS[17]
            $END_RESULT = $END_RESULT & $a_i
       ElseIf $i = $LETTERS[13] Then
            $a_i = $LETTERS[18]
            $END_RESULT = $END_RESULT & $a_i
       ElseIf $i = $LETTERS[14] Then
            $a_i = $LETTERS[19]
            $END_RESULT = $END_RESULT & $a_i
       ElseIf $i = $LETTERS[15] Then
            $a_i = $LETTERS[20]
            $END_RESULT = $END_RESULT & $a_i
       ElseIf $i = $LETTERS[16] Then
            $a_i = $LETTERS[21]
            $END_RESULT = $END_RESULT & $a_i
       ElseIf $i = $LETTERS[17] Then
            $a_i = $LETTERS[22]
            $END_RESULT = $END_RESULT & $a_i
       ElseIf $i = $LETTERS[18] Then
            $a_i = $LETTERS[23]
            $END_RESULT = $END_RESULT & $a_i
       ElseIf $i = $LETTERS[19] Then
            $a_i = $LETTERS[24]
            $END_RESULT = $END_RESULT & $a_i
       ElseIf $i = $LETTERS[20] Then
            $a_i = $LETTERS[25]
            $END_RESULT = $END_RESULT & $a_i
       ElseIf $i = $LETTERS[21] Then
            $a_i = $LETTERS[68]
            $END_RESULT = $END_RESULT & $a_i
       ElseIf $i = $LETTERS[22] Then
            $a_i = $LETTERS[77]
            $END_RESULT = $END_RESULT & $a_i
       ElseIf $i = $LETTERS[23] Then
            $a_i = $LETTERS[70]
            $END_RESULT = $END_RESULT & $a_i
       ElseIf $i = $LETTERS[24] Then
            $a_i = $LETTERS[62]
            $END_RESULT = $END_RESULT & $a_i
       ElseIf $i = $LETTERS[25] Then
            $a_i = $LETTERS[45]
            $END_RESULT = $END_RESULT & $a_i
       ElseIf $i = Chr(65) Then
            $a_i = $LETTERS[26]
            $END_RESULT = $END_RESULT & $a_i
       ElseIf $i = $LETTERS[27] Then
            $a_i = $LETTERS[27]
            $END_RESULT = $END_RESULT & $a_i
       ElseIf $i = $LETTERS[28] Then
            $a_i = $LETTERS[28]
            $END_RESULT = $END_RESULT & $a_i
       ElseIf $i = $LETTERS[29] Then
            $a_i = $LETTERS[29]
            $END_RESULT = $END_RESULT & $a_i
       ElseIf $i = $LETTERS[30] Then
            $a_i = $LETTERS[31]
            $END_RESULT = $END_RESULT & $a_i
       ElseIf $i = $LETTERS[31] Then
            $a_i = $LETTERS[34]
            $END_RESULT = $END_RESULT & $a_i
       ElseIf $i = $LETTERS[32] Then
            $a_i = $LETTERS[35]
            $END_RESULT = $END_RESULT & $a_i
       ElseIf $i = $LETTERS[33] Then
            $a_i = $LETTERS[36]
            $END_RESULT = $END_RESULT & $a_i
       ElseIf $i = $LETTERS[34] Then
            $a_i = $LETTERS[37]
            $END_RESULT = $END_RESULT & $a_i
       ElseIf $i = $LETTERS[35] Then
            $a_i = $LETTERS[38]
            $END_RESULT = $END_RESULT & $a_i
       ElseIf $i = $LETTERS[36] Then
            $a_i = $LETTERS[40]
            $END_RESULT = $END_RESULT & $a_i
       ElseIf $i = $LETTERS[37] Then
            $a_i = $LETTERS[41]
            $END_RESULT = $END_RESULT & $a_i
       ElseIf $i = $LETTERS[38] Then
            $a_i = $LETTERS[42]
            $END_RESULT = $END_RESULT & $a_i
       ElseIf $i = $LETTERS[39] Then
            $a_i = $LETTERS[43]
            $END_RESULT = $END_RESULT & $a_i
       ElseIf $i = $LETTERS[40] Then
            $a_i = $LETTERS[44]
            $END_RESULT = $END_RESULT & $a_i
       ElseIf $i = $LETTERS[41] Then
            $a_i = $LETTERS[46]
            $END_RESULT = $END_RESULT & $a_i
       ElseIf $i = $LETTERS[42] Then
            $a_i = $LETTERS[47]
            $END_RESULT = $END_RESULT & $a_i
       ElseIf $i = $LETTERS[43] Then
            $a_i = $LETTERS[48]
            $END_RESULT = $END_RESULT & $a_i
       ElseIf $i = $LETTERS[44] Then
            $a_i = $LETTERS[49]
            $END_RESULT = $END_RESULT & $a_i
       ElseIf $i = $LETTERS[45] Then
            $a_i = $LETTERS[50]
            $END_RESULT = $END_RESULT & $a_i
       ElseIf $i = $LETTERS[46] Then
            $a_i = $LETTERS[51]
            $END_RESULT = $END_RESULT & $a_i
       ElseIf $i = $LETTERS[47] Then
            $a_i = $LETTERS[69]
            $END_RESULT = $END_RESULT & $a_i
       ElseIf $i = $LETTERS[48] Then
            $a_i = $LETTERS[76]
            $END_RESULT = $END_RESULT & $a_i
       ElseIf $i = $LETTERS[49] Then
            $a_i = $LETTERS[71]
            $END_RESULT = $END_RESULT & $a_i
       ElseIf $i = $LETTERS[50] Then
            $a_i = $LETTERS[57]
            $END_RESULT = $END_RESULT & $a_i
       ElseIf $i = $LETTERS[51] Then
            $a_i = $LETTERS[64]
            $END_RESULT = $END_RESULT & $a_i
       ElseIf $i = $LETTERS[52] Then
            $a_i = $LETTERS[52]
            $END_RESULT = $END_RESULT & $a_i
       ElseIf $i = $LETTERS[53] Then
            $a_i = $LETTERS[53]
            $END_RESULT = $END_RESULT & $a_i
       ElseIf $i = $LETTERS[54] Then
            $a_i = $LETTERS[54]
            $END_RESULT = $END_RESULT & $a_i
       ElseIf $i = $LETTERS[55] Then
            $a_i = $LETTERS[55]
            $END_RESULT = $END_RESULT & $a_i
       ElseIf $i = $LETTERS[56] Then
            $a_i = $LETTERS[56]
            $END_RESULT = $END_RESULT & $a_i
       ElseIf $i = $LETTERS[57] Then
            $a_i = $LETTERS[57]
            $END_RESULT = $END_RESULT & $a_i
       ElseIf $i = $LETTERS[58] Then
            $a_i = $LETTERS[58]
            $END_RESULT = $END_RESULT & $a_i
       ElseIf $i = $LETTERS[59] Then
            $a_i = $LETTERS[59]
            $END_RESULT = $END_RESULT & $a_i
       ElseIf $i = $LETTERS[60] Then
            $a_i = $LETTERS[60]
            $END_RESULT = $END_RESULT & $a_i
       ElseIf $i = $LETTERS[61] Then
            $a_i = $LETTERS[61]
            $END_RESULT = $END_RESULT & $a_i
       ElseIf $i = $LETTERS[62] Then
            $a_i = $LETTERS[32]
            $END_RESULT = $END_RESULT & $a_i
       ElseIf $i = $LETTERS[63] Then
            $a_i = $LETTERS[4]
            $END_RESULT = $END_RESULT & $a_i
       ElseIf $i = $LETTERS[64] Then
            $a_i = $LETTERS[3]
            $END_RESULT = $END_RESULT & $a_i
       ElseIf $i = $LETTERS[65] Then
            $a_i = $LETTERS[65]
            $END_RESULT = $END_RESULT & $a_i
       ElseIf $i = $LETTERS[66] Then
            $a_i = $LETTERS[66]
            $END_RESULT = $END_RESULT & $a_i
       ElseIf $i = $LETTERS[67] Then
            $a_i = $LETTERS[67]
            $END_RESULT = $END_RESULT & $a_i
       ElseIf $i = $LETTERS[68] Then
            $a_i = $LETTERS[39]
            $END_RESULT = $END_RESULT & $a_i
       ElseIf $i = $LETTERS[69] Then
            $a_i = $LETTERS[63]
            $END_RESULT = $END_RESULT & $a_i
       ElseIf $i = $LETTERS[70] Then
            $a_i = $LETTERS[33]
            $END_RESULT = $END_RESULT & $a_i
       ElseIf $i = $LETTERS[71] Then
            $a_i = $LETTERS[1]
            $END_RESULT = $END_RESULT & $a_i
       ElseIf $i = $LETTERS[72] Then
            $a_i = $LETTERS[72]
            $END_RESULT = $END_RESULT & $a_i
       ElseIf $i = $LETTERS[73] Then
            $a_i = $LETTERS[73]
            $END_RESULT = $END_RESULT & $a_i
       ElseIf $i = $LETTERS[75] Then
            $a_i = $LETTERS[75]
            $END_RESULT = $END_RESULT & $a_i
       ElseIf $i = $LETTERS[76] Then
            $a_i = $LETTERS[0]
            $END_RESULT = $END_RESULT & $a_i
       ElseIf $i = $LETTERS[77] Then
            $a_i = $LETTERS[30]
            $END_RESULT = $END_RESULT & $a_i
       ElseIf $i = $LETTERS[78] Then
            $a_i = $LETTERS[78]
            $END_RESULT = $END_RESULT & $a_i
       ElseIf $i = $LETTERS[79] Then
            $a_i = $LETTERS[79]
            $END_RESULT = $END_RESULT & $a_i
       ElseIf $i = $LETTERS[80] Then
            $a_i = $LETTERS[80]
            $END_RESULT = $END_RESULT & $a_i
       ElseIf $i = $LETTERS[81] Then
            $a_i = $LETTERS[81]
            $END_RESULT = $END_RESULT & $a_i
       ElseIf $i = $LETTERS[82] Then
            $a_i = $LETTERS[82]
            $END_RESULT = $END_RESULT & $a_i
       ElseIf $i = $LETTERS[83] Then
            $a_i = $LETTERS[83]
            $END_RESULT = $END_RESULT & $a_i
       ElseIf $i = $LETTERS[84] Then
            $a_i = $LETTERS[84]
            $END_RESULT = $END_RESULT & $a_i
       ElseIf $i = $LETTERS[85] Then
            $a_i = $LETTERS[85]
            $END_RESULT = $END_RESULT & $a_i
       ElseIf $i = $LETTERS[86] Then
            $a_i = $LETTERS[86]
            $END_RESULT = $END_RESULT & $a_i
       ElseIf $i = $LETTERS[87] Then
            $a_i = $LETTERS[87]
            $END_RESULT = $END_RESULT & $a_i
       ElseIf $i = $LETTERS[88] Then
            $a_i = $LETTERS[88]
            $END_RESULT = $END_RESULT & $a_i
       ElseIf $i = $LETTERS[89] Then
            $a_i = $LETTERS[89]
            $END_RESULT = $END_RESULT & $a_i
       ElseIf $i = $LETTERS[90] Then
            $a_i = $LETTERS[90]
            $END_RESULT = $END_RESULT & $a_i
       ElseIf $i = $LETTERS[91] Then
            $a_i = $LETTERS[91]
            $END_RESULT = $END_RESULT & $a_i
       ElseIf $i = $LETTERS[92] Then
            $a_i = $LETTERS[92]
            $END_RESULT = $END_RESULT & $a_i
       ElseIf $i = $LETTERS[93] Then
            $a_i = $LETTERS[93]
            $END_RESULT = $END_RESULT & $a_i
       ElseIf $i = $LETTERS[94] Then
            $a_i = $LETTERS[94]
            $END_RESULT = $END_RESULT & $a_i
       EndIf
Next

MsgBox(0, '', $END_RESULT)

But the problem is that the code can tell the difference between an A and an a, or an H and an h. I've tried it whit chr but that doesn't work. Anyone got an idea

Share this post


Link to post
Share on other sites

I think that you will have to use ASC codes.

ie

Convert text to ASC

Check codes

Make shift by 5 or whatever

Convert back to text



Get Beta versions Here Get latest SciTE editor Here AutoIt 1-2-3 by Valuater - A great starting point.

Time you enjoyed wasting is not wasted time ......T.S. Elliot
Suspense is worse than disappointment................Robert Burns
God help the man who won't help himself, because no-one else will...........My Grandmother

Share this post


Link to post
Share on other sites

I think that you will have to use ASC codes.

ie

Convert text to ASC

Check codes

Make shift by 5 or whatever

Convert back to text

Thanks that worked

Share this post


Link to post
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
Sign in to follow this  
Followers 0