Hi guys wanted to learn how to use array since I'm always using variables and it would take me some time to list everything there.
I wanted to use an array for my Quests and I wanted to use 2 set of array 1 for the Items needed and 1 for it's Quantity.
as you can see below I wanted them to countitem first then if it's true they will be deleted. else end;
example:
setarray .@ItemReq[0], 501, 502, 503, 504;
setarray .@ItemQty[0], 5, 10, 15, 20;
if(countitem(.@ItemReq[0]) >= .@ItemQty[0] || (.@ItemReq[1]) >= .@ItemQty[1] || (.@ItemReq[2]) >= .@ItemQty[2] || (.@ItemReq[3]) >= .@ItemQty[3] ) {
delitem .@ItemReq[0],.@ItemQty[0];
delitem .@ItemReq[1],.@ItemQty[1];
delitem .@ItemReq[2],.@ItemQty[2];
delitem .@ItemReq[3],.@ItemQty[3];
mes "Deleted all items .";
close;
} else { end; }
I'm really new to scripting and arrays.
appreciate any help you would mention
anyone can help me make it work and much easier?