Nope it wasn't about the kName, I thought that query_sql would delete all the values of the array but that's not the case. The compiled menu held the previous data if the new array had less data than the previous array
prontera,157,179,0 script Sample 75,{
if ( Zeny < 500000 ) {
mes "You don't have 500,000 zeny";
close;
}
mes "What monster would you like to disguise?";
next;
L_back:
.@s = select( .alphabet_menu$ ) -1;
.@mob = select( getd( ".letter_"+ .@s +"$" ) ) -2;
if ( .@mob == -1 ) goto L_back;
disguise getd( ".mobid_"+ .@s +"["+ .@mob +"]" );
close2;
Zeny -= 500000;
end;
OnInit:
.@count = query_sql( "select distinct left( kName,1 ) as a from mob_db order by a", .@alphabet$ );
.alphabet_menu$ = implode( .@alphabet$, ":" );
for ( .@i = 0; .@i < .@count; .@i++ ) {
.@string$ = ".mobid_"+ .@i;
.@size = query_sql( "select kName,`ID` from mob_db where left( kName,1 ) = '"+ .@alphabet$[.@i] +"' group by kName asc limit 128", .@tmp$, getd( .@string$ ) );
setd ".letter_"+ .@i +"$", ( .@i ? "^777777Back^000000:" : ":" ) + implode( .@tmp$, ":" );
deletearray .@tmp$, .@size;
// debugmes "check len "+ .@alphabet$[.@i] +" : "+ getarraysize( getd( .@string$ ) );
}
}