Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function RS07_EnterPlayerBankPinEx(player: RS07_TPlayer): Boolean;
- {==============================================================================]
- Created: February 25th, 2013.
- Updated: March 30th, 2013.
- Contributors: Janilabo
- Explanation: Enters bank pin by player data.
- Returns true with success (if pin screen was solved)
- NOTE: Result will be false, if pin screen isnt open at start of this function.
- [==============================================================================}
- var
- c: TPoint;
- b, w, m, t, x, o, n: Integer;
- cf, r: Boolean;
- begin
- if RS07_BankPinScreenOpen then
- begin
- m := GetSystemTime;
- t := GetSystemTime;
- cf := RS07_ChooseOptionFailsafe;
- RS07_ChooseOptionFailsafe := False;
- repeat
- if not RS07_LoggedIn then
- begin
- RS07_ChooseOptionFailsafe := cf;
- Exit;
- end;
- Result := RS07_BankOpen;
- if not Result then
- case r of
- True:
- case RS07_BankPinScreenOpen of
- True:
- begin
- o := RS07_BankPinDigitsSet;
- if (o > -1) then
- begin
- b := RS07_GetBankPinButtonID(player.bankPin[o]);
- if (b > -1) then
- begin
- c := BoxCenter(RS07_BankPinDigitButtons[b]);
- MSSL_OffsetPoint(c, RandomRange(-10, 11), RandomRange(-10, 11));
- RS07_ClickMouse(c.X, c.Y, mbLeft);
- MSSL_Wait(250);
- x := GetSystemTime;
- n := -1;
- repeat
- if not RS07_LoggedIn then
- begin
- RS07_ChooseOptionFailsafe := cf;
- Exit;
- end;
- Result := RS07_BankOpen;
- if not Result then
- case ((GetSystemTime - x) > 400) of
- True: n := RS07_BankPinDigitsSet;
- False: MSSL_Wait(0);
- end;
- until (Result or ((GetSystemTime - x) > 10000) or ((n > -1) and (o <> n)));
- if (not Result and (RS07_BankPinDigitsSet = 0)) then
- begin
- Inc(w);
- MSSL_Wait(2000);
- end;
- end;
- end;
- m := GetSystemTime;
- end;
- False:
- if ((GetSystemTime - m) > 10000) then
- begin
- RS07_ChooseOptionFailsafe := cf;
- Exit;
- end;
- end;
- False: r := (not cf or RS07_PreventChooseOptionCollisions(RS07_BankPinDigitButtons));
- end;
- if not Result then
- MSSL_Wait(0);
- until (Result or ((GetSystemTime - t) > 120000) or (w > 5));
- RS07_ChooseOptionFailsafe := cf;
- end;
- end;
Advertisement
Add Comment
Please, Sign In to add comment