home *** CD-ROM | disk | FTP | other *** search
- Dale Cooper #1 @10118
- Mon Jan 09 22:20:58 1995
- 0R 34 01/11 01:55 WWIVNET 4051->8421
- 0R 34 01/10 18:00 WWIVNet 4001->4051
- 0R 34 01/09 15:32 WWIVnet 4000->4001
- 0R 34 01/10 07:01 WWIVnet ->4000
- 0R 34 01/10 02:12 WWIVnet 4001->4000
- 0R 34 01/09 08:12 WWIVnet 10100->4001
- 0R 34 01/09 22:17 WWIVnet 10118->10100
- 0R 34 01/09 22:22 WWiVnet ->10118
- ┌────────────────────────────────────────────────────────────────────────────┐
- │ Mod Name: Dream06C.mod Date: January 09, 1995 │
- │ Difficulty: ██████▒▒▒▒▒ Mod Authors: Unca Scrooge │
- │ WWIV Version: 4.23 Dale Cooper │
- │ │
- │ Files Affected: VARDEC.H, BBS.C, LILO.C, MSGBASE.C, MSGBASE1.C, FCNS.H, │
- │ VARS.H BBSUTL.C MULTINST.C │
- │ Description: Edit Main, Read, and Xfer prompts from inside BBS. │
- │ Also uses "MCI's".. example included. │
- └────────────────────────────────────────────────────────────────────────────┘
-
- Rev B : Upgraded for 4.23, added a few more MCI's (Confs, Msg Title,
- Timebank...) Example is UUE'd at the bottom... those are
- the prompts I use..
-
- Rev C : Well Unca left me with this bug that made people's systems
- lock up. Fixed it so that //PE won't lock your board. In other
- words the mod will work now! :)
-
- Long Desc : Lets SysOps edit the Main, Read, and Xfer prompts from within
- the BBS. No need to edit the source (after the mod's installed
- ... duh) It uses "MCI commands" (From my C64 days...) example:
- my main prompt is edited like this (No ^P's added because I use
- extended colors : (Well, it looked like this in 4.22, my 4.23
- prompts look different <g> and they're UUE'd at the bottom)
-
- ────═══* [@s] [@S] *═══──── :
-
- which comes out like this :
-
- ────═══* [1] [Notes From the Management ] *═══──── :
-
- ( I added the spaces in //Boardedit.... your's won't have 'em unless ya put
- 'em there) I like it!
-
- Anyhoo... here are the MCI commands you can edit into it...
-
- @C - SubConf Name @B - DirConf Name
- @c - SubConf Designator @b - DirConf Designator
- @S - SubBoard Name @u - Time Used (Minutes)
- @s - SubBoard Number @l - Time Left (Minutes)
- @D - Directory Name @n - User's Name and Number
- @d - Directory Number @r - Goto Next Like (CR/LF)
- @z - Current Baud Rate @x - ANSI Escape Character
- @G - Beep @g - User's Gold
- @A - User's SL @M - Current Message Number
- @a - User's DSL @m - Number of Messages in Sub
- @f - Upload/Download Ratio @p - Post/Call Ratio
- @T - Current Message Title @t - User's BankTime
-
- NOTE!!!!! : THE FIRST THING YOU ***MUST*** DO BEFORE EDITING YOUR PROMPTS
- IS... LOGON, HIT //PE THEN R (//PE TO GET YOU TO THE PROMPT
- EDITOR, R TO RESET (CREATE) PROMPTS.DAT)
- Also you can only have up to 200 symbols be it letters/numebers/
- etc.. and keep in mind a color code counts.
- Da Mod :
-
-
- Disclaimer : #define Disclaimer Here
-
- ┌─────────────────────────┐
- │ = Existing Code │
- │ + Add This Code │
- │ - Delete This Code │
- │ % Change This Code │
- └─────────────────────────┘
-
-
- STEP 1 : Backup yer source! This is kinda long!!
-
- STEP 2 :
-
- /*===========================================================================*/
-
- /* LOAD BBSUTL.C */
-
- /* BlockRead this whole chunk of code at the end of the file... */
-
- /* START BLOCK READ */
-
- void reset_promptfile(void)
- {
- FILE *fptr;
- int i;
- char s[81];
-
- sprintf(s,"%sPROMPTS.DAT",syscfg.datadir);
- npr("9Reset 2PROMPTS.DAT 1? 5");
- if(yn()) {
- nl();
- pl("9Resetting 2PROMPTS.DAT");
- fptr=fsh_open(s,"wb");
- prompts.main[0]=0;
- prompts.xfer[0]=0;
- prompts.msg[0]=0;
- fsh_write(&prompts,sizeof(prompts),1,fptr);
- fsh_close(fptr);
- nl();
- pl("9Done1.");0
- }
- }
-
- void write_prompts(void)
- {
- FILE *f;
- char s[81];
-
- sprintf(s,"%sPROMPTS.DAT",syscfg.datadir);
- f=fsh_open(s,"rb+");
- if (f==NULL) {
- npr("6■ 9Missing 2%s1!",s);0
- return;
- }
- fsh_seek(f, 1, 0);
- fsh_write(&prompts, sizeof(prompts),1, f);
- fsh_close(f);
- }
-
- void load_prompts(void)
- {
- FILE *f;
- char s[81];
-
- sprintf(s,"%sPROMPTS.DAT",syscfg.datadir);
- f=fsh_open(s,"rb");
- if (f==NULL) {
- npr("6■ 9Missing 2%s1!\r\n",s);0
- return;
- }
- fsh_seek(f, 1, 0);
- fsh_read(&prompts, sizeof(prompts),1, f);
- fsh_close(f);
- }
-
-
- void real_tl(int which)
- {
- char tl1[81],tl2[81],tl3[81];
- int it1,it2;
-
- it2=(((int)(timer()-timeon)+30)/60.0);
- itoa(it2,tl2,10);
- it1=(int)((nsl()+30)/60.0);
- itoa(it1,tl1,10);
- if (which==0)
- sprintf(tl3,"%s",tl2);
- if (which==1)
- sprintf(tl3,"%s",tl1);
- outstr(tl3);
- }
-
-
- void readprompt(char *string)
- {
- int i;
- char s[81];
-
- for (i=0;i<strlen(string);i++) {
- if (string[i]!='@')
- outchr(string[i]);
- else {
- i++;
- switch (string[i]) {
- case 'A': /* user's SL */
- itoa(thisuser.sl,s,10);
- outstr(s);
- break;
- case 'a': /* user's DSL */
- itoa(thisuser.dsl,s,10);
- outstr(s);
- break;
- case 'B': /* DIRconf name */
- outstr(dirconfs[uconfdir[curconfdir].confnum].name);
- break;
- case 'b': /* DIRconf designator */
- sprintf(s,"%c",dirconfs[uconfdir[curconfdir].confnum].designator);
- outstr(s);
- break;
- case 'C': /* SUBconf name */
- outstr(subconfs[uconfsub[curconfsub].confnum].name);
- break;
- case 'c': /* SUBconf designator */
- sprintf(s,"%c",subconfs[uconfsub[curconfsub].confnum].designator);
- outstr(s);
- break;
- case 'D': /* directory name */
- outstr(directories[udir[curdir].subnum].name);
- break;
- case 'd': /* directory number */
- outstr(udir[curdir].keys);
- break;
- case 'f': /* upload to download ratio */
- sprintf(s,"%-6.3f",ratio());
- outstr(s);
- break;
- case 'G': /* beep! control-G */
- outchr(7);
- break;
- case 'g': /* user's gold */
- itoa(thisuser.gold,s,10);
- outstr(s);
- break;
- case 'l': /* time left (minutes) */
- real_tl(1);
- break;
- case 'M': /* current message number */
- itoa(messagenumber,s,10);
- outstr(s);
- break;
- case 'm': /* number of messages in sub */
- itoa(nummsgs,s,10);
- outstr(s);
- break;
- case 'n': /* user's name and number */
- outstr(nam(&thisuser,usernum));
- break;
- case 'p': /* post to call ratio */
- sprintf(s,"%-6.3f",
- (double)thisuser.msgpost/(double)thisuser.logons);
- outstr(s);
- break;
- case 'r': /* go to next line */
- nl();
- break;
- case 'S': /* subboard name */
- outstr(subboards[usub[cursub].subnum].name);
- break;
- case 's': /* subboard number */
- outstr(usub[cursub].keys);
- break;
- case 't': /* user's timebank */
- sprintf(s,"%d",thisuser.banktime);
- outstr(s);
- break;
- case 'T': /* Current Message's Title */
- outstr(irt);
- break;
- case 'u': /* time used (minutes) */
- real_tl(0);
- break;
- case 'x': /* ANSI escape character */
- if (okansi())
- outchr(27);
- break;
- case 'z': /* current baud rate */
- outstr(curspeed);
- break;
- default : /* anything else */
- outchr('@');
- break;
- }
- }
- }
- }
-
- void editgiven(int which)
- {
- char s[101],s1[101];
-
- if ((which<1) || (which>3))
- return;
- nl();
- if (which==1) strcpy(s,"main");
- if (which==2) strcpy(s,"read");
- if (which==3) strcpy(s,"xfer");
- sprintf(s1,"9Enter new 2%s 9prompt 1[2Enter1]=9abort 1:5 ",s);
- pl(s1);
- npr("1■ ");
- inli(s,"",90,1);
- if (s[0]) {
- if (which==1) strcpy(prompts.main,s);
- if (which==2) strcpy(prompts.msg,s);
- if (which==3) strcpy(prompts.xfer,s);
- }
- write_prompts();
- }
-
- void editprompts()
- {
- char s[81], ch;
- int done;
-
- done=0;
- do {
- nl();
- sprintf(s,"217) 9Main Prompt 1: 2%s",prompts.main);
- pl(s);
- sprintf(s,"227) 9Msg Prompt 1: 2%s",prompts.msg);
- pl(s);
- sprintf(s,"237) 9Xfer Prompt 1: 2%s",prompts.xfer);
- pl(s);
- sprintf(s,"2R7) 9Reset 2PROMPTS.DAT");
- pl(s);
- sprintf(s,"2?7) 9Show 2PROMPTS.MSG");
- pl(s);
- sprintf(s,"2Q7) 9Quit");
- pl(s);
- nl();
- npr("9Which 1: 5");
- ch=onek("Q123R?");
- switch (ch) {
- case '1': editgiven(1); break;
- case '2': editgiven(2); break;
- case '3': editgiven(3); break;
- case 'R': reset_promptfile(); break;
- case '?': printfile("PROMPTS"); break;
- case 'Q': done=1; break;
- }
- } while ((done==0) && (hangup==0));
- }
-
- /* END BLOCK READ */
-
- /* SAVE BBSUTL.C */
-
- /*===========================================================================*/
-
- STEP 3:
-
- /* OPEN BBS.C and make the following changes... */
-
-
- =void mainmenu(void)
- ={
- = char *s, s1[81], s2[81], ch;
- % int i, ac; // delete useconf
- = long l;
- =
- = s2[0]=0;
- = if (usub[cursub].subnum==-1) {
- = cursub=0;
- = if (usub[cursub].subnum==-1) {
- = strcpy(s2,get_string(16));
- = }
- = }
- =
- = write_inst(INST_LOC_MAIN,usub[cursub].subnum,INST_FLAGS_ONLINE);
- =
- + load_prompts();
- = tleft(1);
- = if ((sysstatus_expert & thisuser.sysstatus)==0)
- = printmenu(0);
-
- = nl();
- = nl();
- = tleft(1);
-
- - useconf=((subconfnum>1) && okconf(&thisuser));
-
- =#ifdef OPT_EXTRA_COLOR
- = npr("1T 0- 1%s\r\n",ctim(nsl()));0
- - sprintf(s1,"7[1Conf %c7] [1%s7]",subconfs[uconfsub[curconfsub].confnum].designator,
- - stripcolors(subconfs[uconfsub[curconfsub].confnum].name));
- - if (s2[0]==0)
- - sprintf(s2,"7[1%s%s7] [1%s7]0 : 2",0
- - useconf?get_string(1398):"",
- - usub[cursub].keys,
- - stripcolors(subboards[usub[cursub].subnum].name));
- =#else
- = npr("T - %s\r\n",ctim(nsl()));
- - sprintf(s1,"[Conf %c] [%s]",subconfs[uconfsub[curconfsub].confnum].designator,
- - stripcolors(subconfs[uconfsub[curconfsub].confnum].name));
- - if (s2[0]==0)
- - sprintf(s2,"[%s%s] [%s] :",
- - useconf?get_string(1398):"",
- - usub[cursub].keys,
- - stripcolors(subboards[usub[cursub].subnum].name));
- =#endif
- =
- - if (useconf) {
- - ansic(2);
- - pl(s1);
- - }
- - prt(2,s2);
- + readprompt(prompts.main);
- = helpl=1;
- = s=mmkey(0);
- = helpl=0;
-
-
- /* On down, search for and add this */
-
- = if ((strcmp(s,"BOARDEDIT")==0) || (strcmp(s,"BE")==0)) {
- = write_inst(INST_LOC_BOARDEDIT,0,INST_FLAGS_ONLINE);
- = sysoplog(get_stringx(1,2));
- = boardedit();
- = }
- + if ((strcmp(s,"PROMPTEDIT")==0) || (strcmp(s,"PE")==0)) {
- + write_inst(INST_LOC_PROMPTEDIT,0,INST_FLAGS_ONLINE);
- + sysoplog("Entered Prompt Editor");
- + editprompts();
- + }
- = if ((strcmp(s,"CHAINEDIT")==0) || (strcmp(s,"CE")==0)) {
-
-
- /*===========================================================================*/
-
- STEP 4 :
-
- /* Still in BBS.C */
- /* Goto void dlmainmenu (... and make the following changes... */
-
-
- =void dlmainmenu(void)
- ={
- = char *s, s1[81],s2[81],ch;
- % int i,i1,i2,abort,next,ac; // delete useconf
- = messagerec m;
-
- = s2[0]=0;
- = if (udir[curdir].subnum==-1) {
- = curdir=0;
- = if (udir[curdir].subnum==-1) {
- = strcpy(s2,get_string(32));
- = }
- = }
- =
- = write_inst(INST_LOC_XFER,udir[curdir].subnum,INST_FLAGS_ONLINE);
- =
-
- + load_prompts();
- = tleft(1);
- = if ((sysstatus_expert & thisuser.sysstatus)==0)
- = printmenu(3);
- =
- = nl();
- = nl();
- = tleft(1);
- =
- - useconf=((dirconfnum>1) && okconf(&thisuser));
- =
- =#ifdef OPT_EXTRA_COLOR
- = npr("1T 0- 1%s\r\n",ctim(nsl()));0
- - sprintf(s1,"7(1Conf %c7)0-7(1%s7)",dirconfs[uconfdir[curconfdir].confnum].designator,
- - stripcolors(dirconfs[uconfdir[curconfdir].confnum].name));
- - if (s2[0]==0)
- - sprintf(s2,"7(1%s%s7)0-7(1%s7)0 : 2",0
- - useconf?get_string(1399):"",
- - udir[curdir].keys,
- - stripcolors(directories[udir[curdir].subnum].name));
- =#else
- = npr("T - %s\r\n",ctim(nsl()));
- - sprintf(s1,"(Conf %c)-(%s)",dirconfs[uconfdir[curconfdir].confnum].designator,
- - stripcolors(dirconfs[uconfdir[curconfdir].confnum].name));
- - if (s2[0]==0)
- - sprintf(s2,"(%s%s)-(%s) :",
- - useconf?get_string(1399):"",
- - udir[curdir].keys,
- - stripcolors(directories[udir[curdir].subnum].name));
- =#endif
- - if (useconf) {
- - ansic(2);
- - pl(s1);
- - }
- - prt(2,s2);
- + readprompt(prompts.xfer);
- = helpl=2;
- = s=mmkey(1);
-
-
- /* SAVE BBS.C */
-
- /*===========================================================================*/
-
- STEP 5 :
-
- /* LOAD MSGBASE.C */
- /* Down to void read_message, add the indicated line. */
-
- =void read_message(int n, int *next, int *val)
- ={
- = char s[100];
- = postrec p;
- = int abort,a,nn;
- = slrec ss;
- =
- = nl();
- + messagenumber=n;
- = abort=0;
- = *next=0;
- = outchr(12);
- =#ifdef OPT_EXTRA_COLOR
-
- /* SAVE MSGBASE.C /*
-
- /*===========================================================================*/
-
- Step 6 :
-
- /* LOAD MSGBASE1.C */
- /* in void scan(int msgnum, int optype, int *nextsub) make the following
- changes */
-
-
-
- = write_inst(INST_LOC_SUBS, usub[cursub].subnum, INST_FLAGS_ONLINE);
- = switch(optype) {
- = case 0: /* Read Prompt */
- -#ifdef OPT_EXTRA_COLOR
- - sprintf(s,"1%s0:7(11-%u,^%u7)1,? 0: 2",get_string(678),0
- - nummsgs,msgnum);
- -#else
- - sprintf(s,"%s:(1-%u,^%u),? :",get_string(678),
- - nummsgs,msgnum);
- -#endif
- =
- = nl();
- + nmsg=msgnum;
- = if (express) {
- = s[0]=0;
- = nl();
- = nl();
- = } else {
- -#ifdef OPT_EXTRA_COLOR
- - sprintf(s1,"7[1%s7] [1%s7]",usub[cursub].keys,0
- - subboards[usub[cursub].subnum].name);
- -#else
- - sprintf(s1,"[%s] [%s]",usub[cursub].keys,
- - subboards[usub[cursub].subnum].name);
- -#endif
- =
- = ansic(2);
- - pl(s1);
- - prt(2,s);
- =
- + readprompt(prompts.msg);
- = helpl=16;
- = input(s,3);
- = resynch(cursub, &msgnum, NULL);
-
- /* SAVE MSGBASE1.C */
-
- /*===========================================================================*/
-
- STEP 7 :
-
- /* LOAD LILO.C */
- /* In void logon(... make the following changes.. */
-
-
- = if (ss!=NULL)
- = farfree(ss);
- % if (live_user) { // added {
- = read_automessage();
- + load_prompts();
- + }
- = timeon=timer();
- = if (live_user)
- = topscreen();
-
- /* SAVE LILO.C */
-
- /*===========================================================================*/
- STEP 8 :
-
- /* LOAD MULTINST.C */
-
- /* in void make_inst_str(short wi, unsigned char *ss) make the following
- changes */
-
- = case INST_LOC_WFC:
- = sprintf(s1,"%-25.25s",get_string(1402));
- = break;
- + case INST_LOC_PROMPTEDIT:
- + sprintf(s1,"%-25.25s","Prompt Editor");
- + break;
- = default:
- = sprintf(s1,"%-25.25s",get_string(1403));
- = break;
-
- /* block read this at the end of the file */
-
- int fsh_seek(FILE *stream, long offset, int whence)
- {
-
- if (stream == NULL) {
- sysoplog("\r\n6Attempted to fseek in closed file.\r\n");0
- return(0);
- }
- return(fseek(stream, offset, whence));
- }
-
- /* SAVE MULTINST.C */
-
- /*===========================================================================*/
-
- STEP 10 :
-
- /* LOAD VARDEC.H */
-
- /* near the top, add the indicated line */
-
- =#define INST_LOC_BIXFER 44
- =#define INST_LOC_NETLIST 45
- +#define INST_LOC_PROMPTEDIT 5000
- =#define INST_LOC_WFC 65535
-
- /* now search for and edit the following */
-
- =} arcrec;
- =
- +typedef struct {
- + char main[200], /* prompts */
- + xfer[200],
- + msg[200];
- } promptrec;
- =
- =
- =/* STATIC SYSTEM INFORMATION */
- =typedef struct {
-
-
- /* SAVE VARDEC.H */
-
- /*===========================================================================*/
-
- STEP 11:
-
- /* LOAD VARS.H */
- /*find the __EXTRN__ int delcrations and add the two below ints */
-
- messagenumber,nmsg; //Add these to the end of the list
-
- /* search for the following and add the indicated line */
-
- =__EXTRN__ userrec thisuser;
- +__EXTRN__ promptrec prompts; /** ADD **/
- =__EXTRN__ configrec syscfg;
- =__EXTRN__ configoverrec syscfgovr;
- =__EXTRN__ statusrec status;
-
- /*SAVE VARS.H */
-
- /*===========================================================================*/
-
- STEP 12:
-
- /* BlockRead the following to a file called PROMPTS.MSG in you G-Files dir */
-
- 2Dream06c.Mod 9Prompt Commands0
-
- 1@9C 1- 9SubConf Name 1@9B 1- 9DirConf Name0
- 1@9c 1- 9SubConf Designator 1@9b 1- 9DirConf Designator0
- 1@9S 1- 9SubBoard Name 1@9u 1- 9Time Used 1(9Minutes1)0
- 1@9s 1- 9SubBoard Number 1@9l 1- 9Time Left 1(9Minutes1)0
- 1@9D 1- 9Directory Name 1@9n 1- 9User1'9s Name and Number0
- 1@9d 1- 9Directory Number 1@9r 1- 9Goto Next Like0
- 1@9z 1- 9Current Baud Rate 1@9x 1- 9ANSI Escape Character0
- 1@9G 1- 9Beep 1@9g 1- 9User1'9s Gold0
- 1@9A 1- 9User1'9s SL 1@9M 1- 9Current Message Number0
- 1@9a 1- 9User1'9s DSL 1@9m 1- 9Number of Messages in Sub0
- 1@9f 1- 9Upload1/9Download Ratio 1@9p 1- 9Post1/9Call Ratio0
- 1@9T 1- 9Current Message Title 1@9t 1- 9User1'9s BankTime0
-
- /*===========================================================================*/
-
- STEP 13 : Make FCNS and then...
-
- This part is NO fun!!!!! Recompile. Ya gotta recompile the
- WHOLE BBS since VARS.H and VARDEC.H was edited
-
-
- AND REMEMBER>>>> FIRST TIME USING IT... | THEN R !!!!!
- OR, uudecode this chunk and place it in your DATA dir.
- These are the prompts I currently use... block read them
- to disk and UUDecode 'em.
-
- section 1 of uuencode 5.15 of file prompts.dat by R.E.M.
-
- begin 644 prompts.dat
- M``,W6P,Q0&,#-UT@6P,Q0$,#-UT#,$!R`S=;`S%`<P,W72!;`S%`4P,W72`#
- M,3H@`S<`````````````````````````````````````````````````````
- M`````````````````S=;`S%`8@,W72!;`S%`0@,W70,P0'(#-UL#,4!D`S==
- M(%L#,4!$`S==(`,Q.B`#-0``````````````````````````````````````
- M`````````````````````````````S=;`S%`8@,W72!;`S%`0@,W74!R`S=;
- M`S%`9`,W72!;`S%`1`,W72`#.3H@`S$``S==(`,Q.B`#-0!=(`,Q.B`#-0`#
- M,4!M`S==(`,Q.B`#-0``````````````````````````````````````````
- M````````````````````````````````````````````````````````````
- M```````````````````````````````````````````````````````#-UL#
- M,4!S`S==(%L#,4!4`S==0'(#-UL#,4!3`S==(`,W6P,Q0$T#-R\#,4!M`S==
- M(`,Y.B`#-P`Q````````````````````````````````````````````````
- M````````````````````````````````````````````````````````````
- M````````````````````````````````````````````````````````````
- 2``````````````````````T*
- `
- end
- sum -r/size 44351/860 section (from "begin" to "end")
- sum -r/size 61994/603 entire input file
-
-
- Enjoy!
-
- Mod versions A-B by Unca Scrooge
- Mod version C by Dale Cooper 1.10118WWIVnet 1.6272ICE/TERRAnets