SRL Archive - Reflection Development

procedure R_ClickAllItemsExcept();


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;

mormonman

2009-07-13 22:47:12

There already is a R_DepositAllItemsExcept I think… or maybe I never committed it. Nice work :P

marpis

2009-07-13 23:51:33

From: mormonman
There already is a R_DepositAllItemsExcept I think… or maybe I never committed it. Nice work :P


there's also R_DropAllExcept but i think it's stupid to make several of these AllExcept-functions, when they can all be combined in one, simple function.