home *** CD-ROM | disk | FTP | other *** search
/ The Devil's Doorknob BBS Capture (1996-2003) / devilsdoorknobbbscapture1996-2003.iso / Dloads / WWIVMODS / MODSUNKN.ZIP / ADDTOF1.MOD < prev    next >
Text File  |  1992-12-01  |  7KB  |  213 lines

  1. /***************************************************************************/
  2.                         Addition's to F1 User Edit
  3.  
  4.                           By: Caramon Majere
  5.              With Post-Call Ratio additions by: Lord Samos
  6.  
  7.  
  8. Caramon Majere:                                        Lord Samos:
  9.  3@8412 The Alliance                                    1@8412 The Alliance
  10. /***************************************************************************/
  11.  
  12. This mod is fairly simple to add into your source.  It will take no more
  13. than 15 minutes to put in.  If you get any errors (Which you shouldn't,
  14. but it can always happen), just e-mail one of us at the above net nodes.
  15.  
  16. Legend:
  17.  * - Search for this.
  18.  + - Add this.
  19.  - - Delete this line.
  20.  ! - Change this line.
  21.  
  22. *void val_cur_user()
  23.  /* val_cur_user allows the sysop at the keyboard to validate the current user,
  24.     chaning sl, dsl, ar, dar, sysop sub, exemptions, restrictions, and user
  25.     note
  26.   */
  27.  {
  28. !  char sl[4],dsl[4],exempt[4],sysopsub[4],ar[17],dar[17],restrict[17],rst[17],
  29.         tl[50],dk[34],uk[34],ndl[33],nul[33],gold[34],pr[5],cr[5];
  30.    int cp,i,done,rc,wx,wy;
  31.  
  32.    pr_wait(1);
  33.    thisuser.sl=realsl;
  34.    savescreen(&screensave);
  35. !  curatr=14;
  36.    wx=15;
  37.    wy=4;
  38.    ansic(5);
  39. !  makewindow(wx,wy,50,11);
  40.    itoa((int)thisuser.sl,sl,10);
  41.    itoa((int)thisuser.dsl,dsl,10);
  42.    itoa((int)thisuser.exempt,exempt,10);
  43.    itoa((int)thisuser.sysopsub,sysopsub,10);
  44. +  itoa((int)thisuser.dk,dk,10);
  45. +  itoa((int)thisuser.uk,uk,10);
  46. +  itoa((int)thisuser.downloaded,ndl,10);
  47. +  itoa((int)thisuser.uploaded,nul,10);
  48. +  itoa((int)thisuser.gold,gold,10);
  49. +  itoa((int)thisuser.msgpost,pr,10);
  50. +  itoa((int)thisuser.logons,cr,10);
  51.    strcpy(rst,restrict_string);
  52.    for (i=0; i<=15; i++) {
  53.      if (thisuser.ar & (1 << i))
  54.        ar[i]='A'+i;
  55.      else
  56.        ar[i]=32;
  57.      if (thisuser.dar & (1 << i))
  58.        dar[i]='A'+i;
  59.      else
  60.        dar[i]=32;
  61.      if (thisuser.restrict & (1 << i))
  62.        restrict[i]=rst[i];
  63.      else
  64.        restrict[i]=32;
  65.    }
  66.    dar[16]=0;
  67.    ar[16]=0;
  68.    restrict[16]=0;
  69.    cp=0;
  70.    done=0;
  71.  
  72.    movecsr(wx+2,wy+1); sprintf(tl,"SL  : %s",sl); outs(tl);
  73.    movecsr(wx+26,wy+1); sprintf(tl,"AR  : %s",ar); outs(tl);
  74.    movecsr(wx+2,wy+2); sprintf(tl,"DSL : %s",dsl); outs(tl);
  75.    movecsr(wx+26,wy+2); sprintf(tl,"DAR : %s",dar); outs(tl);
  76.    movecsr(wx+2,wy+3); sprintf(tl,"EXMT: %s",exempt); outs(tl);
  77.    movecsr(wx+26,wy+3); sprintf(tl,"RSTR: %s",restrict); outs(tl);
  78.    movecsr(wx+2,wy+4); sprintf(tl,"SYSOPSUB: %s",sysopsub); outs(tl);
  79. +  movecsr(wx+26,wy+4); sprintf(tl,"GOLD: %s",gold); outs(tl);
  80.    movecsr(wx+2,wy+5); sprintf(tl,"NOTE: %s",thisuser.note); outs(tl);
  81. +  movecsr(wx+2,wy+6); sprintf(tl,"D/L KB : %s",dk); outs(tl);
  82. +  movecsr(wx+26,wy+6); sprintf(tl,"U/L KB : %s",uk); outs(tl);
  83. +  movecsr(wx+2,wy+7); sprintf(tl,"# OF D/L'S : %s",ndl); outs(tl);
  84. +  movecsr(wx+26,wy+7); sprintf(tl,"# OF U/L'S : %s",nul); outs(tl);
  85. +  movecsr(wx+2,wy+8); sprintf(tl,"# OF POSTS MADE : %s",pr); outs(tl);
  86. +  movecsr(wx+26,wy+8); sprintf(tl,"# OF CALLS MADE : %s",cr); outs(tl);
  87. +  movecsr(wx+2,wy+9); sprintf(tl,"CURRENT P/C RATIO : %-6.3f",mratio()); 
  88. outs(tl);
  89.    while (done==0) {
  90.      switch(cp) {
  91.        case 0:
  92.          movecsr(wx+8,wy+1);
  93.          editline(sl,3,NUM_ONLY,&rc,"");
  94.          thisuser.sl=(char) atoi(sl);
  95.          itoa((int)thisuser.sl,sl,10);
  96.          sprintf(tl,"%-3s",sl); outs(tl);
  97.          break;
  98.        case 1:
  99.          movecsr(wx+32,wy+1);
  100.          editline(ar,16,SET,&rc,"ABCDEFGHIJKLMNOP");
  101.          thisuser.ar=0;
  102.          for (i=0; i<=15; i++)
  103.           if (ar[i]!=32)
  104.              thisuser.ar |= (1 << i);
  105.          break;
  106.        case 2:
  107.          movecsr(wx+8,wy+2);
  108.          editline(dsl,3,NUM_ONLY,&rc,"");
  109.          thisuser.dsl=(char) atoi(dsl);
  110.          itoa((int)thisuser.dsl,dsl,10);
  111.          sprintf(tl,"%-3s",dsl); outs(tl);
  112.          break;
  113.        case 3:
  114.          movecsr(wx+32,wy+2);
  115.          editline(dar,16,SET,&rc,"ABCDEFGHIJKLMNOP");
  116.          thisuser.dar=0;
  117.          for (i=0; i<=15; i++)
  118.            if (dar[i]!=32)
  119.              thisuser.dar |= (1 << i);
  120.          break;
  121.        case 4:
  122.          movecsr(wx+8,wy+3);
  123.          editline(exempt,3,NUM_ONLY,&rc,"");
  124.          thisuser.exempt=(char) atoi(exempt);
  125.          itoa((int)thisuser.exempt,exempt,10);
  126.          sprintf(tl,"%-3s",exempt); outs(tl);
  127.          break;
  128.        case 5:
  129.          movecsr(wx+32,wy+3);
  130.          editline(restrict,16,SET,&rc,rst);
  131.          thisuser.restrict=0;
  132.          for (i=0; i<=15; i++)
  133.            if (restrict[i]!=32)
  134.              thisuser.restrict |= (1 << i);
  135.          break;
  136.        case 6:
  137.          movecsr(wx+12,wy+4);
  138.          editline(sysopsub,3,NUM_ONLY,&rc,"");
  139.          thisuser.sysopsub=(char) atoi(sysopsub);
  140.          itoa((int)thisuser.sysopsub,sysopsub,10);
  141.          sprintf(tl,"%-3s",sysopsub); outs(tl);
  142.          break;
  143. +      case 7:
  144. +        movecsr(wx+32,wy+4);
  145. +        editline(gold,4,NUM_ONLY,&rc,"");
  146. +        thisuser.gold=(int) atoi(gold);
  147. +        itoa((int)thisuser.gold,gold,10);
  148. +        sprintf(tl,"%-3s",gold); outs(tl);
  149. +        break;
  150. !      case 8:
  151.          movecsr(wx+8,wy+5);
  152.          editline(thisuser.note,40,ALL,&rc,"");
  153.          break;
  154. +      case 9:
  155. +        movecsr(wx+11,wy+6);
  156. +        editline(dk,4,NUM_ONLY,&rc,"");
  157. +        thisuser.dk=(int) atoi(dk);
  158. +        itoa((int)thisuser.dk,dk,10);
  159. +        sprintf(tl,"%-3s",dk); outs(tl);
  160. +        break;
  161. +      case 10:
  162. +        movecsr(wx+35,wy+6);
  163. +        editline(uk,4,NUM_ONLY,&rc,"");
  164. +        thisuser.uk=(int) atoi(uk);
  165. +        itoa((int)thisuser.uk,uk,10);
  166. +        sprintf(tl,"%-3s",uk); outs(tl);
  167. +        break;
  168. +      case 11:
  169. +        movecsr(wx+15,wy+7);
  170. +        editline(ndl,3,NUM_ONLY,&rc,"");
  171. +        thisuser.downloaded=(int) atoi(ndl);
  172. +        itoa((int)thisuser.downloaded,ndl,10);
  173. +        sprintf(tl,"%-3s",ndl); outs(tl);
  174. +        break;
  175. +      case 12:
  176. +        movecsr(wx+39,wy+7);
  177. +        editline(nul,3,NUM_ONLY,&rc,"");
  178. +        thisuser.uploaded=(int) atoi(nul);
  179. +        itoa((int)thisuser.uploaded,nul,10);
  180. +        sprintf(tl,"%-3s",nul); outs(tl);
  181. +        break;
  182. +      case 13:
  183. +        movecsr(wx+20,wy+8);
  184. +        editline(pr,3,NUM_ONLY,&rc,"");
  185. +        thisuser.msgpost=(int) atoi(pr);
  186. +        itoa(thisuser.msgpost,pr,10);
  187. +        sprintf(tl,"%-3s",pr); outs(tl);
  188. +        movecsr(wx+2,wy+9); sprintf(tl,"CURRENT P/C RATIO : 
  189. %-6.3f",mratio()); outs(tl);
  190. +        break;
  191. +      case 14:
  192. +        movecsr(wx+44,wy+8);
  193. +        editline(cr,3,NUM_ONLY,&rc,"");
  194. +        thisuser.logons=(int) atoi(cr);
  195. +        itoa(thisuser.logons,cr,10);
  196. +        sprintf(tl,"%-3s",cr); outs(tl);
  197. +        movecsr(wx+2,wy+9); sprintf(tl,"CURRENT P/C RATIO : 
  198. %-6.3f",mratio()); outs(tl);
  199. +        break;
  200.      }
  201.      switch(rc) {
  202.        case DONE: done=1; break;
  203. !      case NEXT: cp=(cp+1) % 15; break;
  204. !      case PREV: cp--; if (cp==-1) cp=14;  break;
  205.      }
  206.    }
  207.    restorescreen(&screensave);
  208.    changedsl();
  209.    pr_wait(0);
  210.  }
  211.  
  212. Now just hi F9 and test it out....
  213.