Results 1 to 9 of 9

Thread: Seeking help from the best.

  1. #1
    Join Date
    Oct 2007
    Location
    #srl
    Posts
    6,102
    Mentioned
    39 Post(s)
    Quoted
    62 Post(s)

    Default Seeking help from the best.

    Can anyone explain to me why only sometimes this function fails to wait for the bank screen to open? Also, it only happens because once every few times ChooseOption sort of pauses before it clicks. Once the bank screen is open it moves the mouse rapidly up and down in a small box towards the center of the screen.

    Any help would be very much appreciated.

    SCAR Code:
    function Bank: Boolean;
    var x, y, i, Counter: Integer; Arr: array of TPoint; ATPA: T2DPointArray; P: TPoint;
    label Start;
    begin
      if not AtBank then Exit;
      Writeln('Banking..');
      Start:
      Arr := GetColorPoints(x, y, 8424083, MSx1, MSy1, MSx2, MSy2, 1, 1, 5);
      if Length(Arr) < 5 then
      begin
        SetAngle(False);
        if Counter >= 1 then Exit;
        Inc(Counter);
        goto Start;
      end;
      atpa := TPAtoATPAEx(Arr, 1, 1);
      for i := 0 to High(atpa) do
      begin
        P := MiddleTPA(atpa[i]);
        MMouse(P.x, P.y, 5, 5);
        Wait(80 + Random(30));
        if Pos('ank booth', Rs_GetUpText) > 0 then
        begin
          GetMousePos(x, y);
          Mouse(x, y, 1, 1, False);
          Wait(80 + Random(30));
          ChooseOption('uickly');
          MarkTime(k);
          while not BankScreen do
          begin
            Wait(150);
            Writeln('Waiting for BankScreen('+IntToStr(TimeFromMark(k))+');');
            if TimeFromMark(k) > 7000 + Random(1000) then
              Break;
          end;
          Wait(1500 + Random(80));
          Result := BankScreen;
        end;
        if Result then
        begin
          Writeln('Banking successful.');
          Exit;
        end;
      end;
    end;

  2. #2
    Join Date
    Sep 2008
    Location
    Not here.
    Posts
    5,422
    Mentioned
    13 Post(s)
    Quoted
    242 Post(s)

    Default

    Use a repeat..until loop instead of a while..do. *just a suggestion*

  3. #3
    Join Date
    Feb 2007
    Location
    Alberta,Canada
    Posts
    2,358
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    what function is called after this? or have you pin-pointed the problem to this function? and the reason it goes all over the place is obviously because it breaks and doesnt set the result, simply add a if BankScreen then begin Result := True; Exit; end; at the start and im sure it will work fine.

  4. #4
    Join Date
    Feb 2007
    Posts
    3,616
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Hmm...

    The only thing I see is if the text 'ank booth' isn't up, it still does this:

    SCAR Code:
    if Result then
        begin
          Writeln('Banking successful.');
          Exit;
        end;

    There is no result yet at this point. Now I know that Result is automatically set to false, but it has caused a lot of weird problems to people before if you assume this.

    Try putting this in the while loop right after Result := BankScreen;

    Edit: It never even breaks if you are at the bank screen that's the problem.
    Last edited by JAD; 08-20-2009 at 09:30 AM.

  5. #5
    Join Date
    Oct 2006
    Posts
    500
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    This is when it opens the bank right,
    Code:
    ChooseOption('uickly'); //Occasional delay?
          Wait(1000); //Wait 1 second [or less] to counteract delay.
          MarkTime(k);
          while not BankScreen do
          begin
            Wait(150);
            Writeln('Waiting for BankScreen('+IntToStr(TimeFromMark(k))+');');
            if TimeFromMark(k) > 7000 + Random(1000) then
              Break;
          end;
    You could try adding a small wait after ChooseOption to counteract the delay. See if that helps.

  6. #6
    Join Date
    Jan 2008
    Location
    NC, USA.
    Posts
    4,429
    Mentioned
    0 Post(s)
    Quoted
    4 Post(s)

    Default

    Wait(1500 + Random(80));
    Result := BankScreen;

    Add a Break; after that
    Quote Originally Posted by irc
    [00:55:29] < Guest3097> I lol at how BenLand100 has become noidea
    [01:07:40] <@BenLand100> i'm not noidea i'm
    [01:07:44] -!- BenLand100 is now known as BenLand42-
    [01:07:46] <@BenLand42-> shit
    [01:07:49] -!- BenLand42- is now known as BenLand420
    [01:07:50] <@BenLand420> YEA

  7. #7
    Join Date
    Feb 2007
    Location
    Alberta,Canada
    Posts
    2,358
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by JAD View Post
    Hmm...

    The only thing I see is if the text 'ank booth' isn't up, it still does this:

    SCAR Code:
    if Result then
        begin
          Writeln('Banking successful.');
          Exit;
        end;

    There is no result yet at this point. Now I know that Result is automatically set to false, but it has caused a lot of weird problems to people before if you assume this.

    Try putting this in the while loop right after Result := BankScreen;
    he sets the result via the bankscreen in the above for..do loop.

  8. #8
    Join Date
    Feb 2007
    Posts
    3,616
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by Blumblebee View Post
    he sets the result via the bankscreen in the above for..do loop.
    But it will only do that if the text 'ank booth' was up though.

    I found the problem and edited the post above, but noidea beat me.

  9. #9
    Join Date
    Oct 2007
    Location
    #srl
    Posts
    6,102
    Mentioned
    39 Post(s)
    Quoted
    62 Post(s)

    Default

    Thank you guys but I actually just solved it by making my own BankScreen function.

    For some reason, alot of srl functions don't work for me right now

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
  •