This is my own little code mutilation.
Use at your own risk, I suck at coding.
Basically this will allow you to use "do_afk" and "IMCCMD_AFK" as the same function. 
So you could safely remove IMCCMD_AFK and still have the feature built into your own do_afk command.
This will also allow for the unsetting of this command just buy typing another command.
If you don't want that feature, skip the interp.c section of this little snippet.


In interp.c 

	With in the "void interpret"  Put this next chunk of code to have afk auto unset.
	Should be under, atleast for Rot1.4, this part of the code to work.

	    /*
     * Strip leading spaces.
     */
    while ( isspace(*argument) )
    argument++;
    if ( argument[0] == '\0' )
    return;

After the above code insert the code below.



    if ( !IS_NPC(ch) && IMCIS_SET(IMCFLAG(ch), IMC_AFK) )
       {
        do_function(ch, &do_afk, "");
       }




In comm.c 
	Under "void bust_a_prompt
	Below this part of code.

    if (buf2 == NULL || buf2[0] == '\0')
    {
        sprintf( buf, "<%dhp %dmana %dmove> %s",
            ch->hit,ch->mana,ch->move,ch->prefix);
        send_to_char(buf,ch);
        return;
    }

Put this so the prompt will change to show <AFK> for your prompt so you know you are in afk.

	if (IMCIS_SET(IMCFLAG(ch), IMC_AFK))
  	 {
       	 send_to_char("<AFK> ",ch);
       	 return;
 	  }


In act_comm.c

Find your do_afk command and change to fir your mud.  I put my complete do_afk in here so you may use it or modify your own.   This will also still let your "replays" work also.



void do_afk ( CHAR_DATA *ch, char * argument)
{
    char buf[MAX_STRING_LENGTH];

    if (IMCIS_SET(IMCFLAG(ch), IMC_AFK))
    {
      if(ch->tells)
      {
         sprintf( buf, "AFK mode removed.  You have {R%d{x tells waiting.\n\r", ch->tells );
         send_to_char( buf, ch );
         send_to_char("Type 'replay' to see tells.\n\r",ch);
      }
      else
      {
         send_to_char("AFK mode removed.  You have no tells waiting.\n\r",ch);
      }
      IMCREMOVE_BIT(IMCFLAG(ch),IMC_AFK);
    }
   else
   {
     send_to_char("You are now in AFK mode.\n\r",ch);
     IMCSET_BIT(IMCFLAG(ch),IMC_AFK);
   }
}

Continuing in act_comm.c find this chunk of code 
Should be located in "do_tell"


---    if (IS_SET(victim->comm,COMM_AFK))
    {
        if (IS_NPC(victim))
        {
            act("$E is AFK, and not receiving tells.",ch,NULL,victim,TO_CHAR);
            return;
        }

        act("$E is AFK, but your tell will go through when $E returns.",
            ch,NULL,victim,TO_CHAR);
        sprintf(buf,"%s tells you '%s'\n\r",PERS(ch,victim),argument);
        buf[0] = UPPER(buf[0]);
        add_buf(victim->pcdata->buffer,buf);
        victim->tells++;
        return;
    }

And replace it with this.  Or modify it to work with your mud.


+++    if (IMCSET_BIT ( IMCFLAG ( victim ), IMC_AFK ))
    {
        if (IS_NPC(victim))
        {
            act("$E is AFK, and not receiving tells.",ch,NULL,victim,TO_CHAR);
            return;
        }

        act("$E is AFK, but your tell will go through when $E returns.",
            ch,NULL,victim,TO_CHAR);
        sprintf(buf,"%s tells you '%s'\n\r",PERS(ch,victim),argument);
        buf[0] = UPPER(buf[0]);
        add_buf(victim->pcdata->buffer,buf);
        victim->tells++;
        return;
    }

Still more in act_comm.c
In do_reply

Find this chunk of code and replace it or modify it.


---    if (IS_SET(victim->comm,COMM_AFK))
    {
        if (IS_NPC(victim))
        {
            act_new("$E is AFK, and not receiving tells.",
                ch,NULL,victim,TO_CHAR,POS_DEAD);
            return;
        }

        act_new("$E is AFK, but your tell will go through when $E returns.",
            ch,NULL,victim,TO_CHAR,POS_DEAD);
        sprintf(buf,"%s tells you '%s'\n\r",PERS(ch,victim),argument);
        buf[0] = UPPER(buf[0]);
        add_buf(victim->pcdata->buffer,buf);
        victim->tells++;
        return;
    }




with this 



+++    if (IMCIS_SET ( IMCFLAG (victim), IMC_AFK))
    {
        if (IS_NPC(victim))
        {
            act_new("$E is AFK, and not receiving tells.",
                ch,NULL,victim,TO_CHAR,POS_DEAD);
            return;
        }

        act_new("$E is AFK, but your tell will go through when $E returns.",
            ch,NULL,victim,TO_CHAR,POS_DEAD);
        sprintf(buf,"%s tells you '%s'\n\r",PERS(ch,victim),argument);
        buf[0] = UPPER(buf[0]);
        add_buf(victim->pcdata->buffer,buf);
        victim->tells++;
        return;
    }





Now as I was tinkering in act_info.c and trying to get the game to show in room each character's stat.  Like if you type look it shows afk.
But when I tried the above method that game crashed.  So I have omitted that part of the code because I am eventually going to take it out 
for good.  So you are on your own there.  So if you have done everthing right you can safely take out the IMC_CMD( imcafk ) in imc.c

Good Luck.


Kizeren@MindorDev
shaunmcbride@charter.ent