blackfire553
2011-06-23 17:22:23
Im trying to pick up certain ground items, and this is what im doing:
It only picks up bones, but im sure im doing the capetalization right. Is there a better way to do this? How do i sort the array of ground items?
Players[0].Arrays[0] := ['Iron arrow','Bronze arrow','Tin ore','Copper ore','Rune','Coins','Bones'];
end;
procedure PickUpGroundItems;
var
ItemsOnGround : TGroundItemArray;
ItemPoint : TPoint;
i,j: integer;
begin
if not (LoggedIn) then
Exit;
ItemsOnGround := GetItemsNear(Players[CurrentPlayer].Integers[0]);
For i := 0 to high(ItemsOnGround) do
begin
if R_InvFull then
Exit;
ItemPoint := TileToMS(ItemsOnGround[i].Tile,0);
if (ItemPoint.x > 0) then
begin
Mouse(ItemPoint.x-3,ItemPoint.Y-3,0,0,false);
for j := 0 to high(Players[0].Arrays[0]) do
begin
writeln('Take ' + Players[0].Arrays[0][j]);
if ChooseOption('Take ' + Players[0].Arrays[0][j]) then
begin
//stats_IncVariable('Bones (Collected)',1);
writeln('Pickin shit up...');
wait(2500);
end;
end;
end;
end;
end;It only picks up bones, but im sure im doing the capetalization right. Is there a better way to do this? How do i sort the array of ground items?