viewing paste Server Item Count | Athena

Posted on the
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31
 
 
prontera,155,181,5  script  Sample  757,{
 
mes "Input Item ID";
do{
    input .@itemid,0,32767;
    if( !.@itemid ) close;
}while( getitemname( .@itemid ) == "null" );
for( .@i = 0; .@i < .sql_table_size; .@i++ ){
    query_sql( "SELECT COUNT( `nameid` ) FROM `"+.sql_table$[.@i]+"` WHERE `nameid` = "+.@itemid,.@count );
    query_sql( "SELECT COUNT( `nameid` ) FROM `"+.sql_table$[.@i]+"` WHERE `card0` = "+.@itemid,.@count1 );
    query_sql( "SELECT COUNT( `nameid` ) FROM `"+.sql_table$[.@i]+"` WHERE `card1` = "+.@itemid,.@count2 );
    query_sql( "SELECT COUNT( `nameid` ) FROM `"+.sql_table$[.@i]+"` WHERE `card2` = "+.@itemid,.@count3 );
    query_sql( "SELECT COUNT( `nameid` ) FROM `"+.sql_table$[.@i]+"` WHERE `card3` = "+.@itemid,.@count4 );
    .@total_count += ( .@count + .@count1 + .@count2 + .@count3 + .@count4 );
}
mes "Found "+.@total_count+" x "+getitemname( .@itemid );
close;
 
OnInit:
setarray .sql_table$,
    "auction",
    "cart_inventory",
    "guild_storage",
    "inventory",
    "mail",
    "storage";
.sql_table_size = getarraysize( .sql_table$ );
end;
}
Viewed 1788 times, submitted by Emistry.