ThyroDree 3 Posted February 11, 2014 this is the command for buy and Sell or trade example: i want to buy 1 Kiel Card @bst B> Kiel D-01 Card = PM Me Offer the broadcast Shows like this [Market] Admin : B> Kiel D-01 Card = PM Me Offer Quote Share this post Link to post Share on other sites
0 ThyroDree 3 Posted March 14, 2014 i got a problem adding those line of dispbottom2 of Dastgir i don't know where to add here check it In Clif.C: Place this at end of file: // Modification of clif_messagecolor to send colored messages to players to chat log only (doesn't display overhead)// 02c1 <packet len>.W <id>.L <color>.L <message>.?B// [by Dastgir]int clif_colormes_e(struct map_session_data * sd,unsigned long color1, const char* msg) { unsigned short msg_len = strlen(msg) + 1; WFIFOHEAD(sd->fd,msg_len + 12); WFIFOW(sd->fd,0) = 0x2C1; WFIFOW(sd->fd,2) = msg_len + 12; WFIFOL(sd->fd,4) = 0; WFIFOL(sd->fd,8) = (color1&0x0000FF) << 16 | (color1&0x00FF00) | (color1&0xFF0000) >> 16; // RGB -> BGR safestrncpy((char*)WFIFOP(sd->fd,12), msg, msg_len); clif_send(WFIFOP(sd->fd,0), WFIFOW(sd->fd,2), &sd->bl, SELF); return 0;} In Clif.H Place this at the end: int clif_colormes_e(struct map_session_data * sd,unsigned long color1, const char* msg); //[by Dastgir] So the Format you will use dispbottom2("0x00FF00","MESSAGE"); OR dispbottom2 "0x00FF00","MESSAGE"; REPLACE 0x00FF00 to any colour code. Quote Share this post Link to post Share on other sites
0 ThyroDree 3 Posted March 14, 2014 (edited) also found this posted by annieruru for Rathena Emulator by the way i am using Rathena Emulator i will replace my dispbottom on script.c? BUILDIN_FUNC(dispbottom) { TBL_PC *sd; if ( script_hasdata(st,4) ) { if ( data_isstring( script_getdata(st,4) ) ) sd = map_nick2sd( script_getstr(st,4) ); else sd = map_id2sd( script_getnum(st,4) ); } else sd = script_rid2sd(st); if ( sd ) { const char* msg = script_getstr(st,2); unsigned short msg_len = strlen( msg ) +1; unsigned int colorcode; if ( script_hasdata(st,3) ) colorcode = script_getnum(st,3); else colorcode = 0xbbffbb; WFIFOHEAD( sd->fd, msg_len + 12 ); WFIFOW(sd->fd,0) = 0x2C1; WFIFOW(sd->fd,2) = msg_len + 12; WFIFOL(sd->fd,4) = 0; WFIFOL(sd->fd,8) = colorcode; safestrncpy((char*)WFIFOP(sd->fd,12), msg, msg_len); WFIFOSET( sd->fd, msg_len + 12 ); } return 0;} BUILDIN_DEF(dispbottom,"s??"), prontera,162,180,5 script kjsdfhksdjf 100,{ dispbottom "test color"; dispbottom "test color", 0xff0000; dispbottom "test color", 0x0000ff; dispbottom "test color", 0xffffff; dispbottom "test color", 0xff00ff; end;} Edited March 14, 2014 by ThyroDree Quote Share this post Link to post Share on other sites
0 leloush 7 Posted March 14, 2014 (edited) i tried to find where line this need to add idk sir dats says its on script.c Place This above "BUILDIN_FUNC(dispbottom)" but only i can see in my script.c is idk. if its a typo error only /*========================================== * Displays a message for the player only (like system messages like "you got an apple" ) *------------------------------------------*/BUILDIN(dispbottom){ TBL_PC *sd=script_rid2sd(st); const char *message; message=script_getstr(st,2); if(sd) clif->disp_onlyself(sd,message,(int)strlen(message)); return true;} also found this posted by annieruru for Rathena Emulator by the way i am using Rathena Emulator i will replace my dispbottom on script.c? BUILDIN_FUNC(dispbottom) { TBL_PC *sd; if ( script_hasdata(st,4) ) { if ( data_isstring( script_getdata(st,4) ) ) sd = map_nick2sd( script_getstr(st,4) ); else sd = map_id2sd( script_getnum(st,4) ); } else sd = script_rid2sd(st); if ( sd ) { const char* msg = script_getstr(st,2); unsigned short msg_len = strlen( msg ) +1; unsigned int colorcode; if ( script_hasdata(st,3) ) colorcode = script_getnum(st,3); else colorcode = 0xbbffbb; WFIFOHEAD( sd->fd, msg_len + 12 ); WFIFOW(sd->fd,0) = 0x2C1; WFIFOW(sd->fd,2) = msg_len + 12; WFIFOL(sd->fd,4) = 0; WFIFOL(sd->fd,8) = colorcode; safestrncpy((char*)WFIFOP(sd->fd,12), msg, msg_len); WFIFOSET( sd->fd, msg_len + 12 ); } return 0; } >> BUILDIN_DEF(dispbottom,"s??"), prontera,162,180,5 script kjsdfhksdjf 100,{ dispbottom "test color"; dispbottom "test color", 0xff0000; dispbottom "test color", 0x0000ff; dispbottom "test color", 0xffffff; dispbottom "test color", 0xff00ff; end; } http--,,--//herc.ws/board/uploads/monthly_01_2014/post-4102-0-51649400-1389537183_thumb.jpg][/url] i dont think its a good idea to replace a code from source.. that is made from diff emulators.. not unless someone will confirm that is compatible to any emulator (or u know what u are doing.) Edited March 14, 2014 by AnnieRuru merge post as the time difference is just 2 minutes Quote Share this post Link to post Share on other sites
0 AnnieRuru 957 Posted March 15, 2014 if you are using rathena, its very easy src/map/script.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-)diff --git a/src/map/script.c b/src/map/script.cindex 5b68531..21735c0 100644--- a/src/map/script.c+++ b/src/map/script.c@@ -13103,8 +13103,12 @@ int atcommand_sub(struct script_state* st,int type){ TBL_PC *sd=script_rid2sd(st); const char *message; message=script_getstr(st,2);- if(sd)- clif_disp_onlyself(sd,message,(int)strlen(message));+ if(sd) {+ if ( script_hasdata(st,3) )+ clif_colormes( sd, script_getnum(st,3), message );+ else+ clif_disp_onlyself(sd,message,(int)strlen(message));+ } return SCRIPT_CMD_SUCCESS; } @@ -18975,7 +18979,7 @@ struct script_function buildin_func[] = { BUILDIN_DEF(deletepset,"i"), // Delete a pattern set [MouseJstr] #endif BUILDIN_DEF(preg_match,"ss?"),- BUILDIN_DEF(dispbottom,"s"), //added from jA [Lupus]+ BUILDIN_DEF(dispbottom,"s?"), //added from jA [Lupus] BUILDIN_DEF(getusersname,""), BUILDIN_DEF(recovery,"i???"), BUILDIN_DEF(getpetinfo,"i"),.. hercules however, clif->colormes has to be fixed without using color_table I dunno when Ind going to fix that though Quote Share this post Link to post Share on other sites
0 Enko 9 Posted March 20, 2014 its working at the same time its throwing error implode command must have at least 1 index in the array or the server throws error rathena users quite easy, they have addrid - script bst_atcommand -1,{OnInit: bindatcmd "bst",strnpcinfo(0)+"::OnCommand"; end;OnCommand: if ( !.@atcmd_numparameters ) { message strcharinfo(0), "Please, enter a message (usage: @bst <message>)."; end; } .@symbol$ = substr( .@atcmd_parameters$, 0,1 ); if ( .@symbol$ != "B>" && .@symbol$ != "S>" && .@symbol$ != "T>" ) { message strcharinfo(0), "Market Symbol is Needed when using this command ( B> S> T> )"; end; } if ( @bst_delay + 60 > gettimetick(2) ) { message strcharinfo(0), "There is a 60 seconds delay of using this command again"; end; } @bst_delay = gettimetick(2); .name$ = strcharinfo(0); .message$ = implode( .@atcmd_parameters$," " ); addrid 0; dispbottom "[Market] "+ .name$ +" : "+ .message$; end;}EDIT: why the code broken...ok that [Market] makes this cannot be post on the board it's being read as bbcode hercules user might want to try my getmemberaid http://upaste.me/86b8111195ced159a I got this error: [Error]: script error in file 'npc/npc/custom_commands/bst.txt' line 22 column 2 parse_line: expect command, missing function name or calling undeclared func tion 19: @bst_delay = gettimetick(2); 20: .@name$ = strcharinfo(0); 21: .@message$ = implode( .@atcmd_parameters$," " ); * 22: getmemberaid ALL_CLIENT; ~~~~~~~~^ 23: for ( .@i = 0; .@i < $@onlinecount; .@i++ ) { 24: attachrid $@onlineaid[.@i]; 25: dispbottom "[Market] "+ .@name$ +" : "+ .@message$; Quote Share this post Link to post Share on other sites
0 Hadeszeus 15 Posted March 30, 2014 (edited) Hi All, Can I request for enhancement of this @BST script. I'm trying to add word filter script to filter message with bad words. Anyone can integrate this? OnInit:setarray .@w$, "fuck","bitch","stupid"; // Restricted Wordsfor ( set .@i, 0; .@i < getarraysize(.@w$); set .@i, .@i + 1 )defpattern 1,".*"+.@w$[.@i]+".*","OnRestrict";activatepset 1;end;OnRestrict:dispbottom "You will be banned for 1 day for saying the restricted word in 5 seconds.";sleep2 5000;atcommand "@ban +5d " + strcharinfo(0);end; credits: http://rathena.org/board/topic/65493-npc-anti-certain-word/#entry110351 Edited March 30, 2014 by Hadeszeus Quote Share this post Link to post Share on other sites
0 Hadeszeus 15 Posted March 31, 2014 Bump please.. Quote Share this post Link to post Share on other sites
0 evilpuncker 503 Posted March 31, 2014 its working at the same time its throwing error implode command must have at least 1 index in the array or the server throws error rathena users quite easy, they have addrid - script bst_atcommand -1,{OnInit: bindatcmd "bst",strnpcinfo(0)+"::OnCommand"; end;OnCommand: if ( !.@atcmd_numparameters ) { message strcharinfo(0), "Please, enter a message (usage: @bst <message>)."; end; } .@symbol$ = substr( .@atcmd_parameters$, 0,1 ); if ( .@symbol$ != "B>" && .@symbol$ != "S>" && .@symbol$ != "T>" ) { message strcharinfo(0), "Market Symbol is Needed when using this command ( B> S> T> )"; end; } if ( @bst_delay + 60 > gettimetick(2) ) { message strcharinfo(0), "There is a 60 seconds delay of using this command again"; end; } @bst_delay = gettimetick(2); .name$ = strcharinfo(0); .message$ = implode( .@atcmd_parameters$," " ); addrid 0; dispbottom "[Market] "+ .name$ +" : "+ .message$; end;}EDIT: why the code broken...ok that [Market] makes this cannot be post on the board it's being read as bbcode hercules user might want to try my getmemberaid http://upaste.me/86b8111195ced159a I got this error: [Error]: script error in file 'npc/npc/custom_commands/bst.txt' line 22 column 2 parse_line: expect command, missing function name or calling undeclared func tion 19: @bst_delay = gettimetick(2); 20: .@name$ = strcharinfo(0); 21: .@message$ = implode( .@atcmd_parameters$," " ); * 22: getmemberaid ALL_CLIENT; ~~~~~~~~^ 23: for ( .@i = 0; .@i < $@onlinecount; .@i++ ) { 24: attachrid $@onlineaid[.@i]; 25: dispbottom "[Market] "+ .@name$ +" : "+ .@message$; you need to add this to your emulator Quote Share this post Link to post Share on other sites
0 Petey Pablo 0 Posted September 9, 2016 (edited) Fixed! Edited September 9, 2016 by Will Su Quote Share this post Link to post Share on other sites
this is the command for buy and Sell or trade
example:
i want to buy 1 Kiel Card
@bst B> Kiel D-01 Card = PM Me Offer
the broadcast Shows like this
Share this post
Link to post
Share on other sites