I wrote this up one night in about 45 minutes or so. It's not the greatest way of doing this I know, but a friend of mine asked me if I could create a small mining code that wouldn't be difficult to add, and this is just what I came up with. In the do_mining code you will have to build the pick axe object, and remove the ch->in_room checks. You don't have to contact me or anything if you use this, maybe if you could just add something into the helpfile for it or whatever you wanna do, that would be cool. I'm also putting in the junk command I added later on to get rid of the materials since I only allow for 30 materials total to be held. Also, this could easily be converted to make you actually mine the objects for the materials, I just use a point system cause it was fast and easy to do.

Josh Erickson -AKA- Azmodian - Coder for Malacious Bliss

----Merc.h-----
I did this in my char_data, you can add it into either char_data or pc_data

int gld;
int silv;
int ore;
int adamantium;
int thorium;

----Save.c-----
in fwrite_char I added this under fprintf ( fp, "Exp %ld\n", ch->exp );

    fprintf ( fp, "Gld %d\n", ch->gld );
    fprintf ( fp, "Slv %d\n", ch->silv );
    fprintf ( fp, "Adama %d\n", ch->adamantium );
    fprintf ( fp, "Thorium %d\n", ch->thorium );
    fprintf ( fp, "Ore %d\n", ch->ore );

further down in fread_char 

in case 'A' under KEY ( "Act2", ch->act2, fread_flag ( fp ) );

add--> KEY ( "Adama", ch->adamantium, fread_number ( fp ) );

in case 'G' under  KEY ( "Gold", ch->gold, fread_number ( fp ) );

add--> KEY ( "Gld", ch->gld, fread_number ( fp ) );

in case 'S' under  KEY ( "Silv", ch->silver, fread_number ( fp ) );

add--> KEY ( "Slv", ch->silv, fread_number ( fp ) );

in case 'T' above  KEY ( "Tier", ch->pcdata->tier, fread_number ( fp ) );

add--> KEY ( "Thorium", ch->thorium, fread_number ( fp ) );

Ok, now if you are running a stock version of rot/rom, or if you haven't yet added anything needed for a case 'O' yet, look for case 'N', now since I don't know what your fread_char has in it. right above case 'P':--

add-->      case 'O':
                KEY ( "Ore", ch->ore, fread_number ( fp ) );
                break;

----that should take care of save.c----

----act_info.c----

Or wherever you wanna add the mining command.

void do_mine(CHAR_DATA *ch, char *argument)
{
    char arg[MAX_INPUT_LENGTH];
    OBJ_DATA *pick;
    int mnum;

    mnum = ch->gld + ch->silv + ch->ore + ch->adamantium + ch->thorium;

    one_argument ( argument, arg );

    pick = get_eq_char ( ch, WEAR_HOLD );

    if ( arg[0] == '\0')
    {
        send_to_char ( "You can mine the Following materials: Ore Silver Gold Thorium Adamantium", ch );
        return;
    }

    if ( pick == NULL )
    {
        send_to_char ( "You are not holding anything!\n\r", ch );
        return;
    }

    if ( pick->pIndexData->vnum != 99 )
    {
       send_to_char ( "You must be holding a pick axe to mine!\n\r", ch);
       return;
    }

    if ( mnum >= 30 )
    {
       send_to_char ( "You are already carrying your limit in materials, you may not carry more than 30 pieces at a time\n\r", ch );
       return;
    }

    if ( !str_cmp (arg, "ore" ) && ch->in_room->vnum >= 9500 && ch->in_room->vnum <= 9519 )
    {
    if (number_percent () > 90 )
    {
       send_to_char ( "You begin to mine.....", ch);
       WAIT_STATE ( ch, 60 );
       send_to_char ("You have found a piece of Ore\n\r", ch);
       send_to_char ("\n\r", ch );
       send_to_char ("You are exhausted, you must wait a little bit", ch );
       ch->ore += 1;
    }
    else
    {
       send_to_char ("You begin to mine.....You found nothing", ch );
       WAIT_STATE ( ch, 10 );
       return;
     }
    }

    if ( !str_cmp (arg, "silver" ) && ch->in_room->vnum >= 9540 && ch->in_room->vnum <= 9559 )
    {
    if (number_percent () > 90 )
    {
       send_to_char ( "You begin to mine.....", ch);
       WAIT_STATE ( ch, 60 );
       send_to_char ("You have found a piece of silver\n\r", ch);
       send_to_char ("\n\r", ch );
       send_to_char ("You are exhausted, you must wait a little bit", ch );
       ch->silv += 1;
    }
    else
    {
       send_to_char ("You begin to mine.....You found nothing", ch );
       WAIT_STATE ( ch, 10 );
       return;
     }
    }

    if ( !str_cmp (arg, "gold" ) && ch->in_room->vnum >= 9520 && ch->in_room->vnum <= 9539 )
    {
    if (number_percent () > 90 )
    {
       send_to_char ( "You begin to mine.....", ch);
       WAIT_STATE ( ch, 60 );
       send_to_char ("You have found a piece of gold\n\r", ch);
       send_to_char ("\n\r", ch );
       send_to_char ("You are exhausted, you must wait a little bit", ch );
       ch->gld += 1;
    }
    else
    {
       send_to_char ("You begin to mine.....You found nothing", ch );
       WAIT_STATE ( ch, 10 );
       return;
     }
    }

    if ( !str_cmp (arg, "thorium" ) && ch->in_room->vnum >= 9560 && ch->in_room->vnum <= 9579 )
    {
    if (number_percent () > 90 )
    {
       send_to_char ( "You begin to mine.....", ch);
       WAIT_STATE ( ch, 60 );
       send_to_char ("You have found a piece of Thorium\n\r", ch);
       send_to_char ("\n\r", ch );
       send_to_char ("You are exhausted, you must wait a little bit", ch );
       ch->thorium += 1;
    }
    else
    {
       send_to_char ("You begin to mine.....You found nothing", ch );
       WAIT_STATE ( ch, 10 );
       return;
     }
    }

    if ( !str_cmp (arg, "adamantium" ) )
    {
    if (number_percent () > 90 && ch->in_room->vnum >= 9580 && ch->in_room->vnum <= 9599 )
    {
       send_to_char ( "You begin to mine.....", ch);
       WAIT_STATE ( ch, 60 );
       send_to_char ("You have found a piece of Adamantium\n\r", ch);
       send_to_char ("\n\r", ch );
       send_to_char ("You are exhausted, you must wait a little bit", ch );
       ch->adamantium += 1;
    }
    else
    {
       send_to_char ("You begin to mine.....You found nothing", ch );
       WAIT_STATE ( ch, 10 );
       return;
      }
    }
  }

void do_junk(CHAR_DATA *ch, char *argument)
{
    char arg1[MAX_INPUT_LENGTH];
    char arg2[MAX_INPUT_LENGTH];
    long value;

    smash_tilde ( argument );
    argument = one_argument ( argument, arg1 );
    strcpy ( arg2, argument );

    if ( arg1[0] == '\0' || arg2[0] == '\0')
    {
        send_to_char ("Syntax: junk <material> <amount>\n\r", ch );
        return;
    }

    value = is_number ( arg2 ) ? atol ( arg2 ) : 1;

    if ( !str_cmp ( arg1, "ore" ) && ch->ore >= value )
    {
        printf_to_char ( ch, "You toss out %ld ore\n\r", value );
        ch->ore -= value;
    }
    else if ( !str_cmp ( arg1, "silver" ) && ch->silv >= value)
    {
        printf_to_char ( ch, "You toss out %ld silver\n\r", value);
        ch->silv -= value;
    }
    else if ( !str_cmp ( arg1, "gold" ) && ch->gld >= value)
    {
        printf_to_char (ch, "You toss out %ld gold\n\r", value);
        ch->gld -= value;
    }
    else if ( !str_cmp ( arg1, "adamantium" ) && ch->adamantium >= value )
    {
        printf_to_char (ch, "You toss out %ld adamantium\n\r", value );
        ch->adamantium -= value;
    }
    else if ( !str_cmp ( arg1, "thorium" ) && ch->thorium >= value )
    {
        printf_to_char (ch, "You toss out %ld thorium\n\r", value );
        ch->thorium -= value;
    }
    else
    {
       send_to_char ("You can't do that\n\r", ch );
    }
    return;
  
}

Now, that you got everything in, go into interp.c and interp.h and declare the commands, compile, and go. It should go in with no problems. Enjoy!