viewing paste Unknown #475 | Plain text

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
setarray .@item_req, 671,1,672,1;       // Item Required ( <item_id>,<amount>... )
setarray .@item_list, 1234,4321,1234,4321;      // Item List
 
for ( set .@i, 0; .@i < getarraysize(.@item_list); set .@i, .@i + 1 )
        set .@menu$, .@menu$ + (.@i?": ":"") + getitemname(.@item_list[.@i]);
 
mes "Possible Items";
set .@j, select ( .@menu$ ) - 1;
 
for ( set .@i, 0; .@i < getarraysize(.@item_req); set .@i, .@i + 2 )
{
        if ( countitem(.@item_req[.@j]) < .@item_req[.@j + 1] )
                set .@fail, 1;
}
 
if ( .@fail )
{      
        mes "Infsufficient materials.";
        close;
}
 
for ( set .@i, 0; .@i < getarraysize(.@item_req); set .@i, .@i + 2 )
        delitem .@item_req[.@i], .@item_req[.@i + 1];
       
getitem .@item_list[.@j], 1;
Viewed 407 times, submitted by Joseph.