home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 2 BBS / 02-BBS.zip / bbbsr2.zip / scripts / brobo.bz < prev    next >
Text File  |  1997-06-26  |  1KB  |  50 lines

  1. #include <stdlib.bzh>
  2.  
  3. // PLAY and DOWNLOAD are handled internally.
  4.  
  5. int main(char command) {
  6.   FILE f;
  7.   char s, m=0;
  8.  
  9.   randomize();
  10.   if (pos("FUCK",command)) {
  11.     printf("Dead or alive, you're coming with me!\n");
  12.     for (f=0; f<100; f++) printf("\a");
  13.     delay(30);
  14.     bv_carrier=0;
  15.   }
  16.   if ((f=fopen("brobo.wht","rt"))!=-1) {
  17.     if (bv_brobot & 128 && !(rand() % 10)) command="FULLMOON";
  18.     while ((s=fgets(f))!="") {
  19.       if (pos(copy(s,1,1),"<>")) {
  20.         if (m) break;
  21.         if (copy(s,1,1)=="<") {
  22.           if (copy(command,1,1)=="\e" && regexp(copy(s,2,1024),copy(command,2,128))) m=1;
  23.         } else
  24.           if (copy(command,1,1)!="\e" && regexp(copy(s,2,1024),command)) m=1;
  25.       } else
  26.         if (m) m[m++]=s;
  27.     }
  28.     fclose(f);
  29.     if (m>1) {
  30.       m=m[(rand() % (m-1))+1];
  31.       while (m!="") {
  32.         if (pos("\\n",m)) {
  33.           s=copy(m,1,pos("\\n",m)-1);
  34.           m=copy(m,pos("\\n",m)+2,1024);
  35.         } else {
  36.           s=m;
  37.           m="";
  38.         }
  39.         if (pos("$F",s)) s=sprintf("%s%s%s",copy(s,1,pos("$F",s)-1),bn_nick,copy(s,pos("$F",s)+2,200));
  40.         if (copy(s,1,1)=="*" || copy(s,1,1)=="+") {
  41.           for (f=1; f<=bg_max_nodes; f++)
  42.             if (getnodestatus(f,2))
  43.               sendnode(bg_max_nodes+1,f,copy(s,2,250),1,sprintf("#%s :BRoboCop \e[1;37m",(copy(s,1,1)=="*")?"*":" "));
  44.         } else
  45.           sendnode(bg_max_nodes+1,bv_nodenumber,s,16,"BRoboCop");
  46.       }
  47.     }
  48.   }
  49. }
  50.