@bst Stand for = Buy Sell and Trade

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
Oh I get it now.. this would be the solution for that.. ^^

Code:
-    script    test#444    -1,{OnCommand:    if ( !getstrlen( .@atcmd_parameters$ ) ) {	    message strcharinfo(0), "Please, enter a message (usage: @bst <message>).";	    end;    }    $@input$ = implode(.@atcmd_parameters$," " );    $@name$ = strcharinfo(0);    .@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;    }	    query_sql ("SELECT `char`.`account_id` FROM `char` JOIN `login` ON `char`.`account_id` = `login`.`account_id` WHERE `char`.`online` = 1", .@account_id);	    bst_delay = gettimetick(2); // delay	    while ( .@i < getarraysize(.@account_id) ) {		    if ( attachrid( .@account_id[.@i] ) )			    dispbottom "[Market]" + $@name$ + " : " + $@input$; // display to every character on the server.			    detachrid;			    .@i++;	    }	    end;OnInit:    bindatcmd "bst",strnpcinfo(0)+"::OnCommand", 0, 1; // bind @bst command.    end;}
 
 
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
Oh I get it now.. this would be the solution for that.. ^^

-  script  test#444  -1,{OnCommand:   if ( !getstrlen( .@atcmd_parameters$ ) ) {   message strcharinfo(0), "Please, enter a message (usage: @bst <message>).";   end;   }   $@input$ = implode(.@atcmd_parameters$," " );   $@name$ = strcharinfo(0);   .@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;   }   query_sql ("SELECT `char`.`account_id` FROM `char` JOIN `login` ON `char`.`account_id` = `login`.`account_id` WHERE `char`.`online` = 1", .@account_id);   bst_delay = gettimetick(2); // delay   while ( .@i < getarraysize(.@account_id) ) {   if ( attachrid( .@account_id[.@i] ) )   dispbottom "[Market]" + $@name$ + " : " + $@input$; // display to every character on the server.   detachrid;   .@i++;   }   end;OnInit:   bindatcmd "bst",strnpcinfo(0)+"::OnCommand", 0, 1; // bind @bst command.   end;}
but AnnieRuru just used this to the old bst script to make color on chat 

    announce "[Market] "+ strcharinfo(0) +" : "+ implode( .@atcmd_parameters$," " ), bc_all, 0x9999FF;end;

}
can u just add this ?

 
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
Oh I get it now.. this would be the solution for that.. ^^

-  script  test#444  -1,{OnCommand:   if ( !getstrlen( .@atcmd_parameters$ ) ) {   message strcharinfo(0), "Please, enter a message (usage: @bst <message>).";   end;   }   $@input$ = implode(.@atcmd_parameters$," " );   $@name$ = strcharinfo(0);   .@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;   }   query_sql ("SELECT `char`.`account_id` FROM `char` JOIN `login` ON `char`.`account_id` = `login`.`account_id` WHERE `char`.`online` = 1", .@account_id);   bst_delay = gettimetick(2); // delay   while ( .@i < getarraysize(.@account_id) ) {   if ( attachrid( .@account_id[.@i] ) )   dispbottom "[Market]" + $@name$ + " : " + $@input$; // display to every character on the server.   detachrid;   .@i++;   }   end;OnInit:   bindatcmd "bst",strnpcinfo(0)+"::OnCommand", 0, 1; // bind @bst command.   end;}
but AnnieRuru just used this to the old bst script to make color on chat 

>>> 

    announce "[Market] "+ strcharinfo(0) +" : "+ implode( .@atcmd_parameters$," " ), bc_all, 0x9999FF;end;

}
can u just add this ?
im wondering sir.. what u really want? lol

just wondering.... someone gives a script using announce with a color..

and the other one gaves u with dispbottom.. 

and now u want them both ?

if u add that line.. it will announce like what u showed in the previous post with a screenshot.(u don't want it right?)

AFAIK.. dispbottom cant be in a color code..(not unless someone will do it for u and i believe it will required source modif.)

no offense.. just wondering...

 
Last edited by a moderator:
i just want to change the color of the message in the Chat Box and... i don't want the message to be like broadcast i just want it to broadcast on Chat Box Only but with Customized Color. 

 
i just want to change the color of the message in the Chat Box and... i don't want the message to be like broadcast i just want it to broadcast on Chat Box Only but with Customized Color. 
and sadly dispbottom cant be in a customized color..

If you want a colored dispbottom, you need to add dispbottom2 by Dastgir Pojee..

@edit

Not working. 
read this

 
Last edited by a moderator:
i just want to change the color of the message in the Chat Box and... i don't want the message to be like broadcast i just want it to broadcast on Chat Box Only but with Customized Color. 
and sadly dispbottom cant be in a customized color..

> 


If you want a colored dispbottom, you need to add dispbottom2 by Dastgir Pojee..

@edit

Not working. 
read this
what this means?

@editNot working. 
 
i think, that is dispbottom2 by sir dats.. (it is a custom commands that will make dispbottom to have a color)

and he said not working.. idk

 
Last edited by a moderator:
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.

 
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;
}
View attachment 1219 

 
Last edited by a moderator:
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.)
 
Last edited by a moderator:
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

 
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$;

 
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 Words
for ( 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
 
Last edited by a moderator:
Bump please..
default_ani_meow.gif


 
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

 
Back
Top