Jump to content
  • 0

Question

Posted

I need a sql log for @ bst this is the script

-	script	bst_atcommand	-1,{
OnInit:
	bindatcmd "bst",strnpcinfo(0)+"::OnCommand";
	end;
OnCommand:
	if ( !getstrlen(.@atcmd_parameters$) ) {
		message strcharinfo(0), "Please, enter a message (usage: @bst <message>).";
		end;
	}
	if ( @bst_delay + 1800 > gettimetick(2) ) {
		message strcharinfo(0), "There is a 30 min delay of using this command again";
		end;
	}
	@bst_delay = gettimetick(2);
	announce "[Market] "+ strcharinfo(0) +" : "+ implode( .@atcmd_parameters$," " ), bc_all, 0x9999FF;
	end;
}

want the,Player_name ,the announce test,and the datum in bst_Market_log is stored

 

hope someone can help me

10 answers to this question

Recommended Posts

  • 0
Posted


/*

CREATE TABLE `ragnarok_logs`.`bst_market_log` (

`id` BIGINT(20) NOT NULL AUTO_INCREMENT,

`name` VARCHAR(30) NOT NULL DEFAULT '',

`message` VARCHAR(150) NOT NULL DEFAULT '',

`time` DATETIME NOT NULL DEFAULT '0000-00-00 00:00:00',

PRIMARY KEY (`id`))

ENGINE = MyISAM

DEFAULT CHARACTER SET = utf8;

*/

- script bst_atcommand -1,{

OnInit:

bindatcmd "bst",strnpcinfo(0)+"::OnCommand";

end;

OnCommand:

if ( !getstrlen(.@atcmd_parameters$) ) {

message strcharinfo(0), "Please, enter a message (usage: @bst <message>).";

end;

}

if ( @bst_delay + 1800 > gettimetick(2) ) {

message strcharinfo(0), "There is a 30 min delay of using this command again";

end;

}

@bst_delay = gettimetick(2);

.@message$ = implode( .@atcmd_parameters$," " );

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

query_logsql( "INSERT INTO `bst_market_log` ( `name`, `message` ) VALUES ( '"+escape_sql(strcharinfo(0))+"', '"+escape_sql( getstrlen(.@message$)>150?substr(.@message$,0,149):.@message$ )+"' );" );

end;

}

  • Upvote 1
  • 0
Posted

Hello, How do I install this?

via NPC?

if this is to SQL  /  PHP ADMIN please enlighten me @Skorm Ty

SQL table load in phpmyadmin

 

NPC save in NPC folder. 

Follow the NPC adding guide.

  • 0
Posted

 

Hello, How do I install this?

via NPC?

if this is to SQL  /  PHP ADMIN please enlighten me @Skorm Ty

SQL table load in phpmyadmin

 

NPC save in NPC folder. 

Follow the NPC adding guide.

 

do you have a script that goes the same but will use @shout instead of @bst?

@bst = Market

@shout = shoutout or paging or recruiting

 

I tried duplicating this script then changing the name still whenever I type @shout it will show as @bst.

  • 0
Posted

do you have a script that goes the same but will use @shout instead of @bst?

@bst = Market

@shout = shoutout or paging or recruiting

 

 

I tried duplicating this script then changing the name still whenever I type @shout it will show as @bst.

/*
CREATE TABLE `ragnarok_logs`.`sout_market_log` (
  `id` BIGINT(20) NOT NULL AUTO_INCREMENT,
  `name` VARCHAR(30) NOT NULL DEFAULT '',
  `message` VARCHAR(150) NOT NULL DEFAULT '',
  `time` DATETIME NOT NULL DEFAULT '0000-00-00 00:00:00',
  PRIMARY KEY (`id`))
ENGINE = MyISAM
DEFAULT CHARACTER SET = utf8;
*/

-	script	sout_atcommand	-1,{
OnInit:
	bindatcmd "shout",strnpcinfo(0)+"::OnCommand";
	end;
OnCommand:
	if ( !getstrlen(.@atcmd_parameters$) ) {
		message strcharinfo(0), "Please, enter a message (usage: @shout <message>).";
		end;
	}
	if ( @sout_delay + 1800 > gettimetick(2) ) {
		message strcharinfo(0), "There is a 30 min delay of using this command again";
		end;
	}
	@sout_delay = gettimetick(2);
	.@message$ = implode( .@atcmd_parameters$," " );
	announce "[Recruiting] "+ strcharinfo(0) +" : "+ .@message$, bc_area, 0x99FFFF;
	query_logsql( "INSERT INTO `sout_market_log` ( `name`, `message` ) VALUES ( '"+escape_sql(strcharinfo(0))+"', '"+escape_sql( getstrlen(.@message$)>150?substr(.@message$,0,149):.@message$ )+"' );" );
	end;
}
  • 0
Posted (edited)

 

do you have a script that goes the same but will use @shout instead of @bst?

@bst = Market

@shout = shoutout or paging or recruiting

 

 

I tried duplicating this script then changing the name still whenever I type @shout it will show as @bst.

/*
CREATE TABLE `ragnarok_logs`.`sout_market_log` (
  `id` BIGINT(20) NOT NULL AUTO_INCREMENT,
  `name` VARCHAR(30) NOT NULL DEFAULT '',
  `message` VARCHAR(150) NOT NULL DEFAULT '',
  `time` DATETIME NOT NULL DEFAULT '0000-00-00 00:00:00',
  PRIMARY KEY (`id`))
ENGINE = MyISAM
DEFAULT CHARACTER SET = utf8;
*/

-	script	sout_atcommand	-1,{
OnInit:
	bindatcmd "shout",strnpcinfo(0)+"::OnCommand";
	end;
OnCommand:
	if ( !getstrlen(.@atcmd_parameters$) ) {
		message strcharinfo(0), "Please, enter a message (usage: @shout <message>).";
		end;
	}
	if ( @sout_delay + 1800 > gettimetick(2) ) {
		message strcharinfo(0), "There is a 30 min delay of using this command again";
		end;
	}
	@sout_delay = gettimetick(2);
	.@message$ = implode( .@atcmd_parameters$," " );
	announce "[Recruiting] "+ strcharinfo(0) +" : "+ .@message$, bc_area, 0x99FFFF;
	query_logsql( "INSERT INTO `sout_market_log` ( `name`, `message` ) VALUES ( '"+escape_sql(strcharinfo(0))+"', '"+escape_sql( getstrlen(.@message$)>150?substr(.@message$,0,149):.@message$ )+"' );" );
	end;
}

Thank you so much skorm, this is very helpful. Commend. Thanks again.

Edited by Potato Chips

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.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...