Naike
2008-09-07 09:38:16
Number 1
{*******************************************************************************
function PickUpItems(ItemsID : TIntegerArray; UpText : TStringArray; MaxSL : Integer): Boolean;
By: N1ke!
Description: Picks up items with the right ID and String!
*******************************************************************************}
Function PickUpItems(ItemsID : TIntegerArray; UpText : TStringArray; MaxSL : Integer): Boolean;
var
GroundItems : array of TGroundItem;
i, x, y : integer;
Begin
If InvFull Then Exit;
If Not FindGroundItems(GroundItems, [ItemsID], MaxSL)then Exit;
For i:=0 to High(GroundItems)do
begin
Mouse(GroundItems[a].MS.x, GroundItems[a].MS.y, 2, 2, False);
ChooseOptionMulti([UpText]);
Result := True;
FFlag(0);
Wait(RandomRange(300, 1250));
end;
end;Itemlist can be found at http://runelocus.com/?action=itemlist
HowTo Use?
PickUpItems([3414, 1241, 2515], ['Sword', 'Arrow', 'Bones'], 5);Numbers is made up.
Note! Needs ChooseOptionMulti to work!!
ChooseOptionMulti ->
{*******************************************************************************
function ChooseOptionMulti(Text: TStringArray): Boolean;
By: Wizzup? Modifyied by N1ke!
Description: Finds Popup menu, then clicks on it.
*******************************************************************************}
function ChooseOptionMulti(Text: TStringArray): Boolean;
var
B: TBox;
TPA: TPointArray;
X, Y, I, C: Integer;
P: TPoint;
begin
Result := False;
GetClientDimensions(B.X2, B.Y2);
B.X1 := 0;
B.Y1 := 0;
FindColorsTolerance(TPA, 4674653, B.X1, B.Y1, B.X2, B.Y2, 0);
If Length(TPA) < 10 Then
Exit;
B.X2 := 0;
B.Y2 := 0;
P := TPA[0];
For I := 0 To High(TPA) - 1 Do
If TPA[I].X = TPA[I+1].X - 1 Then
Begin
If C > 5 Then
Begin
B.X1 := P.X;
B.Y1 := P.Y;
Break;
End Else
C := C + 1;
End
Else
Begin
P := TPA[I + 1];
C := 0;
End;
If I = Length(TPA) Then
Begin
WriteLn('Choose Option Menu Getting Failed');
Exit;
End;
InvertTPA(TPA);
C := 0;
P := TPA[0];
For I := 0 To High(TPA) - 1 Do
If TPA[I].X = TPA[I+1].X + 1 Then
Begin
If C > 5 Then
Begin
B.X2 := P.X;
B.Y2 := P.Y;
Break;
End Else
C := C + 1;
End Else
Begin
P := TPA[I + 1];
C := 0;
End;
If I = Length(TPA) Then
Begin
WriteLn('Choose Option Menu Getting Failed');
Exit;
End;
For i:=0 To High(Text) do
begin
If FindText(X, Y, Text[i], upchars, B.X1, B.Y1, B.X2, B.Y2) Then
Begin
Result := True;
Mouse(B.X1 + 5, y + 1, B.X2 - B.X1 - 5, 13, True);
Exit;
End;
end;
MMouse(B.X1 - 50, B.Y1 - 50, 40, B.Y2 - B.Y1);
Wait(200 + Random(100));
end;Number 2
{*******************************************************************************
Function InsideArea(Point1, Point2 : Tpoint): Boolean;
By: N1ke!
Description: Point1 = Most north west tile of the area!
Point2 = Most south east tile of the area!
Results true if your inside.
*******************************************************************************}
Function InsideArea(Point1, Point2 : Tpoint): Boolean;
Var MyPos : Tpoint;
begin
MyPos := GetMyPos;
Result := IntInBox(MyPos.X, MyPos.Y, IntToBox(Point1.X, Point1.Y, Point2.X, Point2.Y));
end;Will be more functions!
I would love if you could request something ;)