prontera,150,186,5 script 1st generation 100,{ setarray $@haha, 100,200,300,400; set @i, 0; goto L_loop; L_loop: if ( $@haha[@i] == 300 ) goto L_result; set @i, @i +1; goto L_loop; L_result: dispbottom "i is "+ @i; end; } prontera,153,186,5 script 2nd & 3rd generation 100,{ setarray .@haha, 100,200,300,400; for ( set .@i, 0; .@i < getarraysize(.@haha); set .@i, .@i +1 ) { if ( .@haha[.@i] == 300 ) break; } dispbottom "i is "+ .@i; end; } prontera,156,186,5 script 4th generation 100,{ while ( .haha[.@i] != 300 && .@i < .haha_size ) .@i++; dispbottom "i is "+ .@i; end; OnInit: setarray .haha, 100,200,300,400; .haha_size = getarraysize(.haha); end; }