PapaZola Posted May 22, 2019 Posted May 22, 2019 anyone still have patch for @afk with latest github? please share Quote
0 Gerzzie Posted May 22, 2019 Posted May 22, 2019 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: 0Add [ Below ] : Spoiler // Set this to the amount of minutes afk chars will be kicked from the server. afk_timeout: 0 1 1 Quote
0 Ukiram Posted May 22, 2019 Posted May 22, 2019 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: 0Add [ 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? Quote
0 Gerzzie Posted May 22, 2019 Posted May 22, 2019 4 minutes ago, DevMarikuLabsan said: Hi, is ths working? Currently using on my server. Yes. Quote
0 Hijirikawa Posted May 22, 2019 Posted May 22, 2019 25 minutes ago, Gerzzie said: Currently using on my server. Yes. Is your server latest rA? Quote
0 Ukiram Posted May 22, 2019 Posted May 22, 2019 3 minutes ago, Hijirikawa said: Is your server latest rA? My server is latest rAthena. I'm having an error. *bump* Quote
0 Balfear Posted May 24, 2019 Posted May 24, 2019 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; Quote
0 hanzobr Posted February 13, 2020 Posted February 13, 2020 Does not work in the latest git version Any tips? Using this tutorial> failhttps://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 Quote
0 Boss Robs Posted July 16, 2020 Posted July 16, 2020 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: 0Add [ 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 Quote
0 markiez22 Posted February 13, 2023 Posted February 13, 2023 (edited) On 5/25/2019 at 1:15 AM, Balfear said: 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; yes its working i tested.! ty how to add AFK Hat , using @afk? Edited February 13, 2023 by markiez22 add a question Quote
-1 Karthikeyan Posted November 27, 2020 Posted November 27, 2020 any update on this ,as this is not working Quote
Question
PapaZola
anyone still have patch for @afk with latest github?
please share
15 answers to this question
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.