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