Results 1 to 5 of 5

Thread: Bank.scar WithdrawEx

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

    Default Bank.scar WithdrawEx

    When WithdrawEx is used in conjunction with WithdrawItemEx the mouse will hover the IdentType (BMP, DTM, Mask, Colour) to check for the correct UpText, then move the mouse again to withdraw Amount.

    Nothing big, but I'm sure most of you don't consistently hover your item then move the mouse again to withdraw it.

    WithdrawEx:

    Code:
      BBox := BankIndexToMSBox(BankPointToBankIndex(Point(Col, Row)));
      MouseBox(BBox.X1 + 5, BBox.Y1 + 5, BBox.X2 - 5, BBox.Y2 - 5, 3);
    becomes:

    Code:
    var
      BBox: TBox;
      x, y: Integer;
    
      ...
    
      BBox := BankIndexToMSBox(BankPointToBankIndex(Point(Col, Row)));
      GetMousePos(x, y);
      if not InRange(x, BBox.X1, BBox.X2) and not InRange(y, BBox.Y1, BBox.Y2) then
        MouseBox(BBox.X1 + 5, BBox.Y1 + 5, BBox.X2 - 5, BBox.Y2 - 5, 3);
    Last edited by EvilChicken!; 08-08-2010 at 02:10 AM.

  2. #2
    Join Date
    Nov 2009
    Location
    Seattle, WA
    Posts
    589
    Mentioned
    0 Post(s)
    Quoted
    1 Post(s)

    Default

    Thanks for suggesting that. I just tested the old function as well as the fixed function. The fixed one works the way its supposed to (with no extra mouse movements after checking the uptext). Please commit lol =]
    Don't Troll, Don't Fight, Just keep the Respect
    Status : Offline

    Feel free to re-make my scripts ;D
    Community Member

  3. #3
    Join Date
    Jul 2007
    Location
    Norway.
    Posts
    1,938
    Mentioned
    3 Post(s)
    Quoted
    0 Post(s)

    Default

    I obviously forgot to commit this ..
    Anyway, added and additionally fixed and streamlined the function a bit.
    Thanks!

    This is the version I committed:
    SCAR Code:
    {*******************************************************************************
    function WithdrawEx(col, row, Amount: Integer; Uptexts: TStringArray): Boolean;
    By: Starblaster100, Town, Wizzup? and Narcle, small fixes by r!ch!e & EvilChicken!
    Description: Withdraws Amount at Column/Row.
    *******************************************************************************}

    function WithdrawEx(Col, Row, Amount: Integer; Uptexts: TStringArray): Boolean;
    var
      BBox: TBox;
      X, Y: Integer;
    begin
      Result := False;
      FixBank;
      FixBankTab;

      BBox := BankIndexToMSBox(BankPointToBankIndex(Point(Col, Row)));
      GetMousePos(X, Y);
      if (not PointInBox(Point(X, Y), BBox)) then
        MouseBox(BBox.X1 + 5, BBox.Y1 + 5, BBox.X2 - 5, BBox.Y2 - 5, 3);

      if (Length(Uptexts) > 0) then
        if (not WaitUptextMulti(Uptexts, 500)) then
          Exit;

      ClickMouse2(Amount = 1);
      if (Amount = 1) then
      begin
        Result := True;
        Wait(RandomRange(250, 550));
        Exit;
      end;

      case (Amount) of
        0:     Result := WaitOptionMulti(['Withdraw-All', 'w-A'], 300);
        5, 10: Result := WaitOptionMulti(['Withdraw-' + IntToStr(Amount), 'w-' + IntToStr(Amount)] , 300);
      else
        Result := WaitOptionMulti(['Withdraw-X', 'w-X'], 300);
      end;

      if (Result) and (not InIntArray([0, 1, 5, 10], Amount)) then
      begin
        Wait(RandomRange(500, 1250));
        TypeSend(IntToStr(Amount));
      end;
    end;

    Rep+'d for your recent contribution, R!ch!e.
    Last edited by EvilChicken!; 08-08-2010 at 02:02 AM.

  4. #4
    Join Date
    Nov 2009
    Location
    Seattle, WA
    Posts
    589
    Mentioned
    0 Post(s)
    Quoted
    1 Post(s)

    Default

    Thanks for committing EC =]
    Don't Troll, Don't Fight, Just keep the Respect
    Status : Offline

    Feel free to re-make my scripts ;D
    Community Member

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

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
  •