Jump to content
  • 0

Top 10 Items sold tracker


Question

3 answers to this question

Recommended Posts

  • 1
Posted (edited)

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
  • 0
Posted
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?

  • 0
Posted

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

 

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