Jump to content
  • 0

adding AFK!


Blue Jem

Question


  • Group:  Members
  • Topic Count:  151
  • Topics Per Day:  0.04
  • Content Count:  393
  • Reputation:   3
  • Joined:  09/16/13
  • Last Seen:  

how can add the command for AFK? i use latest SVN

Link to comment
Share on other sites

16 answers to this question

Recommended Posts


  • Group:  Members
  • Topic Count:  151
  • Topics Per Day:  0.04
  • Content Count:  393
  • Reputation:   3
  • Joined:  09/16/13
  • Last Seen:  

i try but i got error from scr files

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  9
  • Topics Per Day:  0.00
  • Content Count:  94
  • Reputation:   4
  • Joined:  01/29/13
  • Last Seen:  

what error did you get? maybe I can help you with it.

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  151
  • Topics Per Day:  0.04
  • Content Count:  393
  • Reputation:   3
  • Joined:  09/16/13
  • Last Seen:  

i use 17689 svn

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  9
  • Topics Per Day:  0.00
  • Content Count:  94
  • Reputation:   4
  • Joined:  01/29/13
  • Last Seen:  

and whats the error?

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  17
  • Topics Per Day:  0.00
  • Content Count:  114
  • Reputation:   1
  • Joined:  10/13/12
  • Last Seen:  

Manual patch then recompile will solve your problem. Do not apply patch automatically.

Edited by Kyroad
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  151
  • Topics Per Day:  0.04
  • Content Count:  393
  • Reputation:   3
  • Joined:  09/16/13
  • Last Seen:  

 
skill.c: In function âskill_parse_row_nonearnpcrangedbâ:
skill.c:18524: warning: comparison is always false due to limited range of data type
        CC      atcommand.c
atcommand.c: In function âatcommand_basecommandsâ:
atcommand.c:9406: error: âatcommand_reloadmsgconfâ undeclared (first use in this function)
atcommand.c:9406: error: (Each undeclared identifier is reported only once
atcommand.c:9406: error: for each function it appears in.)
make[1]: *** [obj_sql/atcommand.o] Error 1
make[1]: Leaving directory `/root/rathena/src/map'
make: *** [map] Error 2


this is my atcommand.c
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  9
  • Topics Per Day:  0.00
  • Content Count:  94
  • Reputation:   4
  • Joined:  01/29/13
  • Last Seen:  

try to change

                ACMD_DEF(join),
                ACMD_DEF(channel),
                ACMD_DEF(fontcolor),
                ACMD_DEF(langtype),
                ACMD_DEF(reloadmsgconf)
        };

to

                ACMD_DEF(join),
                ACMD_DEF(channel),
                ACMD_DEF(fontcolor),
                ACMD_DEF(langtype),
                //ACMD_DEF(reloadmsgconf)
        };
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  151
  • Topics Per Day:  0.04
  • Content Count:  393
  • Reputation:   3
  • Joined:  09/16/13
  • Last Seen:  

i change that but error

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  17
  • Topics Per Day:  0.00
  • Content Count:  114
  • Reputation:   1
  • Joined:  10/13/12
  • Last Seen:  

in atcommand.c find:

	//wrong or no entry
	clif_displaymessage(fd,msg_txt(sd,460)); // Please enter a valid language (usage: @langtype <language>).
	clif_displaymessage(fd,msg_txt(sd,464)); // ---- Available languages:
	while(test!=-1){ //out of range
		test = msg_checklangtype(i,false);
		if(test == 1)
			clif_displaymessage(fd,msg_langtype2langstr(i));
		i++;
	}
	return -1;
}

after that insert these lines:

 

/*==========================================
* @afk
*------------------------------------------*/
ACMD_FUNC(afk) {
 
		nullpo_retr(-1, sd);

				if(sd->bl.m == map_mapname2mapid("prontera")) {
				clif_displaymessage(fd, "@afk is not allowed on this map.");
				return 0;
				}

				if( pc_isdead(sd) ) {
				clif_displaymessage(fd, "Cannot @afk if you are dead.");
				return -1;
				}

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

				if(map[sd->bl.m].flag.pvp  || map[sd->bl.m].flag.gvg){
				clif_displaymessage(fd, "You may not use the @afk maps PVP or GVG.");
				return -1;}

						sd->state.autotrade = 1;
						sd->state.monster_ignore = 1;
						pc_setsit(sd);
						skill_sit(sd,1);
						clif_sitting(&sd->bl);
						clif_changelook(&sd->bl,LOOK_HEAD_TOP,471);
                        clif_specialeffect(&sd->bl, 234,AREA);                       
						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);
				} else
						clif_displaymessage(fd, "@afk is not allowed on this map.");
		return 0;
}

then find:

		ACMD_DEF(langtype),

after that insert this line:

		ACMD_DEF(afk)

in battle.c find:

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

then after that insert this line:

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

in battle.h find:

	int at_timeout;

then after that insert this line:

	int afk_timeout;

in misc.conf find:

 // 1 = Yes
 // 2 = Yes, when there are unread mails
 mail_show_status: 0

then after that insert these lines:


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

 

then after that recompile your server. Hope these helps you

Edited by Kyroad
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  151
  • Topics Per Day:  0.04
  • Content Count:  393
  • Reputation:   3
  • Joined:  09/16/13
  • Last Seen:  

yea i try this but thank you i got error



1>c:\users\admin\desktop\rathena1\rathena12\trunk\src\map\atcommand.c(9075): error C2143: syntax error : missing ';' before 'type'
1>c:\users\admin\desktop\rathena1\rathena12\trunk\src\map\atcommand.c(9079): error C2059: syntax error : 'if'
1>c:\users\admin\desktop\rathena1\rathena12\trunk\src\map\atcommand.c(9084): error C2059: syntax error : 'if'
1>c:\users\admin\desktop\rathena1\rathena12\trunk\src\map\atcommand.c(9089): error C2059: syntax error : 'if'
1>c:\users\admin\desktop\rathena1\rathena12\trunk\src\map\atcommand.c(9109): error C2059: syntax error : 'else'
1>c:\users\admin\desktop\rathena1\rathena12\trunk\src\map\atcommand.c(9111): error C2059: syntax error : 'return'
1>c:\users\admin\desktop\rathena1\rathena12\trunk\src\map\atcommand.c(9112): error C2059: syntax error : '}'
1>c:\users\admin\desktop\rathena1\rathena12\trunk\src\map\atcommand.c(9116): error C2143: syntax error : missing ')' before '('
1>c:\users\admin\desktop\rathena1\rathena12\trunk\src\map\atcommand.c(9116): error C2059: syntax error : ','
1>c:\users\admin\desktop\rathena1\rathena12\trunk\src\map\atcommand.c(9116): error C2143: syntax error : missing ')' before 'constant'
1>c:\users\admin\desktop\rathena1\rathena12\trunk\src\map\atcommand.c(9116): error C2091: function returns function
1>c:\users\admin\desktop\rathena1\rathena12\trunk\src\map\atcommand.c(9116): error C2143: syntax error : missing '{' before 'constant'
1>c:\users\admin\desktop\rathena1\rathena12\trunk\src\map\atcommand.c(9116): error C2059: syntax error : '<Unknown>'
1>c:\users\admin\desktop\rathena1\rathena12\trunk\src\map\atcommand.c(9116): error C2059: syntax error : ')'
1>c:\users\admin\desktop\rathena1\rathena12\trunk\src\map\atcommand.c(9116): error C2059: syntax error : ')'
1>c:\users\admin\desktop\rathena1\rathena12\trunk\src\map\atcommand.c(9117): error C2059: syntax error : 'while'
1>c:\users\admin\desktop\rathena1\rathena12\trunk\src\map\atcommand.c(9123): error C2059: syntax error : 'return'
1>c:\users\admin\desktop\rathena1\rathena12\trunk\src\map\atcommand.c(9124): error C2059: syntax error : '}'
1>c:\users\admin\desktop\rathena1\rathena12\trunk\src\map\atcommand.c(9850): warning C4013: 'atcommand_basecommands' undefined; assuming extern returning int
 

error

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  17
  • Topics Per Day:  0.00
  • Content Count:  114
  • Reputation:   1
  • Joined:  10/13/12
  • Last Seen:  

I use the same patch and up to date trunk, it's working smoothly, i use rathena-10.sln for compiling

Edited by Integer
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  151
  • Topics Per Day:  0.04
  • Content Count:  393
  • Reputation:   3
  • Joined:  09/16/13
  • Last Seen:  

yea im using ra10 for recompiling



what reathena version did you use 17689

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  17
  • Topics Per Day:  0.00
  • Content Count:  114
  • Reputation:   1
  • Joined:  10/13/12
  • Last Seen:  

yea im using ra10 for recompiling

what reathena version did you use 17689

 

r17689~ updated

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  151
  • Topics Per Day:  0.04
  • Content Count:  393
  • Reputation:   3
  • Joined:  09/16/13
  • Last Seen:  

same  but why i got error

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  25
  • Topics Per Day:  0.01
  • Content Count:  509
  • Reputation:   80
  • Joined:  11/20/11
  • Last Seen:  

try this
rA @afk.patch

 

I remove all outdate thing also the condition check
This patch just force you to sit then add AFK hat only

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...