Join us in Outworldz at www.outworldz.com:9000 or follow us:

Search dozens of selected web sites for OpenSim and LSL script

New! Script Meta-Search will search thousands of scripts here and at other sites for LSL or Opensim scripts.
Loading

Want to add a script or a project? Upload it and a half million people will see it and your name here this year.

Home   Show All
Category: Contributor: Creator
Chat cypher__Al_Bhed_chat_encryption  

cypher__Al_Bhed_chat_encryption


The Al Bhed language is a fictional language that is spoken only by the Al Bhed people on the video game Final Fantasy X . The "Al Bhed language" is actually a simple substitution cipher, an encryption system of transposing certain letters for others. Sherlock Holmes used a similar cipher to decode the "dancing man" letters and solve the case. The code below comes with Al Bhed predefined, but any other cipher works. Just define your own string of unique characters.

Category: Chat
By : Renmiri Writer
Created: 2010-09-11 Edited: 2010-09-11
Worlds: Second Life

the Zip file

Download all files for cypher__Al_Bhed_chat_encryption
Contents are in zip format, with .LSL (text) source code and LSLEdit (text + Solution) formats.
Get file # 1. cypher__Al_Bhed_chat_encryption_1.lsl
1 //
2 // For example, "You are cute" in English is rendered as "Oui yna lida" in Al Bhed:
3 //
4 // You--> Oui (* Y --> O , * O --> U , * U --> I)
5 //
6 // are --> yna (* A --> Y, * R --> N, * E --> A)
7 //
8 // cute --> lida (*C --> L , * O --> U, *T --> D, * E --> A)
9 //
10 // Usage:
11 // Change channel 7576 for your preferred channel. Paste this script on a prim you own, give copies of the prim to all friends you want to chat al bhed with (translations are only viewed by prim owners)
12 //
13 // To say "You are cute" and get al bhed:
14 // /7576 &You are cute
15 // (prim says "Oui yna lida" on normal chat. You and all other script owners using the same channel will see a second message with the translation "You are cute")
16 //
17 // To talk directly in al bhed:
18 // /7576 @Oui yna lida
19 // (prim will repeat "Oui yna lida" in normal chat and translate it to "You are cute" to all script owners on the same channel). This allows people talking al bhed on different channels to understand each other. Just repeat the message to translate to your own channel, with an @ before it, prim will give you a private translation.
20 //
21 // Any message not starting with the Al Bhed tag "@" or the "normal" tag "&" will be ignored. This is good in case someone else or some other script is using the same channel you are. The tags can be replaced by your own tags (Apipe, Epipe)
22 //
23 // This script works to translate any language to al bhed (or other cipher). Can work with kanji too, just change the "english" string to kanji and the "al bed" string to the equivalent kanji.
24 //
25 // It actually is a very flexible, lightning fast cipher encoder / decoder. Hope you enjoy it!
26
27 integer AChan=7576;
28 vector red = <1,0,0>;
29 vector green = <0,1,0>;
30 string Apipe = "@";
31 string Epipe = "&";
32 string english = " abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";
33 string albhed = " ypltavkrezgmshubxncdijfqowYPLTAVKREZGMSHUBXNCDIJFQOW";
34 // to use any other cypher besides al bhed, just replace the string "al bhed" value with unique charaters
35
36 default
37 {
39 {
40 llListen(AChan, "","", "" );
41 llSetText(".",green,1.0);
42 llSetText("speak on channel "+ (string) AChan +" prefaced with "+ Epipe +" to get al bhed, \n you can say albhed text on channel "+ (string) AChan +" but prefaced with "+ Apipe +" to get it translated back to normal",green,1.0);
43 }
44
45 listen( integer channel, string name, key id, string message )
46 {
47
48 integer c = llStringLength(message);
49 string newmessage = "" ;
50 string lcode="";
51 string lcodet="";
52 integer j= 0;
53 integer k= 0;
54 integer i = 1;
55 j=llSubStringIndex(message,Apipe);
56 string message1="";
57 k=llSubStringIndex(message,Epipe);
58 if(j>=0)
59 {
60 for (; i < c; ++i)
61 {
62 lcode = llGetSubString(message,i,i);
63 integer fstop = llSubStringIndex(albhed,lcode);
64 if(fstop > 0)
65 lcodet = llGetSubString(english,fstop,fstop);
66 else
67 lcodet = lcode;
68
69 newmessage += lcodet;
70 }
71 message1 = llGetSubString(message,1,c-1);
72 llOwnerSay("("+name+" says secretly in al bhed) "+newmessage);
73 llSay(0,"("+name+" says in al bhed) "+message1);
74
75 } else {
76 if(k>=0)
77 {
78 for (; i < c; ++i)
79 {
80 lcode = llGetSubString(message,i,i);
81 integer fstop = llSubStringIndex(english,lcode);
82 if(fstop > 0)
83 lcodet = llGetSubString(albhed,fstop,fstop);
84 else
85 lcodet = lcode;
86
87 newmessage += lcodet;
88 }
89 message1 = llGetSubString(message,1,c-1);
90 llOwnerSay("("+name+" says secretly in al bhed) "+message1);
91 llSay(0,"("+name+" says in al bhed) "+newmessage);
92
93 } else {
94 llSay(0,"message --"+message+"-- by "+name+" on chanel "+(string) AChan+" ignored");
95 }
96 }
97 }
98 }

Back to the Best Free Tools in Second Life and OpenSim.