Results 1 to 14 of 14

Thread: Change to CloseBank.

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

    Default Change to CloseBank.

    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;

    Could be changed to:

    SCAR Code:
    Function CloseBank : Boolean;
    Begin
      Result := (Not (BankScreen));
      If Result Then Exit Else
      Mouse(483, 28, 10, 12, True);
      Wait(500 + Random(300));
      Result := (Not (BankScreen));
    End;

    I'm pretty sure Text.scar is called before Bank.Scar in SRL.Scar.
    Last edited by Naum; 06-07-2009 at 08:43 PM.

  2. #2
    Join Date
    Mar 2007
    Location
    <3
    Posts
    2,683
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Once again, nice find.
    Don't see how this could be bad.

    Support

  3. #3
    Join Date
    May 2007
    Location
    UK
    Posts
    4,007
    Mentioned
    1 Post(s)
    Quoted
    12 Post(s)

    Default

    Same as above
    Support
    T~M

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

    Default

    Thanks everyone .

  5. #5
    Join Date
    Jan 2008
    Location
    California, US
    Posts
    2,765
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    There is no point then. Just do CloseWindow;...

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

    Default

    No this point is in the name, most people are suited to CloseBank rather than CloseWindow.

  7. #7
    Join Date
    Jan 2007
    Posts
    8,876
    Mentioned
    123 Post(s)
    Quoted
    327 Post(s)

    Default

    Quote Originally Posted by NaumanAkhlaQ View Post
    No this point is in the name, most people are suited to CloseBank rather than CloseWindow.
    + it would break ALOT of scripts xP

  8. #8
    Join Date
    Apr 2007
    Location
    Perth, Australia
    Posts
    3,926
    Mentioned
    3 Post(s)
    Quoted
    2 Post(s)

    Default

    CloseWindows USES CloseBank.. Nava said CloseWindow didn't work with the bank for some reason.

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

    Default

    Zephy It does, he fixed it

    I've tested it as well . It used to get mixed up with the question mark box, but then Nava used a SortATPA to fix it.

  10. #10
    Join Date
    Jan 2008
    Location
    Ontario, Canada
    Posts
    7,805
    Mentioned
    5 Post(s)
    Quoted
    3 Post(s)

    Default

    No, it still messes up.

    It's easier to leave this. I might just get all the lengths since they appear to be constant.
    Writing an SRL Member Application | [Updated] Pascal Scripting Statements
    My GitHub

    Progress Report:
    13:46 <@BenLand100> <SourceCode> @BenLand100: what you have just said shows you 
                        have serious physchological problems
    13:46 <@BenLand100> HE GETS IT!
    13:46 <@BenLand100> HE FINALLY GETS IT!!!!1

  11. #11
    Join Date
    Apr 2007
    Location
    Perth, Australia
    Posts
    3,926
    Mentioned
    3 Post(s)
    Quoted
    2 Post(s)

    Default

    Quote Originally Posted by NaumanAkhlaQ View Post
    Zephy It does, he fixed it

    I've tested it as well . It used to get mixed up with the question mark box, but then Nava used a SortATPA to fix it.
    SCAR Code:
    function CloseWindow: Boolean;
    var
      Col: TIntegerArray;
      b: T2DPointArray;
      a: T2DPointArray;
      Pa: TBox;
      I, ii, h, l: Integer;
    begin
      Result := CloseBank; //Eh??
      Col := [1118997,  1449250,  {Main typ 1}
              8042720,  4160933,  {Skill}
              6854059,  2902100,  {Quest}
              4282212, 2503226,  {Main typ 2}
              39423,    13567,    {Red X}
              1514271,  1580837,  {Deposit Box}
              2106925,  1250584];
      SetLength(b, 2);
      for I := 0 to 6 do
      begin
        FindColors(b[0], Col[i*2], MSCX, MSY1, MSX2, MSCY);
        FindColors(b[1], Col[i*2+1], MSCX, MSY1, MSX2, MSCY);
        l := (High(b[0]) + High(b[1]));
        //Writeln(IntToStr(i) + ' Col1: ' + IntToStr(High(b[0])) + ' Col2: ' + IntToStr(High(b[1])) + ' T: ' + IntToStr(l));
        if InRange(l, 6, 53) or InRange(l, 94, 250) then
        begin
          a := SplitTPA(CombineTPA(b[0], b[1]), 5);
          SortATPAFromFirstPoint(a, Point(385, 100));
          //DebugATPA(a, '');
          for ii := 0 to h do
          begin
            Pa := GetTPABounds(a[ii]);
            if ((Pa.x2 - Pa.x1) > 50) or ((Pa.y2 - Pa.y1) > 50) then Continue;
            MMouse(RandomRange(Pa.x1, Pa.x2), RandomRange(Pa.y1, Pa.y2), 0, 0);
            Wait(100 + Random(50));
            if rs_GetUpText = 'Close' then
            begin
              GetMousePos(Pa.x1, Pa.y1);
              Mouse(Pa.x1, Pa.y1, 0, 0, True);
              Result := True;
              Writeln('Close Window Type ' + IntToStr(i));
              Exit;
            end;
          end;
        end;
      end;
    end;

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

    Default

    Ahh crap, my bad, guess I didn't see that line

    Edited FirstPost

  13. #13
    Join Date
    Aug 2008
    Location
    Finland
    Posts
    2,851
    Mentioned
    3 Post(s)
    Quoted
    2 Post(s)

    Default

    how hard can it be, clicking 'x' which is always in the same place?
    edit: i mean the current CloseBank. why did that monster appear in SRL in the first place ^^

  14. #14
    Join Date
    Dec 2007
    Location
    192.168.1.73
    Posts
    2,439
    Mentioned
    6 Post(s)
    Quoted
    119 Post(s)

    Default

    Quote Originally Posted by marpis View Post
    how hard can it be, clicking 'x' which is always in the same place?
    edit: i mean the current CloseBank. why did that monster appear in SRL in the first place ^^
    The old one checked whether it was at the BankScreen before and after, meaning it can result if it fails. Although its only really going to fail if there's lag.

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
  •