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 Arabic_Left_to_Right_chat_al_bhed  

Arabic_Left_to_Right_chat_al_bhed

Left to right rendering of Chat (for Arabic) and also Al Bhed translation
Same as http://www.free-lsl-scripts.com//freescripts.plx?ID=1510

added a few lines to read the string backwards (for left to right rendering), on the al bhed and english "if" and added a section for unaltered chat (except for left to right rendering).

Category: Chat
By : Renmiri Writer
Created: 2013-09-06 Edited: 2010-10-25
Worlds: Second Life

the Zip file

Download all files for Arabic_Left_to_Right_chat_al_bhed
Contents are in zip format, with .LSL (text) source code and LSLEdit (text + Solution) formats.
Get file # 1. Arabic_Left_to_Right_chat_al_bhed_1.lsl
1 integer AChan=5;
2 vector red = <1,0,0>;
3 vector green = <0,1,0>;
4 string Apipe = "@";
5 string Epipe = "&";
6 string Arabic = " ابتثجحخدذرزسشصضطظعغفقكلمنهويyou";
7 string AlBhed = " ﺍﺑﺘﺜﺠﺤﺨﺪﺫﺭﺯﺳﺸﺼﻀﻄﻈﻌﻐﻔﻘﻜﻠﻤﻨﻬﻮﻱoui";
8 // to use any other cypher besides al bhed, just replace the string "al bhed" value with unique charaters
9 // Arabic al bhed by Khaled Dix, code by Renmiri Writer
10 //you and oui are here just for testing, if like me, you can't read arabic :p -- Ren
11 //
12
13 default
14 {
16 {
17 llListen(AChan, "","", "" );
18 llSetText(".",green,1.0);
19 llSetText("speak on channel "+ (string) AChan +" to get it left to right \n To get Al Bhed chat preface Arabic text with "+ Epipe +" \n To translate Al Bhed use preface"+ Apipe +" ",green,1.0);
20 }
21
22 listen( integer channel, string name, key id, string message )
23 {
24
25 integer c = llStringLength(message);
26 string newmessage = "" ;
27 string lcode="";
28 string lcodet="";
29 integer j= 0;
30 integer k= 0;
31 integer i = 1;
32 j=llSubStringIndex(message,Apipe);
33 string message1="";
34 k=llSubStringIndex(message,Epipe);
35 if(j>=0)
36 {
37 for (; i < c; ++i)
38 {
39 lcode = llGetSubString(message,i,i);
40 integer fstop = llSubStringIndex(AlBhed,lcode);
41 if(fstop > 0)
42 lcodet = llGetSubString(Arabic,fstop,fstop);
43 else
44 lcodet = lcode;
45
46 newmessage += lcodet;
47 }
48 message1 = llGetSubString(message,1,c-1);
49 integer ar = 0;
50 integer c1 = llStringLength(newmessage);
51 string message2="";
52 for (ar=1;ar <=c1;++ar){
53 message2 += llGetSubString(message1,0-ar,0-ar);
54 //llSay(0,message2);
55 }
56 string message3="";
57 for (ar=1;ar <=c1;++ar){
58 message3 += llGetSubString(newmessage,0-ar,0-ar);
59 //llSay(0,message3);
60 }
61 llOwnerSay("("+name+" says secretly in al bhed) "+message3);
62 llSay(0,"("+name+" says in al bhed) "+message2);
63
64 } else {
65 if(k>=0)
66 {
67 for (; i < c; ++i)
68 {
69 lcode = llGetSubString(message,i,i);
70 integer fstop = llSubStringIndex(Arabic,lcode);
71 if(fstop > 0)
72 lcodet = llGetSubString(AlBhed,fstop,fstop);
73 else
74 lcodet = lcode;
75
76 newmessage += lcodet;
77 }
78 message1 = llGetSubString(message,1,c+1);
79 integer ar = 0;
80 integer c1 = llStringLength(newmessage);
81 string message2="";
82 for (ar=1;ar <=c1;++ar){
83 message2 += llGetSubString(message1,0-ar,0-ar);
84 //llSay(0,message2);
85 }
86 string message3="";
87 for (ar=1;ar <=c1;++ar){
88 message3 += llGetSubString(newmessage,0-ar,0-ar);
89 //llSay(0,message3);
90 }
91 llOwnerSay("("+name+" says secretly in al bhed) "+message2);
92 llSay(0,"("+name+" says in al bhed) "+message3);
93
94 } else {
95 //llSay(0,"message --"+message+"-- by "+name+" on chanel "+AChan+" ignored");
96 string message3="";
97 integer ar = 0;
98 integer c1 = llStringLength(message);
99 for (ar=1;ar <=c1;++ar){
100 message3 += llGetSubString(message,0-ar,0-ar);
101 //llSay(0,message3);
102 }
103 llSay(0,"("+name+" says left to right) "+message3);
104 }
105 }
106 }
107 }
108
109

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