ZaSz
2009-06-27 06:13:37
{*******************************************************************************
Function R_RandomMouseId(Id:integer; Option:string):boolean;
By: Zasz
Description: Clicks an Item by its I.D. But at a Random Spot in Inventory.
*******************************************************************************}
Function R_RandomMouseId(Id:integer; Option:string):boolean;
var
Invs, D, TempCounter, TempInt: integer;
ItemsID:Integer;
B:TBox;
TempX,TempY:integer;
InvSpot : tintegerarray;
begin
TempCounter := 0;
Invs := GetInterface(149, 0);
For TempInt:= 0 To 27 Do
begin
ItemsID := SmartGetFieldArrayInt(Invs, InventoryItemIDs, TempInt);
If(ItemsId = Id)Then
begin
Inc(TempCounter);
SetLength(InvSpot ,TempCounter);
InvSpot [TempCounter-1] := TempInt;
end;
end;
SmartFreeObject(Invs);
If(Length(InvSpot )>0)then
begin
TempInt:= Random(High(InvSpot));
B := InvBox(TempInt+ 1);
MMouse(B.x1+20-Random(5), B.y1+25-Random(5), 4, 4);
Wait(500+ Random(500));
GetMousePos(TempX, TempY);
Mouse(TempX, TempY, 0, 0, false);
Result := R_ChooseOption(Option);
end else
Result := false;
end;I find it really useful as im also putting it as my food clicker in my fighter. It Just clicks a item by its id at a random inventory slot.