/*

Instructions:
1. copy this command to your ACT_WIZ.C file
2. add the command to INTERP.C command table and define it in INTERP.H
3. compile and enjoy.

Bugs:
none that I have found.

Note:
I am currently useing this code, however I have not tested it on any
code bases other than ROM.

Description:
This command is used for the purpose of doing one command multiple times.. most common use is loading mobiles.
not the most useful command in mudding history but it has it's uses..
I sometimes cheat... and quant 30 at <playername> slay <playername>.. mortals REALLY enjoy that one ;)

Use:
I dont require credit for this command anywhere in your codebase.

Written by Virus:

Email me at Virus139@hotmail.com if you run across any problems or if
you'd like to comment or just simply to let me know you are using
this code bit.

-Virus

*/

void do_quant( CHAR_DATA *ch, char *argument )
{
    char                buf[MSL];
    sh_int              max_how_many = 45;
    sh_int              how_many;
    sh_int              mark;
    char                num[256];
    char                command[256];
    char                cmd_arg[MIL];
     
    argument = one_argument(argument, num);
    argument = one_argument(argument, command);
    strcpy( cmd_arg, argument );
          
    if (num[0] == '\0' || command == NULL || cmd_arg == NULL)
    {
        send_to_char("Syntax: quant <number> <command> <command argument>\n\r", ch);
        return;
    }
 
    if ((how_many = atoi( num )) == 0)
    {
        send_to_char("Syntax: quant <number> <command> <command argument>\n\r", ch);
        return;
    }

    if ((how_many = atoi( num )) > max_how_many)
    {
      sprintf(buf, "The number (%s) is too high to be processed.\n\r"
              "Please select a number below %d.\n\r", num, max_how_many);
        stc(buf, ch);
        return;
    }

    if(!str_cmp(command, "quant"))
    {
          send_to_char("Invalid command argument.\n\r", ch);
          return;
    }
    sprintf(buf, "%s %s", command, cmd_arg);
    for (mark = 0; mark != how_many; mark++)
        interpret( ch, buf );
}