Jump to content
  • 0

Logging the trade on NPC


skyroofficial

Question


  • Group:  Members
  • Topic Count:  7
  • Topics Per Day:  0.00
  • Content Count:  21
  • Reputation:   0
  • Joined:  04/16/17
  • Last Seen:  

So i've made the script on THIS POST that have been helped by @Emistry and @Mephisto

and i tried to modify them also.. and then i start trying to make a log on SQL .. but they didnt work /an

So this is the script i have modified ( well.. i cut to the point on the errors )

 

.@count_20450 = countitem( 20450 );
	delitem 20450, .@count_20450;
	getitem 32502, ( .@count_20450 * 10 );

	.@count_32171 = countitem( 32171 );
	delitem 32171, .@count_32171;
	getitem 32502, ( .@count_32171 * 7 );

	mes "Exchanged "+.@count_20450+"x "+getitemname( 20450 )+" to "+( .@count_20450 * 10 )+"x "+getitemname( 32502 );
	mes "Exchanged "+.@count_32171+"x "+getitemname( 32171 )+" to "+( .@count_32171 * 7 )+"x "+getitemname( 32502 );
	
	close;
	
OnInit:
	query_sql "CREATE TABLE IF NOT EXISTS `returned` (`code` TINYTEXT NOT NULL, `item_id` INT NOT NULL, `item_amount` INT NOT NULL, INDEX `code` (`code`(32)) ) ENGINE=MyISAM";

	
}

 

Oh, and also.. the NPC need to make them to type " YES " before the script runs.. how do i put them ?

Any helps ? XD

Edited by skyroofficial
another request
Link to comment
Share on other sites

6 answers to this question

Recommended Posts

  • 0

  • Group:  Members
  • Topic Count:  54
  • Topics Per Day:  0.01
  • Content Count:  513
  • Reputation:   83
  • Joined:  08/11/12
  • Last Seen:  

I think all activities about items can be seen in itemlog sql table. You don't need to do something like this. Have checked it?

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  7
  • Topics Per Day:  0.00
  • Content Count:  21
  • Reputation:   0
  • Joined:  04/16/17
  • Last Seen:  

39 minutes ago, Ninja said:

I think all activities about items can be seen in itemlog sql table. You don't need to do something like this. Have checked it?

yes but you know.. there are alot.. lots of the list on the logs..:ani_swt3:

so thats why i tried to make a separate logs just to monitor those specified items in that specified npc that i made :meow:

anyways , thanks for the reply tho /no1

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  54
  • Topics Per Day:  0.01
  • Content Count:  513
  • Reputation:   83
  • Joined:  08/11/12
  • Last Seen:  

9 hours ago, skyroofficial said:

yes but you know.. there are alot.. lots of the list on the logs..:ani_swt3:

so thats why i tried to make a separate logs just to monitor those specified items in that specified npc that i made :meow:

anyways , thanks for the reply tho /no1

You only need to learn how to use SQL and in my opinion it is fairly easy. :)

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  7
  • Topics Per Day:  0.00
  • Content Count:  21
  • Reputation:   0
  • Joined:  04/16/17
  • Last Seen:  

10 hours ago, Ninja said:

You only need to learn how to use SQL and in my opinion it is fairly easy. :)

yep . already solved it few hours ago /no1

 

and thus.. theres this one left 

On 5/22/2017 at 7:23 PM, skyroofficial said:

Oh, and also.. the NPC need to make them to type " YES " before the script runs.. how do i put them ?

 

 

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  54
  • Topics Per Day:  0.01
  • Content Count:  513
  • Reputation:   83
  • Joined:  08/11/12
  • Last Seen:  

input .@i $;

if (strtolower (.@i $ ) == "yes") {

          do this;

}

  • Upvote 1
Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  7
  • Topics Per Day:  0.00
  • Content Count:  21
  • Reputation:   0
  • Joined:  04/16/17
  • Last Seen:  

On 5/24/2017 at 9:30 PM, Ninja said:

input .@i $;

if (strtolower (.@i $ ) == "yes") {

          do this;

}

omg thanks again ! :D

 

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