function IntInArrEx(var index: integer; iarr: TIntegerArray; int: Integer): boolean;
var
I: Integer;
begin
For I:=0 to High(iarr)do
if iarr[I] = int then
begin
Result := True;
Index := I;
Exit;
end;
end;
function FindExtras: boolean;
var
Items: TGroundItemArray;
IDs: TIntegerArray;
ExName: TStringArray;
MP: TPoint;
I, L, H: Integer;
begin
If (Not LoggedIn)then
Exit;
Items := R_GetGroundItemsDistance(30);
H := High(Items);
If H = -1 then
Exit;
IDs := [561, 563, 9142];
ExName := ['Take Nature rune', 'Take Law rune', 'Take Mithril bolt'];
For I:=0 to High(Items)do
If IntInArrEx(L, IDs, Items[I].ID) then
begin
If (r_InvFull)then
Exit;
If Not r_TileOnMS(Items[I].Tile)then
Continue;
// First check if uptext is correct
If R_IsUpText(ExName[L])then
begin
CMHere(True);
WaitPickUp(Items[I].Tile);
Result := True;
Continue;
end;
MP := r_TileToMS(Items[I].Tile);
MMouse(MP.X, MP.Y, 5, 5);
If R_WaitUpText(ExName[L], 200+Random(200))then
begin
CMHere(True);
WaitPickUp(Items[I].Tile);
Result := True;
Continue;
end else
begin
Writeln('Hard time finding item');
If r_IsUpText('Walk here')then
Exit;
CMHere(False);
Result := r_WaitChooseOption(ExName[L], 200+Random(200));
WaitPickUp(Items[I].Tile);
end;
end;
end;
That's my function from my druidkiller.. Read the code, if you don't understand one/or any part of it, just post :)