Results 1 to 7 of 7

Thread: CloseBank, shorten

  1. #1
    Join Date
    Mar 2007
    Posts
    4,810
    Mentioned
    3 Post(s)
    Quoted
    3 Post(s)

    Default CloseBank, shorten

    The current function:

    SCAR Code:
    function CloseBank: Boolean;
    var
      i, Timer: Integer;
    begin
      Result := False;
      if BankScreen then
      begin
        Timer := GetTimeRunning + 8000;
        repeat
          Mouse(483, 28, 10, 12, True);
          for i := 0 to 30 do
          begin
            if not BankScreen then
            begin
              Result:= True;
              Break;
            end;
            Wait(100);
          end;
          Wait(Random(100));
        until (GetTimeRunning > Timer) or Result;
      end;
    end;

    Shortened:

    SCAR Code:
    Function CloseBank : Boolean;
    Var I : Byte;
    Begin
      While ((BankScreen) And (I <= 2)) Do
      Begin
        Result := (Not (BankScreen));
        If Result Then Break;
        Mouse(483, 28, 10, 12, True);
        Wait(1200 + Random(800));
        Inc(I);
      End;
      Wait(Random(100));
    End;

    Effectively does the same thing.
    Last edited by Naum; 07-28-2009 at 12:11 AM.

  2. #2
    Join Date
    Jun 2007
    Location
    La Mirada, CA
    Posts
    2,484
    Mentioned
    1 Post(s)
    Quoted
    3 Post(s)

    Default

    Yours re-written could potentially be slower though...if bankScreen is gone it could possibly wait 1400ms. The one currently in SRL loops through with the for loop every 100ms to check if bankScreen is gone...

    not as efficient, good job though.

    "Failure is the opportunity to begin again more intelligently" (Henry Ford)


  3. #3
    Join Date
    Mar 2007
    Posts
    4,810
    Mentioned
    3 Post(s)
    Quoted
    3 Post(s)

    Default

    Quote Originally Posted by HyperSecret View Post
    Yours re-written could potentially be slower though...if bankScreen is gone it could possibly wait 1400ms. The one currently in SRL loops through with the for loop every 100ms to check if bankScreen is gone...

    not as efficient, good job though.
    Eeek, sorry my bad. that was meant to be 1200 not 2600, don't know how that happened

  4. #4
    Join Date
    May 2007
    Location
    Sydney, Australia (Faggot Region)
    Posts
    1,465
    Mentioned
    0 Post(s)
    Quoted
    11 Post(s)

    Default

    Why not post in Public SVN?


  5. #5
    Join Date
    Mar 2007
    Posts
    4,810
    Mentioned
    3 Post(s)
    Quoted
    3 Post(s)

    Default

    Quote Originally Posted by Simtoon View Post
    Why not post in Public SVN?
    Because it's a tweak, and there's also a lot going on in the Svn, SRL Random-wise. Frankly, I think it will be buried.

  6. #6
    Join Date
    May 2007
    Location
    Sydney, Australia (Faggot Region)
    Posts
    1,465
    Mentioned
    0 Post(s)
    Quoted
    11 Post(s)

    Default

    ahh ok.


  7. #7
    Join Date
    Oct 2006
    Location
    ithurtsithurtsithurtsithurts
    Posts
    2,930
    Mentioned
    7 Post(s)
    Quoted
    135 Post(s)

    Default

    I like the one we have currently better. Yours will wait a minimum of 1300 miliseconds, no matter how fast the bank screen disappears, while the current one's minimum wait is only 200 miliseconds.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •