Results 1 to 16 of 16

Thread: WithDrawBankS (WithDrawBankSearch)

  1. #1
    Join Date
    Nov 2011
    Posts
    1,589
    Mentioned
    9 Post(s)
    Quoted
    17 Post(s)

    Post WithDrawBankS (WithDrawBankSearch)

    e:Slight Change added separate upText.
    This Function is used to search for items and return to the original Bank tab after and returns true, if it finds it.
    Thanks to Mike (Main) for giving me the idea <3
    Simba Code:
    Function WithDrawBankS(s,uT:String):boolean;
    var
      bT:integer;
    begin
      if(not bankScreen)then
        Exit;
      bT := currentBankTab;
      searchBank(s);
      MouseBankSlot(1,2);
      if(waitUptext(uT,800))then
      begin
        clickMouse2(true);
        result := true;
      end;
      bankTab(bT);
    end;

    Mat



    ^^

  2. #2
    Join Date
    Dec 2011
    Location
    Berlin
    Posts
    795
    Mentioned
    0 Post(s)
    Quoted
    5 Post(s)

    Default

    I like the idea. Thats clever
    Never came to it on my own. Good job.

    I will try to answer all Runescape related questions!

  3. #3
    Join Date
    Dec 2006
    Location
    Sydney, New South Wales, Australia
    Posts
    4,603
    Mentioned
    15 Post(s)
    Quoted
    42 Post(s)

    Default

    Intrinsic documentation please!
    You may contact me with any concerns you have.
    Are you a victim of harassment? Please notify me or any other staff member.

    | SRL Community Rules | SRL Live Help & Chat | Setting up Simba | F.A.Q's |

  4. #4
    Join Date
    Jan 2008
    Location
    C:\
    Posts
    1,483
    Mentioned
    2 Post(s)
    Quoted
    2 Post(s)

    Default

    Slight suggestion for ya, just in case multiple items come up in the search:

    Simba Code:
    function ExistsBankItem(Slot: Integer): Boolean;
    var
      x, y: Integer;
      sBox: TBox;
    begin
      if not BankScreen then
        Exit;
      sBox := BankIndexToMSBox(Slot);
      Result := FindColor(x, y, srl_outline_black, sBox.x1, sBox.y1, sBox.x2, sBox.y2);
    end;

    function WithdrawBankSearch(Search, Uptext: String): Boolean;
    var
      Tab, i: Integer;
    begin
      if not BankScreen then
        Exit;
      Result := False;
      Tab := CurrentBankTab;
      SearchBank(Search);
      for i := 1 to 40 do
      begin
        if not ExistsBankItem(i) then
          Break;
        MouseBankSlot(i, mouse_move);
        if WaitUptext(Uptext, 500) then
        begin
          ClickMouse2(mouse_left);
          Result := True;
          Break;
        end;
      end;
      BankTab(Tab);
    end;

    PS. Sorry for editing all of your stuff, me = ocd about that kind of thing >.<
    Last edited by Runaway; 07-07-2012 at 04:08 PM.

  5. #5
    Join Date
    Nov 2011
    Posts
    1,589
    Mentioned
    9 Post(s)
    Quoted
    17 Post(s)

    Default

    Run why the for loop? The idea is you search for a specific item, with a specific name.
    So is there a need to for loop?
    Mat
    e:If i searched Cannon base I don't expect more that 1 item to show, if you show, Pure Ess you'd only find pure ess, 1 Items.



    ^^

  6. #6
    Join Date
    Jan 2008
    Location
    C:\
    Posts
    1,483
    Mentioned
    2 Post(s)
    Quoted
    2 Post(s)

    Default

    Quote Originally Posted by Mat View Post
    Run why the for loop? The idea is you search for a specific item, with a specific name.
    So is there a need to for loop?
    Mat
    e:If i searched Cannon base I don't expect more that 1 item to show, if you show, Pure Ess you'd only find pure ess, 1 Items.
    Well yes, I understand. But you never know what people would want to use this for. Mine as well include it, right? If there is only 1 item then it won't decrease speed, but it still allows for more

  7. #7
    Join Date
    Nov 2011
    Posts
    1,589
    Mentioned
    9 Post(s)
    Quoted
    17 Post(s)

    Default

    But doesn't that Bonus on all the items that it find? Which is bot like?



    ^^

  8. #8
    Join Date
    Jan 2008
    Location
    C:\
    Posts
    1,483
    Mentioned
    2 Post(s)
    Quoted
    2 Post(s)

    Default

    Quote Originally Posted by Mat View Post
    But doesn't that Bonus on all the items that it find? Which is bot like?
    Eh not for just a few items. Anyways, I check the uptext of bank items all the time when I'm playing legit! Just a suggestion though, man. Static coordinates with dynamic input screams "failsafe me!"

  9. #9
    Join Date
    Nov 2011
    Posts
    1,589
    Mentioned
    9 Post(s)
    Quoted
    17 Post(s)

    Default

    I'll give it you on that, but I still see no point, but thats just me , I see the point on Item not exist, thats good and useful , but the for loop? Meh
    Mat



    ^^

  10. #10
    Join Date
    Dec 2011
    Location
    Toronto, Ontario
    Posts
    6,424
    Mentioned
    84 Post(s)
    Quoted
    863 Post(s)

    Default

    What about Rune Kiteshield? And the person has a Rune kiteshield (t) or Rune Kiteshield (h5).
    It all depends on where the item is

  11. #11
    Join Date
    Nov 2011
    Posts
    1,589
    Mentioned
    9 Post(s)
    Quoted
    17 Post(s)

    Default

    I'll give in to that, as that is one of those things that Might happen, but if the Uptext was set to Kite it'll take the first one regardless.
    Mat



    ^^

  12. #12
    Join Date
    Jan 2008
    Location
    C:\
    Posts
    1,483
    Mentioned
    2 Post(s)
    Quoted
    2 Post(s)

    Default

    Quote Originally Posted by Mat View Post
    I'll give it you on that, but I still see no point, but thats just me , I see the point on Item not exist, thats good and useful , but the for loop? Meh
    Mat
    Well, I can only find a few ways that would make the for loop useful, but it would require a whole new function:

    Simba Code:
    function WithdrawBankSearchMulti(Search: String; Uptext: TStringArray): Boolean;
    var
      lUptext, Res, i: Integer;
    begin
      if not BankScreen then
        Exit;
      lUptext := Length(Uptext);
      SetLength(Result, lUptext);
      Result := False;
      for i := 1 to 40 do
      begin
        if not ExistsBankItem(i) then
          Break;
        MouseBankSlot(i, mouse_move);
        if WaitUptextMulti(Uptext, 500) then
        begin
          ClickMouse2(mouse_left);
          Inc(Res);
        end;
        if (Res >= lUptext) then
        begin
          Result := True;
          Break;
        end;
      end;
      BankTab(Tab);
    end;

    You used cannon as an example before; with this you could call:

    Code:
     WithdrawBankSearchMulti('cannon', ['base', 'barr', 'furn', 'stan', 'ball']);
    And it would search for cannon and withdraw those 5 pieces. Can't think of many other things this would apply to though...

  13. #13
    Join Date
    Feb 2011
    Location
    The Future.
    Posts
    5,600
    Mentioned
    396 Post(s)
    Quoted
    1598 Post(s)

    Default

    1. It would help for users reading this to understand it by just looking at it -_-

    Simba Code:
    Function WithDrawBankS(ItemName, UpText: string): Boolean;
    var
      Tab: Integer;
    begin
      If (Not BankScreen) then
        Exit;

      Tab := CurrentBankTab;
      SearchBank(ItemName);
      MouseBankSlot(1, Mouse_Move);
      If (WaitUptext(UpText, 800)) then
      begin
        ClickMouse2(Mouse_Left);
        Result := True;
      end;
      BankTab(Tab);
    end;

    2. I dislike the fact that it always goes to the first slot.

    3. Your MouseBankSlot Parameters are wrong. 1 = Left Click, 2 = RightClick, 3 = Move. You right clicked then wait for uptext then left click? :S For this reason we have Constants like Mouse_Left, Mouse_Right, Mouse_Move.

    For all the above, specifically point #2. I don't know if such a function is worth it.. I don't understand the point of it perhaps.
    I am Ggzz..
    Hackintosher

  14. #14
    Join Date
    Nov 2011
    Posts
    1,589
    Mentioned
    9 Post(s)
    Quoted
    17 Post(s)

    Default

    @Brandon number 2 never right clicks for me 0 does, and the idea say if your making a script AcS and you want to see if the user has a certain Item instead of scrolling through the bank do a simple search to see if the item is available RunAways is a lot more human like in that it checks if the items is there.



    ^^

  15. #15
    Join Date
    Feb 2011
    Location
    The Future.
    Posts
    5,600
    Mentioned
    396 Post(s)
    Quoted
    1598 Post(s)

    Default

    Quote Originally Posted by Mat View Post
    @Brandon number 2 never right clicks for me 0 does, and the idea say if your making a script AcS and you want to see if the user has a certain Item instead of scrolling through the bank do a simple search to see if the item is available RunAways is a lot more human like in that it checks if the items is there.
    Hmm but why slot 1? If it can find items in more than one slot after a search, I'd support.

    I guess you're right. My values in the last post is wrong.

    Simba Code:
    {$I SRL/SRL.Simba}

    begin
      writeln('Mouse_Left:  ' + ToStr(MOUSE_LEFT));
      writeln('Mouse_Right: ' + ToStr(MOUSE_RIGHT));
      writeln('Mouse_Move:  ' + ToStr(MOUSE_MOVE));
    end.

    Prints:

    Mouse_Left: 1
    Mouse_Right: 0
    Mouse_Move: 3
    Successfully executed.


    I guess 2 has no effect then :S
    I am Ggzz..
    Hackintosher

  16. #16
    Join Date
    Nov 2011
    Posts
    1,589
    Mentioned
    9 Post(s)
    Quoted
    17 Post(s)

    Default

    Reason, for slot one is the idea if in my acs, i need a spade, i'd make it search 'Spade' then it'll find a spade, and I'll take it. But as Shay Pointed there are items with same names, so RunAways is best for that .
    Mat



    ^^

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
  •