Jump to content
  • 0

Top 10 Items sold tracker


friomixx

Question


  • Group:  Members
  • Topic Count:  9
  • Topics Per Day:  0.00
  • Content Count:  18
  • Reputation:   0
  • Joined:  03/02/12
  • Last Seen:  

Hi all, can i request for an npc that can track items that are mostly sold in npc and the count of each items sold.

Link to comment
Share on other sites

3 answers to this question

Recommended Posts

  • 1

  • Group:  Forum Moderator
  • Topic Count:  93
  • Topics Per Day:  0.02
  • Content Count:  10013
  • Reputation:   2348
  • Joined:  10/28/11
  • Last Seen:  

conf\log_athena.conf

// Enable Logs? (Note 3)
...
...
// 0x00000010 - (S) Log NPC transactions (buy/sell)
...
...
enable_logs: 0x00000010

load the NPC

prontera,155,181,5	script	Sample	757,{
	.@sql$ = "SELECT `nameid`, SUM(`amount`) AS `total` FROM `picklog` WHERE `type` = 'S' AND `amount` > 0 GROUP BY `nameid` ORDER BY `total` DESC LIMIT 10";
	.@count = query_sql(.@sql$, .@nameid, .@total);
	mes "Items:";
	for (.@i = 0; .@i < .@count; .@i++)
		mes getitemname(.@nameid[.@i])+" - "+F_InsertComma(.@total[.@i]);
	close;
}

 

however there is no way telling how much NPC have earned or lost from the transaction since it's not log.

Edited by Emistry
  • Upvote 1
Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  51
  • Topics Per Day:  0.01
  • Content Count:  177
  • Reputation:   10
  • Joined:  04/02/12
  • Last Seen:  

On 8/20/2022 at 11:19 PM, Emistry said:

conf\log_athena.conf

// Enable Logs? (Note 3)
...
...
// 0x00000010 - (S) Log NPC transactions (buy/sell)
...
...
enable_logs: 0x00000010

load the NPC

prontera,155,181,5	script	Sample	757,{
	.@sql$ = "SELECT `nameid`, SUM(`amount`) AS `total` FROM `picklog` WHERE `type` = 'S' AND `amount` > 0 GROUP BY `nameid` ORDER BY `total` DESC LIMIT 10";
	.@count = query_sql(.@sql$, .@nameid, .@total);
	mes "Items:";
	for (.@i = 0; .@i < .@count; .@i++)
		mes getitemname(.@nameid[.@i])+" - "+F_InsertComma(.@total[.@i]);
	close;
}

 

however there is no way telling how much NPC have earned or lost from the transaction since it's not log.

 

How do you make this script only show the top items from the current month only?

Link to comment
Share on other sites

  • 0

  • Group:  Forum Moderator
  • Topic Count:  93
  • Topics Per Day:  0.02
  • Content Count:  10013
  • Reputation:   2348
  • Joined:  10/28/11
  • Last Seen:  

try

prontera,155,181,5	script	Sample	757,{
	.@year = gettime(DT_YEAR);
	.@month = gettime(DT_MONTH);
	.@sql$ = "SELECT `nameid`, SUM(`amount`) AS `total` FROM `picklog` WHERE `type` = 'S' AND `amount` > 0 AND MONTH(`time`) = "+.@month+" AND YEAR(`time`) = "+.@year+" GROUP BY `nameid` ORDER BY `total` DESC LIMIT 10";
	.@count = query_sql(.@sql$, .@nameid, .@total);
	mes "Items:";
	for (.@i = 0; .@i < .@count; .@i++)
		mes getitemname(.@nameid[.@i])+" - "+F_InsertComma(.@total[.@i]);
	close;
}

 

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