Janilabo

Untitled

Mar 30th, 2013
63
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pascal 2.97 KB | None | 0 0
  1. function RS07_EnterPlayerBankPinEx(player: RS07_TPlayer): Boolean;
  2. {==============================================================================]  
  3.   Created: February 25th, 2013.
  4.   Updated: March 30th, 2013.
  5.   Contributors: Janilabo
  6.   Explanation: Enters bank pin by player data.
  7.                Returns true with success (if pin screen was solved)
  8.   NOTE: Result will be false, if pin screen isnt open at start of this function.        
  9. [==============================================================================}
  10. var
  11.   c: TPoint;
  12.   b, w, m, t, x, o, n: Integer;
  13.   cf, r: Boolean;
  14. begin
  15.   if RS07_BankPinScreenOpen then
  16.   begin  
  17.     m := GetSystemTime;
  18.     t := GetSystemTime;
  19.     cf := RS07_ChooseOptionFailsafe;
  20.     RS07_ChooseOptionFailsafe := False;
  21.     repeat
  22.       if not RS07_LoggedIn then
  23.       begin  
  24.         RS07_ChooseOptionFailsafe := cf;
  25.         Exit;
  26.       end;            
  27.       Result := RS07_BankOpen;
  28.       if not Result then
  29.       case r of
  30.         True:
  31.         case RS07_BankPinScreenOpen of
  32.           True:
  33.           begin  
  34.             o := RS07_BankPinDigitsSet;
  35.             if (o > -1) then
  36.             begin
  37.               b := RS07_GetBankPinButtonID(player.bankPin[o]);
  38.               if (b > -1) then
  39.               begin
  40.                 c := BoxCenter(RS07_BankPinDigitButtons[b]);
  41.                 MSSL_OffsetPoint(c, RandomRange(-10, 11), RandomRange(-10, 11));
  42.                 RS07_ClickMouse(c.X, c.Y, mbLeft);
  43.                 MSSL_Wait(1000);
  44.                 x := GetSystemTime;
  45.                 n := -1;
  46.                 repeat              
  47.                   if not RS07_LoggedIn then
  48.                   begin
  49.                     RS07_ChooseOptionFailsafe := cf;
  50.                     Exit;
  51.                   end;
  52.                   Result := RS07_BankOpen;
  53.                   if not Result then  
  54.                   case ((GetSystemTime - x) > 1000) of
  55.                     True: n := RS07_BankPinDigitsSet;
  56.                     False: MSSL_Wait(0);    
  57.                   end;
  58.                 until (Result or ((GetSystemTime - x) > 10000) or ((n > -1) and (o <> n)));
  59.                 if not Result then
  60.                 case (RS07_BankPinDigitsSet = 0) of
  61.                   True:
  62.                   begin
  63.                     Inc(w);
  64.                     MSSL_Wait(3000);
  65.                   end;                    
  66.                   False: MSSL_Wait(1000);
  67.                 end;
  68.               end;
  69.             end;
  70.             m := GetSystemTime;
  71.           end;
  72.           False:
  73.           if ((GetSystemTime - m) > 10000) then
  74.           begin
  75.             RS07_ChooseOptionFailsafe := cf;
  76.             Exit;
  77.           end;          
  78.         end;
  79.         False: r := (not cf or RS07_PreventChooseOptionCollisions(RS07_BankPinDigitButtons));
  80.       end;  
  81.       if not Result then
  82.         MSSL_Wait(0);
  83.     until (Result or ((GetSystemTime - t) > 120000) or (w > 5));
  84.     RS07_ChooseOptionFailsafe := cf;
  85.   end;
  86. end;
Advertisement
Add Comment
Please, Sign In to add comment