Jump to content
  • 0

@afk Command


Rage Guy

Question


  • Group:  Members
  • Topic Count:  113
  • Topics Per Day:  0.03
  • Content Count:  354
  • Reputation:   3
  • Joined:  02/17/13
  • Last Seen:  

I Want add @afk Command


 


- How to add it ?

Link to comment
Share on other sites

16 answers to this question

Recommended Posts


  • Group:  Members
  • Topic Count:  3
  • Topics Per Day:  0.00
  • Content Count:  93
  • Reputation:   14
  • Joined:  12/12/11
  • Last Seen:  

/*==========================================
* @afk
* Turns on/off logout on player
*------------------------------------------*/


static int atcommand_afk(const int fd, struct map_session_data* sd, const char* command, const char* message)
{
    nullpo_retr(-1, sd);


    if( map[sd->bl.m].flag.autotrade == battle_config.autotrade_mapflag )
    {
        //sd->state.monster_ignore = 1;
        sd->state.autotrade = 1;
        if( battle_config.at_timeout )
        {
            int timeout = atoi(message);
            status_change_start(&sd->bl, SC_AUTOTRADE, 10000, 0, 0, 0, 0, ((timeout > 0) ? min(timeout,battle_config.at_timeout) : battle_config.at_timeout) * 60000, 0);
        }


        clif_authfail_fd(fd, 15);
    } else
        clif_displaymessage(fd, "AFK is not allowed on this map.");


    return 0;
}
 

 

ACMD_DEF(afk)
 

 

I am unsure if this still works with rA but you add it to your atcommand.c

Edited by Evelynn
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  113
  • Topics Per Day:  0.03
  • Content Count:  354
  • Reputation:   3
  • Joined:  02/17/13
  • Last Seen:  

where to add

/*==========================================
* @afk
* Turns on/off logout on player
*------------------------------------------*/


static int atcommand_afk(const int fd, struct map_session_data* sd, const char* command, const char* message)
{
    nullpo_retr(-1, sd);


    if( map[sd->bl.m].flag.autotrade == battle_config.autotrade_mapflag )
    {
        //sd->state.monster_ignore = 1;
        sd->state.autotrade = 1;
        if( battle_config.at_timeout )
        {
            int timeout = atoi(message);
            status_change_start(&sd->bl, SC_AUTOTRADE, 10000, 0, 0, 0, 0, ((timeout > 0) ? min(timeout,battle_config.at_timeout) : battle_config.at_timeout) * 60000, 0);
        }


        clif_authfail_fd(fd, 15);
    } else
        clif_displaymessage(fd, "AFK is not allowed on this map.");


    return 0;
}
 

and

 

ACMD_DEF(afk)

 

am using 3CeAM

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  3
  • Topics Per Day:  0.00
  • Content Count:  93
  • Reputation:   14
  • Joined:  12/12/11
  • Last Seen:  

You add it to your atcommand.c.

 

Find another other atcommand functions and paste the code right under it, do the same thing for ACMD_DEF.

 

Find where all the other ACMD_DEF's are and paste it accordingly.

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  5
  • Topics Per Day:  0.00
  • Content Count:  58
  • Reputation:   4
  • Joined:  07/10/13
  • Last Seen:  

You add it to your atcommand.c.

 

Find another other atcommand functions and paste the code right under it, do the same thing for ACMD_DEF.

 

Find where all the other ACMD_DEF's are and paste it accordingly.

We are using 3CeAM our atcommand.c it doesnt have

ACMD_DEF

 

It has this instead.

ACMD_FUNC(font) <---example from the @font command
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  3
  • Topics Per Day:  0.00
  • Content Count:  93
  • Reputation:   14
  • Joined:  12/12/11
  • Last Seen:  

You add it to your atcommand.c.

 

Find another other atcommand functions and paste the code right under it, do the same thing for ACMD_DEF.

 

Find where all the other ACMD_DEF's are and paste it accordingly.

We are using 3CeAM our atcommand.c it doesnt have

ACMD_DEF

 

It has this instead.

ACMD_FUNC(font) <---example from the @font command

Ah my apologies. I do not work with 3CeAM so I wouldn't have known this. Thank you for clarifying.

Edited by Evelynn
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  113
  • Topics Per Day:  0.03
  • Content Count:  354
  • Reputation:   3
  • Joined:  02/17/13
  • Last Seen:  

Thats my atcommand.c

atcommand.c

how to add it -__-

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  5
  • Topics Per Day:  0.00
  • Content Count:  58
  • Reputation:   4
  • Joined:  07/10/13
  • Last Seen:  

Try this one out. 

 

 


Can we try this one out then.

 

/*==========================================
* @afk
* Turns on/off logout on player
*------------------------------------------*/
ACMD_FUNC(afk)
{
static int atcommand_afk(const int fd, struct map_session_data* sd, const char* command, const char* message)
{
    nullpo_retr(-1, sd);


    if( map[sd->bl.m].flag.autotrade == battle_config.autotrade_mapflag )
    {
        //sd->state.monster_ignore = 1;
        sd->state.autotrade = 1;
        if( battle_config.at_timeout )
        {
            int timeout = atoi(message);
            status_change_start(&sd->bl, SC_AUTOTRADE, 10000, 0, 0, 0, 0, ((timeout > 0) ? min(timeout,battle_config.at_timeout) : battle_config.at_timeout) * 60000, 0);
        }


        clif_authfail_fd(fd, 15);
    } else
        clif_displaymessage(fd, "AFK is not allowed on this map.");


    return 0;
}
 

 

And insert it before this line.

~Place the code here~
/*==========================================
 * atcommand_info[] structure definition
 *------------------------------------------*/

 

And please add this

 

{ "afk",              1,1,     atcommand_afk },

 

after this line to add it on the commands

{ "hommutation",       60,60,     atcommand_hommutation },
~PUT IT HERE!
};

Rebuild your solution and test it in game.

 

And i think you have to add one more in trunk/conf/atcommand_athena.conf

 

after this line.

 

clearweather: 99,99
~put it here~

 

add:

 

//This is for the settings of afk command it will set the GM level for the afk command. as 1,1 shows it will enable this command for GM level 1
afk: 1,1

 

Please give me feedback once your done if its working or not.

Edited by redhotzip
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  113
  • Topics Per Day:  0.03
  • Content Count:  354
  • Reputation:   3
  • Joined:  02/17/13
  • Last Seen:  

where to add thise

{ "afk",              1,1,     atcommand_afk },
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  5
  • Topics Per Day:  0.00
  • Content Count:  58
  • Reputation:   4
  • Joined:  07/10/13
  • Last Seen:  

where to add thise

{ "afk",              1,1,     atcommand_afk },

here:

 

{ "hommutation",       60,60,     atcommand_hommutation },
~PUT IT HERE!
};

 

same file just search for that line.

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  113
  • Topics Per Day:  0.03
  • Content Count:  354
  • Reputation:   3
  • Joined:  02/17/13
  • Last Seen:  

 

where to add thise

{ "afk",              1,1,     atcommand_afk },

here:

 

{ "hommutation",       60,60,     atcommand_hommutation },
~PUT IT HERE!
};

 

same file just search for that line.

thats my atcommand.c 

can u edit it for me ?

cuz i dont understand u -_-

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  5
  • Topics Per Day:  0.00
  • Content Count:  58
  • Reputation:   4
  • Joined:  07/10/13
  • Last Seen:  

 

 

where to add thise

{ "afk",              1,1,     atcommand_afk },

here:

 

{ "hommutation",       60,60,     atcommand_hommutation },
~PUT IT HERE!
};

 

same file just search for that line.

thats my atcommand.c 

can u edit it for me ?

cuz i dont understand u -_-

Okay let me try. But please take a look at my CODED message there is the ~PUT IT HERE~ line, that is where you will put the code. x.x

 

EDIT:

 

That was not your atcommand.c o.o

but try to read on my Coded messages, you'll need to replace the ~PUT IT HERE! with the code given.

Edited by redhotzip
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  113
  • Topics Per Day:  0.03
  • Content Count:  354
  • Reputation:   3
  • Joined:  02/17/13
  • Last Seen:  

 

 

 

where to add thise

{ "afk",              1,1,     atcommand_afk },

here:

 

{ "hommutation",       60,60,     atcommand_hommutation },
~PUT IT HERE!
};

 

same file just search for that line.

thats my atcommand.c 

can u edit it for me ?

cuz i dont understand u -_-

Okay let me try. But please take a look at my CODED message there is the ~PUT IT HERE~ line, that is where you will put the code. x.x

 

mmm idk where is this file

{ "hommutation",       60,60,     atcommand_hommutation },
~PUT IT HERE!
};
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  3
  • Topics Per Day:  0.00
  • Content Count:  93
  • Reputation:   14
  • Joined:  12/12/11
  • Last Seen:  

Sorry if this offends you in any way but...

 

For future references, please try to attempt things yourself if you haven't tried. You were given a set of directions so... I'm not saying you didn't but it just seems as if you were wanting to be spoon fed. Not everyone will do this for you. At best, you could possibly try messing around with it until point of desperation. You do not learn by being spoon-fed.

 

Attempt to find it by trying to find whats within the text. You will eventually find it that way.

 

{ "hommutation", 60,60, atcommand_hommutation },

 

Try looking up keywords "hommutation" inside the atcommand.c ( The document you were told to edit ).

Edited by Evelynn
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  5
  • Topics Per Day:  0.00
  • Content Count:  58
  • Reputation:   4
  • Joined:  07/10/13
  • Last Seen:  

 

 

 

 

 

 

 

 

mmm idk where is this file

{ "hommutation",       60,60,     atcommand_hommutation },
~PUT IT HERE!
};

 

Please tell me that your using notepad++

 

It is in the same file atcommand.c

 

copy this line:

{ "hommutation",       60,60,     atcommand_hommutation },

 

 

and go to atcommand.c and press ctrl+f

and pase the line that you copied and then press enter

once your there click on the last page of the line AFTER ","

and then press enter and there you already did another line

once you have done that, copy this.

{ "afk",              1,1,     atcommand_afk },

 

 

 

and then your done.

 

It should look like this

 

{ "hommutation",       60,60,     atcommand_hommutation },
{ "afk",               1,1,       atcommand_afk },
};

Sorry if this offends you in any way but...

 

For future references, please try to attempt things yourself if you haven't tried. You were given a set of directions so... I'm not saying you didn't but it just seems as if you were wanting to be spoon fed. Not everyone will do this for you. At best, you could possibly try messing around with it until point of desperation. You do not learn by being spoon-fed.

 

Attempt to find it by trying to find whats within the text. You will eventually find it that way.

 

{ "hommutation", 60,60, atcommand_hommutation },

 

Try looking up keywords "hommutation" inside the atcommand.c ( The document you were told to edit ).

I think I just did the spoon fed part. x.x

 

I just wanted to help but if i found it that this was just going to be an abuse I might be thinking twice of helping other people again.

 

I did figure out the things that i have know while reading my own documents.

 

Anyways I hope he gets it this time.

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  113
  • Topics Per Day:  0.03
  • Content Count:  354
  • Reputation:   3
  • Joined:  02/17/13
  • Last Seen:  

Cannot find  { "hommutation", 60,60, atcommand_hommutation },

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  5
  • Topics Per Day:  0.00
  • Content Count:  58
  • Reputation:   4
  • Joined:  07/10/13
  • Last Seen:  

just look for:

 

hommutation

or anything that looks like this format

 

{ "hommutation",       60,60,     atcommand_hommutation },

 

or anything here

 

{ "rura",              40,40,     atcommand_mapmove },
	{ "warp",              40,40,     atcommand_mapmove },
	{ "mapmove",           40,40,     atcommand_mapmove }, // + /mm
	{ "where",              1,1,      atcommand_where },
	{ "jumpto",            20,20,     atcommand_jumpto }, // + /shift
	{ "warpto",            20,20,     atcommand_jumpto },
	{ "goto",              20,20,     atcommand_jumpto },
	{ "jump",              40,40,     atcommand_jump },
	{ "who",               20,20,     atcommand_who },
	{ "whois",             20,20,     atcommand_who },
	{ "who2",              20,20,     atcommand_who2 },
	{ "who3",              20,20,     atcommand_who3 },
	{ "whomap",            20,20,     atcommand_whomap },
	{ "whomap2",           20,20,     atcommand_whomap2 },
	{ "whomap3",           20,20,     atcommand_whomap3 },
	{ "whogm",             20,20,     atcommand_whogm },
	{ "save",              40,40,     atcommand_save },
	{ "return",            40,40,     atcommand_load },
	{ "load",              40,40,     atcommand_load },
	{ "speed",             40,40,     atcommand_speed },
	{ "storage",            1,1,      atcommand_storage },
	{ "gstorage",          50,50,     atcommand_guildstorage },
	{ "option",            40,40,     atcommand_option },
	{ "hide",              40,40,     atcommand_hide }, // + /hide
	{ "jobchange",         40,40,     atcommand_jobchange },
Edited by redhotzip
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...