Difference between revisions of "User talk:Perry Mizin"

From Second Life Wiki
Jump to navigation Jump to search
Line 65: Line 65:
         rxTxtLotBusy = TRUE;
         rxTxtLotBusy = TRUE;
         integer rxliPos;
         integer rxliPos;
        rxliPosChk = -1; //Perry Mizin: added last listPos check, this could fail or prevent fail
         string  rxtmpStr = "";
         string  rxtmpStr = "";
         @rxin;
         if(~llListFindList(sayCache, (list)rxid))
        rxliPos = llListFindList(sayCache, [rxid]);
        if (rxliPos != -1|rxliPosChk) //Perry Mizin:(rxliPos != -1 && rxliPos != rxliPosChk)
         {
         {
             rxliPosChk = rxliPos;
             @rxin;
            rxliPos = llListFindList(sayCache, [rxid]);
             rxtmpStr = (rxtmpStr="") + rxtmpStr + llList2String(sayCache, rxliPos + 1);
             rxtmpStr = (rxtmpStr="") + rxtmpStr + llList2String(sayCache, rxliPos + 1);
             sayCache = llDeleteSubList(sayCache, rxliPos, rxliPos + 1);
             sayCache = llDeleteSubList(sayCache, rxliPos, rxliPos + 1);

Revision as of 14:19, 13 December 2009

Bienvenid@

Hola, soy Perry Mizin y este será mi humilde intento de contribucion al proyecto "Traductor Universal de Google" creado por Hank Ramos.

El siguiente codigo fué originalmente creado por Hank Ramos, empezaré modificando algunas funciones a mi manera... No os riais

Welcome

Hello, I am Perry Mizin and this will be my humble try to contribute with the project "Universal Google Translator" created by Hank Ramos.

The next code was originally created by Hank Ramos, I will start modifiying some functions on my way... Don´t laugh


THE CODE BELOW IS NOT TESTED

txTxtLot() = sendTextBatch() <lsl> txTxtLot(integer txch, string txtxt) {

   txtxt = llXorBase64StringsCorrect(llStringToBase64(txtxt), llStringToBase64(password));
   while (llStringLength(txtxt) > 508) //If string is 509 characters or longer 
   {
       llSay(txch, llGetSubString(txtxt, 0, 507)); //send 508 character chunk
       txtxt = llGetSubString(txtxt, 508, -1);  //delete 508 character chunk
   }
   llSay(txch, txtxt);  //send out any remainder chunk or original chunk
   //Perry Mizin Comment: I don´t understand the aim of the following if.    
   //Hank Ramos Comment: this line serves to "trigger" the receiver not to wait for another batch.  If the
   //message length is exactly 508 characters, the receiver things that another chunk of the message is coming.
   //This message serves to tell the receiver that the last chunk was the last chunk, not another regular chunk.
   if (llStringLength(txtxt) == 508)
       llSay(txch, (string)(txch*4958654));
   //Hank Ramos Comment: this just flashes the color of the bottom prim to show a message was sent
   llMessageLinked(LINK_ALL_CHILDREN, 6634934, (string)<0.25, 0, 0.25>, ""); 

} </lsl>


string rxTxtLot() = string receiveTextBatch() <lsl> string rxTxtLot(key rxid, string rxmsg) {

   integer rxliPos;
   string  rxtmpStr = "";
   while (~llListFindList(sayCache, (list)rxid))
   {
       rxliPos = llListFindList(sayCache, [rxid]);
       rxtmpStr = (rxtmpStr="") + rxtmpStr + llList2String(sayCache, rxliPos + 1);
       sayCache = llDeleteSubList(sayCache, rxliPos, rxliPos + 1);
   }
   rxmsg = rxtmpStr + rxmsg;
   rxmsg = llBase64ToString(llXorBase64StringsCorrect(rxmsg, llStringToBase64(password)));
   return rxmsg;

}


integer rxTxtLotBusy = FALSE; //Perry Mizin: added Busy Mode, this could fail or prevent fail string rxTxtLot(key rxid, string rxmsg) {

   if (rxTxtLotBusy == FALSE)
   {
       rxTxtLotBusy = TRUE;
       integer rxliPos;
       string  rxtmpStr = "";
       if(~llListFindList(sayCache, (list)rxid))
       {
           @rxin;
           rxliPos = llListFindList(sayCache, [rxid]);
           rxtmpStr = (rxtmpStr="") + rxtmpStr + llList2String(sayCache, rxliPos + 1);
           sayCache = llDeleteSubList(sayCache, rxliPos, rxliPos + 1);
           if(~llListFindList(sayCache, (list)rxid))
           {
                jump rxin;
           }
       }
       rxmsg = rxtmpStr + rxmsg;
       rxmsg = llBase64ToString(llXorBase64StringsCorrect(rxmsg, llStringToBase64(password)));
       rxTxtLotBusy = FALSE;
       return rxmsg;
   }
   else
   {
       //Perry Mizin: llSaySomething?
       return "";        
   }

} </lsl>


string rxTxtLotPrv() = string receiveTextBatchPrivate() <lsl> string rxTxtLotPrv(key prxid, string prxmsg) {

   integer prxliPos;
   string  prxtmpStr = "";
   while (~llListFindList(sayCachePrivate, (list)prxid))
   {
       prxliPos = llListFindList(sayCachePrivate, [prxid]);
       prxtmpStr = (prxtmpStr="") + prxtmpStr + llList2String(sayCachePrivate, prxliPos + 1);
       sayCachePrivate = llDeleteSubList(sayCachePrivate, prxliPos, prxliPos + 1);
   }
   prxmsg = prxtmpStr + prxmsg;
   prxmsg = llBase64ToString(llXorBase64StringsCorrect(prxmsg, llStringToBase64(password)));
   return prxmsg;

} </lsl>