friomixx Posted July 31, 2022 Posted July 31, 2022 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. Quote
1 Emistry Posted August 20, 2022 Posted August 20, 2022 (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 August 20, 2022 by Emistry 1 Quote
0 Bisuke Posted August 24, 2022 Posted August 24, 2022 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? Quote
0 Emistry Posted January 30, 2023 Posted January 30, 2023 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; } Quote
Question
friomixx
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.
3 answers to this question
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.