home *** CD-ROM | disk | FTP | other *** search
/ Amiga ISO Collection / AmigaUtilCD2.iso / TextEditors&Viewers / Texteditors / FFRED10.LHA / fpl / eLiTeWrItE.fPl < prev    next >
Encoding:
Text File  |  1994-09-22  |  1.2 KB  |  63 lines

  1.  
  2. /* Exekvera och testa...  8-)   */
  3.  
  4. int running=0;
  5. int lastchr=-1;
  6. int lastcounter=-1;
  7.  
  8. export int EliteWrite(string out)
  9. {
  10.   if (!running) {
  11.     int counter=ReadInfo("counter");
  12.     int len;
  13.     int chr, newchr;
  14.     string newout="";
  15.     int random=counter*3;
  16.  
  17.     len=strlen(out);
  18.     if (len==1) {
  19.       if (counter==lastcounter+1) {
  20.         if (lastchr=='o' && out[0]=='o') {
  21.           Backspace(1);
  22.           running=1;
  23.           Output("00");
  24.           running=0;
  25.           return(1);
  26.         }
  27.       }
  28.       lastchr=out[0];
  29.     }
  30.     lastcounter=counter;
  31.     for (counter=0; counter<len; counter++) {
  32.       chr=out[counter];
  33.       if (random&1) {
  34.         newchr=Isupper(chr);
  35.         if (newchr<0)
  36.           newchr=Islower(chr);
  37.         if (newchr>0) {
  38.           chr=newchr;
  39.           if (random&2) {
  40.             if (chr=='s')
  41.               chr='z';
  42.             if (chr=='S')
  43.               chr='Z';
  44.           }
  45.         }
  46.       }
  47.       if ((random&2) && chr=='a')
  48.         newout=joinstr(newout, "aH");
  49.       else
  50.         newout=joinstr(newout, itoc(chr));
  51.     }
  52.     running=1;
  53.     Output(newout);
  54.     running=0;
  55.     return(1);
  56.   }
  57.   return(0);
  58. }
  59.  
  60.  
  61. Hook("Output", "EliteWrite");
  62.  
  63.