Info and installation instructions for the "osearch" wizcommand --------------------------------------------------------------- What it Does: In a nutshell: parameter-based searches of the object table. There's a nifty helpfile included (osearch.hlp). Read it. The Files: osearch.txt Info and installation.. you're reading it. osearch.hlp Helpfile supplement for the command. osearch.c Implementation file. The Disclaimer: I wrote osearch.c a long time ago, back when C was still pretty new stuff to me. If the suckiness of my code causes blindness or a sudden inability to sustain an erection, remember: 1) you didn't pay money for it, and 2) you installed it, not me. What I Want: If you like the command, great. Leaving my name intact on the file would be nice. Mentioning me in your credits would be swell, too. If you don't like the command, sorry. See 'The Disclaimer'. Bug reports are welcome; send them to 'blangenf@cse.unl.edu'. Newbie-proof(?) Installation: I wrote these instructions while installing osearch on a fresh copy of CircleMUD bpl 14. They should be fairly complete. If you can't get it working after following these instructions, chances are really good that you shouldn't even attempt to run a mud (or operate heavy machinery). 1. Copy osearch.c to your src directory. 2. Make the following changes to the following files: "Makefile" ---------- - Add "osearch.o" and "osearch.c" to OBJFILES and CXREF_FILES, respectively. - Add to the bottom of the file: osearch.o: osearch.c conf.h sysdep.h structs.h utils.h comm.h interpreter.h \ handler.h db.h $(CC) -c $(CFLAGS) osearch.c "structs.h" ----------- - Add after the last #define APPLY_XXX: #define TOP_APPLY_NUM x /* x must be last apply + 1 */ - Add to struct obj_flag_data: long lApplyBits; /* Applies bitvector */ int iApplyMods[TOP_APPLY_NUM]; /* Magnitude of applies */ - Add to struct descriptor_data: char sHeader[MAX_STRING_LENGTH]; /* Optional header for paging */ "interpreter.c" --------------- - Add "ACMD( oSearch );" to the ACMD declarations. - Add to cmd_info[]: { "osearch" , POS_DEAD , oSearch , LVL_GOD }, "modify.c" ---------- - Change PAGE_LENGTH to one less than its current value (21, probably). - Change the declaration and prototype of page_string( ) to: void page_string( DESC_DATA *d, char *str, int keep_internal, char *sHeader ) - Add before the CREATE macro: if( strlen( sHeader ) < 1 ) d->sHeader[0] = '\0'; else strcpy( d->sHeader, sHeader ); - Add before the comment "If we're displaying the last page, just send..": send_to_char( d->sHeader, d->character ); "comm.h" -------- - Change the declaration of page_string( ) to: void page_string( DESC_DATA *d, char *str, int keep_internal, char *sHeader ) "db.c" ------ - In parse_object( ), after the code reads: strcat(buf2, ", after numeric constants\n" "...expecting 'E', 'A', '$', or next object number"); j = 0; add the following: obj_proto[i].obj_flags.lApplyBits = 0; for( j = 0; j < TOP_APPLY_NUM; j++ ) obj_proto[i].obj_flags.iApplyMods[j] = 0; j = 0; - Also in parse_object( ), after the code reads: obj_proto[i].affected[j].location = t[0]; obj_proto[i].affected[j].modifier = t[1]; add the following: SET_BIT( obj_proto[i].obj_flags.lApplyBits, ( 1 << t[0] ) ); obj_proto[i].obj_flags.iApplyMods[(t[0])] = t[1]; all files --------- - Add a fourth argument, "", to all page_string( ) calls outside osearch.c. 4. Compile. 5. Copy'n'paste the contents of osearch.hlp into your favorite helpfile. I recommend /lib/text/help/wizhelp.hlp. 6. Reboot your mud. The End: Thanks for using my code; I hope you get some use out of it. Brian Langenfeld (Cipher) September 20th, 1998