/* I made this to do the entire mud at once, but left the command open to be modified to do a targeted room, or range of rooms, etc, depending on what purpose you want to put this to. I didn't have one so can't really anticipate any you might put it to. You will need to declare and create an output folder in mud.h or the file you put this in. Example: #define WEB_ROOMS "../../public_html/rooms/" Then just install the do_webroom, and it should be all set to go. This command if you hadnt figured it out, essentially outputs your entire mud into webpages, so that you can take a tour of your mud online. Why you'd want to, I have no idea. Perhaps to make sure it looks right? or maybe to help map making? Don't ask me. If complete is false it will only print rooms. If complete is true, it will show all mobs, players, and items in the room at the time of printing. The results are kinda fun to play with for a bit, but utterly useless unless you find one of your own. If you find a usage for this, please email and let me know. Aurora@LostProphecy.com 1 usage: add a call to room_to_html(pRoomIndex, TRUE); just before the return in: obj_from_room, obj_to_room, char_from_room, and char_to_room. This makes the rooms webpage update to show real time movement of players and items. Freaky :) */ void room_to_html args( ( ROOM_INDEX_DATA *room, bool complete)); void do_webroom( CHAR_DATA *ch, char *argument ) { ROOM_INDEX_DATA *room; int hash; bool complete=FALSE; if (!str_cmp(argument, "complete")) complete = TRUE; for ( hash = 0; hash < MAX_KEY_HASH; hash++ ) for (room = room_index_hash[hash] ; room ; room = room->next) room_to_html(room, complete); return; } void room_to_html( ROOM_INDEX_DATA *room, bool complete) { FILE *fp = NULL; char filename[256]; char buf[MAX_INPUT_LENGTH*10]; EXIT_DATA *pexit; bool found=FALSE; if (!room) return; sprintf( filename, "%s%d.html", WEB_ROOMS, room->vnum ); fclose( fpReserve ); if ( ( fp = fopen( filename, "w" ) ) != NULL ) { sprintf(buf, "%s\n\r", room->name); fprintf( fp, buf); fprintf( fp, "
\n\r"		);
     fprintf( fp, "
\n" ); sprintf(buf, "

%s

\n", room->name); fprintf( fp, buf ); sprintf(buf, "%s\n", room->description); fprintf( fp, buf ); fprintf( fp, "
Exits:" ); for ( pexit = room->first_exit; pexit; pexit = pexit->next ) { if ( pexit->to_room ) /* Set any controls you want here, ie: not closed doors, etc */ { found = TRUE; sprintf(buf, " %s", pexit->to_room->vnum, dir_name[pexit->vdir]); fprintf( fp, buf ); } } if (!found) fprintf( fp, " None.\n

"); else fprintf( fp, "\n

"); if (complete) { OBJ_DATA *obj, *obj_next=NULL; CHAR_DATA *rch; for ( obj = room->first_content; obj; obj = obj_next ) { sprintf(buf, "%s%s
", "", obj->description); fprintf( fp, buf ); } for ( rch = room->first_person; rch; rch = rch->next_in_room ) { if (IS_NPC(rch)) sprintf(buf, "%s
", rch->long_descr); else sprintf(buf, "%s
", rch->name); fprintf( fp, buf ); } } fprintf( fp, "\n" ); fclose( fp ); fpReserve = fopen( NULL_FILE, "r" ); } else bug( "Error Opening room to html index stream!", 0 ); return; }