Jump to content
  • 0
Sign in to follow this  
p!\/aT3

R> @afk compatible with Hercules

Question

9 answers to this question

Recommended Posts

  • 0

/*==========================================* @afk by Rad, built on by Tubby * same as autotrade, but works without vending*------------------------------------------*/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 ){if (!message || !*message) {chat_createpcchat(sd, "(@afk) Away", "", 1, 1);trade_tradeack(sd,4);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);}if((strlen(message) < 0)||(strlen(message) > 36)) {chat_createpcchat(sd, "(@afk) Away", "", 1, 1);trade_tradeack(sd,4);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);}chat_createpcchat(sd, message, "", 1, 1);trade_tradeack(sd,4);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);} elseclif_displaymessage(fd, "AFK is not allowed on this map.");return 0;}
And also add
ACMD_DEF(afk),
Into src/map/atcommand.c

 

There's some plugin version floating around that I've not been able to get working.

Share this post


Link to post
Share on other sites
  • 0

 

/*==========================================* @afk by Rad, built on by Tubby * same as autotrade, but works without vending*------------------------------------------*/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 ){if (!message || !*message) {chat_createpcchat(sd, "(@afk) Away", "", 1, 1);trade_tradeack(sd,4);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);}if((strlen(message) < 0)||(strlen(message) > 36)) {chat_createpcchat(sd, "(@afk) Away", "", 1, 1);trade_tradeack(sd,4);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);}chat_createpcchat(sd, message, "", 1, 1);trade_tradeack(sd,4);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);} elseclif_displaymessage(fd, "AFK is not allowed on this map.");return 0;}
And also add
ACMD_DEF(afk),
Into src/map/atcommand.c

 

There's some plugin version floating around that I've not been able to get working.

 

atcommand.c: In function 'atcommand_afk':atcommand.c:9444: warning: implicit declaration of function 'trade_tradeack'atcommand.c:9452: warning: implicit declaration of function 'clif_authfail_fd'atcommand.c:9485: warning: implicit declaration of function 'clif_displaymessage'atcommand.c: In function 'atcommand_basecommands':atcommand.c:9752: warning: initialization from incompatible pointer type

I got this when compile

Share this post


Link to post
Share on other sites
  • 0

You did something wrong, then.

 

Place the first bit of code right above:

/** * Fills the reference of available commands in atcommand DBMap **/
The second bit of code, further down in the file, like so:
		ACMD_DEF(channel),		ACMD_DEF(fontcolor),		ACMD_DEF(searchstore),		ACMD_DEF(costume),		ACMD_DEF(afk),
Works fine for me when placed in the correct location. /wah

Share this post


Link to post
Share on other sites
  • 0

 

atcommand.c: In function 'atcommand_afk':

atcommand.c:9444: warning: implicit declaration of function 'trade_tradeack'

atcommand.c:9452: warning: implicit declaration of function 'clif_authfail_fd'

atcommand.c:9485: warning: implicit declaration of function 'clif_displaymessage'

atcommand.c: In function 'atcommand_basecommands':

atcommand.c:9752: warning: initialization from incompatible pointer type

 

i think you need to change them to

 

trade->tradeack

clif->authfail_fd

clif->displaymessage

Share this post


Link to post
Share on other sites
  • 0

its

 

clif->message

or use the diff that I uploaded. I made it compatible for Hercules.

 

Click me
 

Edited by quesoph

Share this post


Link to post
Share on other sites
  • 0

 

You did something wrong, then.

 

Place the first bit of code right above:

/** * Fills the reference of available commands in atcommand DBMap **/
The second bit of code, further down in the file, like so:
		ACMD_DEF(channel),		ACMD_DEF(fontcolor),		ACMD_DEF(searchstore),		ACMD_DEF(costume),		ACMD_DEF(afk),
Works fine for me when placed in the correct location. /wah

 

I paste before this line

 

/** * Fills the reference of available commands in atcommand DBMap **/

and paste this below ACMD_DEF(costume),

ACMD_DEF(afk),

Share this post


Link to post
Share on other sites
  • 0
ACMD(afk){	nullpo_retr(-1, sd);		if( map[sd->bl.m].flag.autotrade == battle_config.autotrade_mapflag ){		chat_createpcchat(sd, "Be Right Back", "", 1, 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->chsys_quit(sd);		clif->authfail_fd(sd->fd, 15);	}else{		clif->message(fd, "AFK is not allowed on this map.");	}	return 0;}

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×
×
  • Create New...

Important Information

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