Jump to content

Question

anyone still have patch for @afk with latest github?

please share

Share this post


Link to post
Share on other sites

13 answers to this question

Recommended Posts

  • 0
2 hours ago, PapaZola said:

anyone still have patch for @afk with latest github?

please share

I'm currently using this. hope this would help.

src/map/atcommand.cpp


Find : 
#include "../custom/atcommand.inc"

Add [ Above ] :
 

Spoiler

/*==========================================
* @afk
*------------------------------------------*/
ACMD_FUNC(afk) {
 
        nullpo_retr(-1, sd);
                        sd->state.autotrade = 1;
                        sd->state.monster_ignore = 1;
                        if( battle_config.afk_timeout )
                        {
                                int timeout = atoi(message);
                                status_change_start(NULL, &sd->bl, SC_AUTOTRADE, 10000,0,0,0,0, ((timeout > 0) ? min(timeout,battle_config.afk_timeout) : battle_config.afk_timeout)*60000,0);
                        }
                        clif_authfail_fd(fd, 15);
        return 0;
}

Find : 
     };
AtCommandInfo* atcommand;
 

Add [ Above ]
 

Spoiler

          ACMD_DEF(afk)


src/map/battle.cpp

Find : 

{ "at_timeout",                         &battle_config.at_timeout,                      0,      0,      INT_MAX,        },
 

Add [ Below ] :
 

Spoiler

{ "afk_timeout",                        &battle_config.afk_timeout,                     0,      0,      INT_MAX,        },


src/map/battle.hpp

Find : 

int at_timeout;

Add [ Below ] :
 

Spoiler

int afk_timeout;

 

conf/battle/misc.conf

Find :
mail_show_status: 0

Add [ Below ] :

 

Spoiler

// Set this to the amount of minutes afk chars will be kicked from the server.
afk_timeout: 0


 

  • Love 1
  • Like 1

Share this post


Link to post
Share on other sites
  • 0
14 minutes ago, Gerzzie said:

I'm currently using this. hope this would help.

src/map/atcommand.cpp


Find : 
#include "../custom/atcommand.inc"

Add [ Above ] :
 

  Hide contents

/*==========================================
* @afk
*------------------------------------------*/
ACMD_FUNC(afk) {
 
        nullpo_retr(-1, sd);
                        sd->state.autotrade = 1;
                        sd->state.monster_ignore = 1;
                        if( battle_config.afk_timeout )
                        {
                                int timeout = atoi(message);
                                status_change_start(NULL, &sd->bl, SC_AUTOTRADE, 10000,0,0,0,0, ((timeout > 0) ? min(timeout,battle_config.afk_timeout) : battle_config.afk_timeout)*60000,0);
                        }
                        clif_authfail_fd(fd, 15);
        return 0;
}

Find : 
     };
AtCommandInfo* atcommand;
 

Add [ Above ]
 

  Reveal hidden contents

          ACMD_DEF(afk)


src/map/battle.cpp

Find : 

{ "at_timeout",                         &battle_config.at_timeout,                      0,      0,      INT_MAX,        },
 

Add [ Below ] :
 

  Reveal hidden contents

{ "afk_timeout",                        &battle_config.afk_timeout,                     0,      0,      INT_MAX,        },


src/map/battle.hpp

Find : 

int at_timeout;

Add [ Below ] :
 

  Reveal hidden contents

int afk_timeout;

 

conf/battle/misc.conf

Find :
mail_show_status: 0

Add [ Below ] :

 

  Reveal hidden contents

// Set this to the amount of minutes afk chars will be kicked from the server.
afk_timeout: 0


 

 

Hi, is ths working?

Share this post


Link to post
Share on other sites
  • 0
4 minutes ago, DevMarikuLabsan said:

 

Hi, is ths working?

Currently using on my server. Yes. 🙂

Share this post


Link to post
Share on other sites
  • 0
25 minutes ago, Gerzzie said:

Currently using on my server. Yes. 🙂

Is your server latest rA?

Share this post


Link to post
Share on other sites
  • 0
3 minutes ago, Hijirikawa said:

Is your server latest rA?

My server is latest rAthena. I'm having an error. *bump*

Share this post


Link to post
Share on other sites
  • 0

It`s working fine on last rA.
But need to change in src/map/atcommand.cpp:
sd->state.monster_ignore = 1;
to 
sd->state.block_action |= PCBLOCK_IMMUNE;

Share this post


Link to post
Share on other sites
  • 0

Does not work in the latest git version
Any tips?
Using this tutorial> fail
https://github.com/rathena/rathena/wiki/diff#linux

        CXX     atcommand.cpp
atcommand.cpp: In function int atcommand_afk(int, map_session_data*, const char*, const char*)’:
atcommand.cpp:9264:40: error: class std::unordered_map<short int, int>’ has no member named autotrade
                 if( map[sd->bl.m].flag.autotrade == battle_config.autotrade_mapflag )
                                        ^~~~~~~~~
atcommand.cpp:9267:39: error: class std::unordered_map<short int, int>’ has no member named pvp
                 if(map[sd->bl.m].flag.pvp  || map[sd->bl.m].flag.gvg){
                                       ^~~
atcommand.cpp:9267:66: error: class std::unordered_map<short int, int>’ has no member named gvg
                 if(map[sd->bl.m].flag.pvp  || map[sd->bl.m].flag.gvg){
                                                                  ^~~
atcommand.cpp:9272:35: error: struct map_session_data::s_state has no member named monster_ignore
                         sd->state.monster_ignore = 1;
                                   ^~~~~~~~~~~~~~
make[1]: *** [obj/atcommand.o] Error 1


 

Share this post


Link to post
Share on other sites
  • 0
On 5/22/2019 at 11:10 PM, Gerzzie said:

I'm currently using this. hope this would help.

src/map/atcommand.cpp


Find : 
#include "../custom/atcommand.inc"

Add [ Above ] :
 

  Hide contents

/*==========================================
* @afk
*------------------------------------------*/
ACMD_FUNC(afk) {
 
        nullpo_retr(-1, sd);
                        sd->state.autotrade = 1;
                        sd->state.monster_ignore = 1;
                        if( battle_config.afk_timeout )
                        {
                                int timeout = atoi(message);
                                status_change_start(NULL, &sd->bl, SC_AUTOTRADE, 10000,0,0,0,0, ((timeout > 0) ? min(timeout,battle_config.afk_timeout) : battle_config.afk_timeout)*60000,0);
                        }
                        clif_authfail_fd(fd, 15);
        return 0;
}

Find : 
     };
AtCommandInfo* atcommand;
 

Add [ Above ]
 

  Hide contents

          ACMD_DEF(afk)


src/map/battle.cpp

Find : 

{ "at_timeout",                         &battle_config.at_timeout,                      0,      0,      INT_MAX,        },
 

Add [ Below ] :
 

  Hide contents

{ "afk_timeout",                        &battle_config.afk_timeout,                     0,      0,      INT_MAX,        },


src/map/battle.hpp

Find : 

int at_timeout;

Add [ Below ] :
 

  Hide contents

int afk_timeout;

 

conf/battle/misc.conf

Find :
mail_show_status: 0

Add [ Below ] :

 

  Hide contents

// Set this to the amount of minutes afk chars will be kicked from the server.
afk_timeout: 0


 


Thanks its still working in latest rA 🙂

Share this post


Link to post
Share on other sites
  • -2

Does not work in the last rA

Share this post


Link to post
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...

Important Information

By using this site, you agree to our Terms of Use and Privacy Policy.