Jump to content

Basic Role Play translator


Lucinda Bulloch
 Share

You are about to reply to a thread that has been inactive for 4181 days.

Please take a moment to consider if this thread is worth bumping.

Recommended Posts

Below is code for a basic translator, you chat in channel 88 or any you choose, the sting is jumbled up to look like a foreign language and printed out in chat, anyone with the same icon will be able to translate it back, it will be said in owner say when translated so no one else can see it.

The icon must be a char that is not likely to be typed by anyone else, it is don't as list's instead of strings so that you can replace single letters with more than one, or symbols, it is fun to play with. In a role play situation each group would speak their own race language so other races did not understand what you were saying

example type

/88hello

♦jbuuw 

will be printed out in chat.

anyone in chat range with "♦" as there icon will pick it up and it will be translated and printed back in owner chat.

 

list charsin = ["a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z"];
list charsout = ["e","k","i","p","b","r","v","j","d","q","o","u","g","t","w","a","s","h","f","n","c","x","m","z","l","y"];
integer channel = 88;
string icon = "♦";
default
{
    on_rez(integer p){llResetScript();}
    state_entry()
    {
     llSetMemoryLimit(0x6000);
     llListen(channel,"",llGetOwner(),"");
     llListen(0,"","","");
    }
   
   listen(integer chan, string name, key id, string option)
    {
     integer x;
     integer y = llStringLength(option);
     string result;   
     string a;
     integer ix;
     if(chan==channel)
      {
       for(x=0;x<y;x++)
        {
         a = llGetSubString(option,x,x);
         ix = llListFindList(charsin,[a]);   
         if(ix!=-1)result+=llList2String(charsout,ix);
         else result += a;  
        }
       llSay(0,icon+result);      
      }
     else if((!chan)&&(llGetSubString(option,0,0)==icon))
      {
       for(x=0;x<y;x++)
        {
         a = llGetSubString(option,x,x);
         ix = llListFindList(charsout,[a]);   
         if(ix!=-1)result+=llList2String(charsin,ix);
         else result += a;  
        }
       llOwnerSay(result);  
      } 
    }
}

 

Link to comment
Share on other sites

  • 4 months later...

I like the twist you put on this. I actually made something of same concept I just did not go to quite the lengths. I merely used the channels to an advantage and had the other person listen to the message they typed on channel 88 and said in OwnerSay. I like that there was much more thought added to this and I think it is great work.

Link to comment
Share on other sites

  • 4 months later...
You are about to reply to a thread that has been inactive for 4181 days.

Please take a moment to consider if this thread is worth bumping.

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
 Share

×
×
  • Create New...