marpis
2009-07-13 22:13:29
modified from lordsaturns R_DropAllExcept
// New R_DropAllExcept:
procedure R_DropAllExcept(ExceptionIDs: TIntegerArray);
begin
R_ClickAllItemsExcept(ExceptionIDs, 'rop', [500, 750]);
end;
// New R_DepositAllExcept:
procedure R_DepositAllExcept(ExceptionIDs: TIntegerArray);
begin
R_ClickAllItemsExcept(ExceptionIDs, 'sit-all', [500, 750]);
end;
procedure R_ClickAllItemsExcept(ExceptionIDs: TIntegerArray; option: string; WaitTime: TintegerArray);
var
Inv, itemID, w, i: integer;
b: tbox;
begin
if not r_loggedin then exit;
Inv := GetInterface(149, 0);
for i := 0 to 27 do
begin
itemID := SmartGetFieldArrayInt(Inv, InventoryItemIDs, i);
if (itemID > 0) and (not(InIntArrayEx(ExceptionIDs, w, itemID))) then
begin
b := invbox(i+1);
Mouse(b.x1 + ((b.x2 - b.x1)/2), b.y1 + ((b.y2 - b.y1)/2), 5, 5, false);
Wait(150+Random(50));
R_ChooseOption(option);
Wait(RandomRange(WaitTime[0], WaitTime[1]));
end;
end;
SmartFreeObject(Inv);
end;