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:  

how to add @afk command .

Thanks for who is going to help me /lv

Link to comment
Share on other sites

10 answers to this question

Recommended Posts

  • 0

  • Group:  Members
  • Topic Count:  62
  • Topics Per Day:  0.02
  • Content Count:  296
  • Reputation:   4
  • Joined:  02/19/17
  • Last Seen:  

On 26/11/2013 at 11:33 PM, chatterboy said:

All from above has error occur:

Better use this guys! I made it haha...

 

Compatible upto Rathena 17695

 

how to remove the message that he is in autotrade mode? i want is he can still receive the message even he is in afk mode

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  48
  • Topics Per Day:  0.01
  • Content Count:  1125
  • Reputation:   236
  • Joined:  07/30/12
  • Last Seen:  

File Location: trunk/src/map/atcommand.c

 

Find:

ACMD_FUNC(reloadmsgconf)
{
	map_msg_reload();
	clif_displaymessage(fd, msg_txt(sd,463)); // Message configuration has been reloaded.
	return 0;
}

Add below:

ACMD_FUNC(afk)
{
	nullpo_retr(-1, sd);
	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);
	return 0;
}

 

 

Find:

	AtCommandInfo atcommand_base[] = {

 

Add below:

		ACMD_DEF(afk),
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:  

Can u pls make it to me cuz  i may break my scipts ==

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  117
  • Topics Per Day:  0.03
  • Content Count:  312
  • Reputation:   34
  • Joined:  10/15/12
  • Last Seen:  

File Location: trunk/src/map/atcommand.c

 

Find:

ACMD_FUNC(reloadmsgconf)
{
	map_msg_reload();
	clif_displaymessage(fd, msg_txt(sd,463)); // Message configuration has been reloaded.
	return 0;
}

Add below:

ACMD_FUNC(afk)
{
	nullpo_retr(-1, sd);
	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);
	return 0;
}

 

 

Find:

	AtCommandInfo atcommand_base[] = {

 

Add below:

		ACMD_DEF(afk),

 

 
 
 
this error comes when i did this 
 
this happens while compiling .
 
atcommand.c: In function âatcommand_afkâ:
atcommand.c:8998: warning: passing argument 2 of âstatus_change_startâ makes pointer from integer without a cast
atcommand.c:8998: error: too few arguments to function âstatus_change_startâ
make[1]: *** [obj_sql/atcommand.o] Error 1
make[1]: Leaving directory `/eathena/src/map'
 
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  48
  • Topics Per Day:  0.01
  • Content Count:  1125
  • Reputation:   236
  • Joined:  07/30/12
  • Last Seen:  

this error comes when i did this 

 
this happens while compiling .
 

atcommand.c: In function âatcommand_afkâ:
atcommand.c:8998: warning: passing argument 2 of âstatus_change_startâ makes pointer from integer without a cast
atcommand.c:8998: error: too few arguments to function âstatus_change_startâ
make[1]: *** [obj_sql/atcommand.o] Error 1
make[1]: Leaving directory `/eathena/src/map'

 

Seems like you're using eAthena SVN.

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:  

Posted · Hidden by Patskie, November 26, 2013 - No essence with the topic
Hidden by Patskie, November 26, 2013 - No essence with the topic

o.O

Link to comment

  • Group:  Members
  • Topic Count:  117
  • Topics Per Day:  0.03
  • Content Count:  312
  • Reputation:   34
  • Joined:  10/15/12
  • Last Seen:  

 

this error comes when i did this 

 
this happens while compiling .
 

atcommand.c: In function âatcommand_afkâ:
atcommand.c:8998: warning: passing argument 2 of âstatus_change_startâ makes pointer from integer without a cast
atcommand.c:8998: error: too few arguments to function âstatus_change_startâ
make[1]: *** [obj_sql/atcommand.o] Error 1
make[1]: Leaving directory `/eathena/src/map'

Seems like you're using eAthena SVN.

 

 

im using rAthena

Edited by ivantuting
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  48
  • Topics Per Day:  0.01
  • Content Count:  1125
  • Reputation:   236
  • Joined:  07/30/12
  • Last Seen:  

im using rAthena

 

Try this one;

ACMD_FUNC(afk) {

	nullpo_retr(-1, sd);
	if( map[sd->bl.m].flag.autotrade == battle_config.autotrade_mapflag )
	{
		

		if (!message || !*message) {

				chat_createpcchat(sd, "(AFK)", "", 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) mail me~", "", 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);
	
		
		
	
	} else
		clif_displaymessage(fd, "AFK is not allowed on this map.");

	return 0;
}
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  8
  • Topics Per Day:  0.00
  • Content Count:  308
  • Reputation:   24
  • Joined:  11/26/12
  • Last Seen:  

All from above has error occur:

 

 

1>c:\besprenro server\rathena-160\src\map\atcommand.c(3727): warning C4047: 'function' : 'block_list *' differs in levels of indirection from 'int'
1>c:\besprenro server\rathena-160\src\map\atcommand.c(3727): warning C4024: 'status_change_start' : different types for formal and actual parameter 2
1>c:\besprenro server\rathena-160\src\map\atcommand.c(3727): error C2198: 'status_change_start' : too few arguments for call
1>c:\besprenro server\rathena-160\src\map\atcommand.c(3742): warning C4047: 'function' : 'block_list *' differs in levels of indirection from 'int'
1>c:\besprenro server\rathena-160\src\map\atcommand.c(3742): warning C4024: 'status_change_start' : different types for formal and actual parameter 2
1>c:\besprenro server\rathena-160\src\map\atcommand.c(3742): error C2198: 'status_change_start' : too few arguments for call
1>c:\besprenro server\rathena-160\src\map\atcommand.c(3754): warning C4047: 'function' : 'block_list *' differs in levels of indirection from 'int'
1>c:\besprenro server\rathena-160\src\map\atcommand.c(3754): warning C4024: 'status_change_start' : different types for formal and actual parameter 2
1>c:\besprenro server\rathena-160\src\map\atcommand.c(3754): error C2198: 'status_change_start' : too few arguments for call

Better use this guys! I made it haha...

 

Compatible upto Rathena 17695

 

 

/*==========================================
 * @afk by GM Chatterboy [besprenRO Script]
 * Turns on/off Autotrade for a specific player
 *------------------------------------------*/
ACMD_FUNC(afk) {
    nullpo_retr(-1, sd);

    if( map[sd->bl.m].flag.autotrade != battle_config.autotrade_mapflag ) {
        clif_displaymessage(fd, msg_txt(sd,1179)); // Autotrade is not allowed on this map.
        return -1;
    }

    if( pc_isdead(sd) ) {
        clif_displaymessage(fd, msg_txt(sd,1180)); // You cannot autotrade when dead.
        return -1;
    }

    sd->state.autotrade = 1;
    if( battle_config.at_timeout ) {
        int timeout = atoi(message);
        status_change_start(NULL,&sd->bl, SC_AUTOTRADE, 10000, 0, 0, 0, 0, ((timeout > 0) ? min(timeout,battle_config.at_timeout) : battle_config.at_timeout) * 60000, 0);
    }

    channel_pcquit(sd,0xF); //leave all chan
    clif_authfail_fd(sd->fd, 15);

    return 0;
}
Edited by chatterboy
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...