Translator

Posted by Jcet on Tue 23 Apr 2002 12:13 AM — 3 posts, 15,614 views.

USA #0
Ok, I don't have the first clue on how to do this, so help me out

All it basicly is, is just changing one letter into another, example:
(Actually what I want it to translate it into)
A = Y
B = P
C = L
D = T
E = A
F = V
G = K
H = R
I = E
J = Z
K = G
L = M
M = S
N = H
O = U
P = B
Q = X
R = N
S = C
T = D
U = F
V = I
W = J
X = Q
Y = O
Z = W

Like make it an alias
so like if you type
"al Jcet"
it sends to the world
Say Zlad

Know what I'm saying? If you could tell me how to do I'd put all the letters in, but I don't know yet so I need some Expert Advice... thats where ya'll come in :)
If ya need more info just post and ask
Australia Forum Administrator #1
Quite an interesting project. :)

You need a script like this, which you would call from the alias "al *" ...


sub Translate (AliasName, AliasLine, arrWildcard) 
dim i
dim pos
dim c
dim oldword
dim newword

  oldword = arrWildcard (1)

  ' process each letter

  for i = 1 to len (oldword)

    ' get original letter    
    c = mid (oldword, i, 1)

    ' translate if possible

    pos = instr ("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz", c)

    ' if a match take substitution letter, otherwise copy original letter across

    if pos > 0 then
       newword = newword + mid ("YPLTAVKREZGMSHUBXNCDFIJQOWypltavkrezgmshubxncdfijqow", pos, 1)
    else
       newword = newword + c
    end if

  next

' send results to world

  world.send "say " & newword

end sub


I put in your letters twice, once for upper case and once for lower case. To do a different translation just change the string in the middle with the translated letters.
USA #2
Thanks, yet again!!!!