the reason why I do not immediately answer your question because you are asking a high level scripting question
I experienced in the past when I misunderstood topic starter, and I posted a very complicated script, they just stop giving any feedback ... makes me feel my effort wasted
what you need to learn is Fisher-Yates shuffle
Haru and me perfected the script and it is currently inside Hercules
here's an example
poring_w01,100,100,5 script dfdsfsadfsdf 1_F_MARIA,{
// here we declare some array
setarray .@tmp, 123,234,345,456,567,678,789;
.@size = getarraysize( .@tmp );
// just to output the original array
.@string$ = .@tmp[0] +"";
for ( .@i = 1; .@i < .@size; ++.@i )
.@string$ += ","+ .@tmp[.@i];
dispbottom "original = "+ .@string$;
// randomize the array ~
callfunc "F_ShuffleNumbers", 0, .@size -1, .@r;
for ( .@i = 0; .@i < .@size; ++.@i )
.@tmp2[.@i] = .@tmp[ .@r[.@i] ];
// output the result ~
.@string$ = .@tmp2[0] +"";
for ( .@i = 1; .@i < .@size; ++.@i )
.@string$ += ","+ .@tmp2[.@i];
dispbottom "shuffle = "+ .@string$;
end;
}
EDIT : PS: if you wanna learn sorting algorithm script I can always show off a little bit