Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function RS07_DepositEverythingEx(exceptions: TIntArray): Boolean;
- {==============================================================================]
- Created: March 29th, 2013.
- Updated: March 30th, 2013.
- Contributors: Janilabo
- Explanation: Deposits everything, except slots that are in exceptions, from inventory.
- Returns true with success.
- NOTE: This function uses "Store/Deposit All" Choose Option item on each slot!
- So that means, items from exceptions might get deposited aswell (if you are using Store all for same items)
- [==============================================================================}
- var
- u: TIntArray;
- h, i, t, m, s, w, r: Integer;
- cf, b, d: Boolean;
- begin
- Result := False;
- b := RS07_BankOpen;
- if (b or RS07_DepositBoxOpen) then
- begin
- cf := RS07_ChooseOptionFailsafe;
- RS07_ChooseOptionFailsafe := False;
- if (not cf or RS07_PreventChooseOptionCollisions([RS07_InventoryBx, RS07_DepositBoxBx])) then
- begin
- TIAUnique(exceptions);
- s := GetSystemTime;
- repeat
- if not (RS07_BankOpen or RS07_DepositBoxOpen) then
- begin
- RS07_ChooseOptionFailsafe := cf;
- Exit;
- end;
- case b of
- True: u := RS07_GetUsedInventorySlots;
- False: u := RS07_GetUsedDepositBoxSlots;
- end;
- MSSL_TIARemoveEx(u, exceptions);
- h := High(u);
- Result := (h = -1);
- if not Result then
- begin
- case (h > -1) of
- True:
- begin
- i := TIAMax(u);
- SetLength(u, 0);
- t := (GetSystemTime - GetSystemTime);
- w := GetSystemTime;
- repeat
- if (not (RS07_BankOpen or RS07_DepositBoxOpen) or ((GetSystemTime - w) > 30000)) then
- begin
- RS07_ChooseOptionFailsafe := cf;
- Exit;
- end;
- case b of
- True: d := RS07_InventorySlotUsed(i);
- False: d := RS07_DepositBoxSlotUsed(i);
- end;
- if (d and ((GetSystemTime - t) > (5000 + r))) then
- case RS07_DepositEx(i, -1) of
- True:
- begin
- m := GetSystemTime;
- repeat
- if not (RS07_BankOpen or RS07_DepositBoxOpen) then
- begin
- RS07_ChooseOptionFailsafe := cf;
- Exit;
- end;
- MSSL_Wait(0);
- until (((GetSystemTime - m) > 5000) or not RS07_ChooseOptionAvailable);
- MSSL_Wait(150);
- m := GetSystemTime;
- repeat
- case b of
- True: d := RS07_InventorySlotUsed(i);
- False: d := RS07_DepositBoxSlotUsed(i);
- end;
- MSSL_Wait(0);
- until (((GetSystemTime - m) > 150) or d);
- t := GetSystemTime;
- r := Random(2500);
- end;
- False: RS07_HideChooseOption;
- end;
- if d then
- MSSL_Wait(0);
- until not d;
- end;
- False: RS07_HideChooseOption;
- end;
- if not Result then
- MSSL_Wait(0);
- end;
- until (Result or ((GetSystemTime - s) > 300000));
- end;
- RS07_ChooseOptionFailsafe := cf;
- end;
- end;
- function RS07_DepositEverything: Boolean;
- {==============================================================================]
- Created: March 29th, 2013.
- Contributors: Janilabo
- Explanation: Deposits EVERYTHING from inventory. Returns true with success.
- [==============================================================================}
- begin
- Result := RS07_DepositEverythingEx([]);
- end;
Advertisement
Add Comment
Please, Sign In to add comment