weezy
2010-11-26 16:35:57
Will deposit items that have the said ID.
Have not tested this function yet but it should work.
EDIT: Here is my movebox function, sorry, I'm sure SRL has an equivalent, I made it so it uses the random(random()) method a few people have mentioned before for realism.
I have now tested the function and it works perfectly as far as I know.
Have not tested this function yet but it should work.
function DepositItem(id,amount:integer):boolean;
var item:TInvItem;
begin
if not R_BankScreen then exit;
result := false;
if R_ItemIDExists(item, id) then
result := true;
if result then
begin
result := false;
MoveBox(InvBox(item.slot));
ClickMouse2(amount = 1);
if (amount = 1) then
begin
result := true;
Wait(RandomRange(250, 550));
Exit;
end;
if (Amount = 0) then
Result := WaitOptionMulti(['Deposit-All', 'd-A'], 300)
else
Result := WaitOptionMulti(['Deposit-' + IntToStr(Amount), 'd-' + IntToStr(Amount)] , 300);
if (not (Result)) and (Amount > 0) then
begin
if WaitOptionMulti(['Deposit-X', 'd-X'], 500) then
begin
X := GetSystemTime + 10000;
while (X >= GetSystemTime) and (not (InRange(CountColor(0, 250, 396, 307, 410), 155, 165))) do
Wait(50);
Wait(RandomRange(75, 400));
TypeSend(IntToStr(Amount));
Result := True;
end;
end;
end;
end; EDIT: Here is my movebox function, sorry, I'm sure SRL has an equivalent, I made it so it uses the random(random()) method a few people have mentioned before for realism.
procedure MoveBox(box:TBox);
var x,y:integer;
begin
x := (box.x2 - box.x1)/2;
y := (box.y2 - box.y1)/2;
MMouse(box.x1 + x + Random(RandomRange(-x,x)), box.y1 + y + Random(RandomRange(-y,y)), 0, 0);
end; I have now tested the function and it works perfectly as far as I know.