Results 1 to 11 of 11

Thread: Bank withdraw-X

  1. #1
    Join Date
    Oct 2009
    Location
    Melb, Australia
    Posts
    179
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default Bank withdraw-X

    Hi, I used to play around with SCAR years ago in RS, anyway I have a problem.
    Does anyone know how to detect the "Withdraw-X" option when banking? I tried ChooseOption('X') and ChooseOption ('draw-X') but they don't work.
    I tried using FindBitmapToleranceIn but could not get it to work.
    I also remember years ago, that SCAR had a very useful manual with all of its functions and examples, but I can't seem to find it (SCAR wiki is incompleted).
    Any help with this would be greatly appreciated thanks.

  2. #2
    Join Date
    Mar 2008
    Location
    New Jersey
    Posts
    1,673
    Mentioned
    1 Post(s)
    Quoted
    9 Post(s)

    Default

    ChooseOption('X'); should work, that's how I always used it, if it doesn't then it's a problem with SRL, a way around it would be to make a tiny bmp of part of the withdraw-X and search for it. If you can't get it to do it, I'll see if I can help you. And you can see all the scar functions by pressing ctrl + space.

  3. #3
    Join Date
    Oct 2009
    Location
    Melb, Australia
    Posts
    179
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Well all the other ChooseOptions seem to work fine, just the 'X' doesn't in bank screen for me.
    And as for the searching for the bitmap, I've tried a couple times with no success:
    Code:
    If FindBitmapToleranceIn(withdrawx2,x,y,23,83,493,288,50) then
        begin
           Mmouse(x,y,10,10);
           Wait(100+random(30));
           Mouse(x,y,0,0,true);
           writeln('Used option-x!');
           Wait(500+random(500));
         end else
         begin
            writeln('Option-x failed!');
            terminatescript;
         end;
    The bitmap is of the '-X' bit, i tried another with just a part of the 'X' but no dice.
    Edit: and thanks for the ctrl+space, should come in handy.
    Last edited by code841; 10-12-2009 at 11:41 AM.

  4. #4
    Join Date
    Apr 2007
    Location
    UK
    Posts
    2,295
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    SCAR Code:
    WaitOption('X',500);


    Maybe you are checking before the menu has actually popped up.

    Rogeruk's Al-Kharid Tanner V1.1 [Released]
    Rogeruk's Barbarian Crafter [Coming Soon]
    Rogeruk's Guild Fisher [Coming Soon]
    !! - Taking Requests - !!

  5. #5
    Join Date
    Feb 2009
    Location
    Hungary (GMT + 1)
    Posts
    1,774
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    You can also press F1 in scar and the manual will come up.
    Also I love using SRL's withdraw function.
    The only thing you have to do before you call that function(if you are using coordinates) is to calculate the row/col of the item. But there are functions for that so it's easy.

  6. #6
    Join Date
    Oct 2009
    Location
    Melb, Australia
    Posts
    179
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by rogeruk View Post
    SCAR Code:
    WaitOption('X',500);


    Maybe you are checking before the menu has actually popped up.
    I tried that function, but it just does the same as ChooseOption('X'), flicks too the left offscreen (fails to find it).

    Quote Originally Posted by Sabzi View Post
    You can also press F1 in scar and the manual will come up.
    Also I love using SRL's withdraw function.
    The only thing you have to do before you call that function(if you are using coordinates) is to calculate the row/col of the item. But there are functions for that so it's easy.
    What is SRL's withdraw function, if you don't mind me asking?
    This is in Al Kharid's bank by the way.

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

    Default

    PHP Code:
    {*******************************************************************************
    procedure Withdraw(ColRowAmountInteger);
    byStarblaster100TownWizzup? and Narcle
    Description
    Withdraws Amount at Column/Row.
    *******************************************************************************}
    procedure Withdraw(colrowAmountInteger); 
    PHP Code:
    {*******************************************************************************
    function 
    WithdrawItemEx(IdentintegerIdentTypestring; var IndexintegerAmountintegerUpTextStringTolTIntegerArray): boolean;
    ByNava2
    Description
    Withdraws an item from the bank by using "Ident" with tol[0]
                 as 
    color tolerancetol[1] as contour tolerance in case of bmp
                 masks
    , or the count of colors for TPA item finding.
                 
    Valid IdentTypes are all in FindItem.
                 
    IndexThe Bank Index where the item is foundmust be a variable.
                        
    Speeds up future withdraws.
                 
    AmountAmount to withdraw from bank.
                 
    UpTextThe UpText which the function checks for.
    *******************************************************************************}
    function 
    WithdrawItemEx(IdentintegerIdentTypestring; var IndexintegerAmountintegerUpTextStringTolTIntegerArray): Boolean
    PHP Code:
    {*******************************************************************************
    function 
    WithdrawItem(IdentintegerIdentTypestringAmountintegerUpTextTStringArrayTolTIntegerArray): boolean;
    byNava2
    Description
    Withdraws an item using WithdrawItemExbut removes the Index check.
    *******************************************************************************}
    function 
    WithdrawItem(IdentintegerIdentTypestringAmountintegerUpTextStringTolTIntegerArray): boolean


  8. #8
    Join Date
    Oct 2009
    Location
    Melb, Australia
    Posts
    179
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Thanks, I'll try work it into my bank withdrawing.
    I have another question for the functions "OpenBankFast()" and "OpenBankGlass()".
    Right now I'm doing:
    Code:
    MarkTime(i);
    repeat
        OpenBankFast('akb');
    until findColorTolerance(x,y,4106994,187,26,325,40,10) or (TimeFromMark(i) > 2000+random(2000))
    
    MarkTime(i);
    
    repeat
        OpenBankGlass('akb',false,false);
    until FindColorTolerance(x,y,4106994,187,26,325,40,10) or (TimeFromMark(i) > 2000+random(2000))
    I want to get it to stop searching for the bank after the allocated times, but it doesn't stop searching, so the "OpenBankGlass()" doesn't get used.

  9. #9
    Join Date
    Apr 2007
    Location
    UK
    Posts
    2,295
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    SCAR Code:
    Procedure test;
    Begin
      MarkTime(i);

      Repeat
        OpenBankFast('akb');
      Until FindColorTolerance(x, y, 4106994, 187, 26, 325, 40, 10) Or
        (TimeFromMark(i) > 2000 + Random(2000));
       
      If (FindColorTolerance(x, y, 4106994, 187, 26, 325, 40, 10)) The
      Begin
        Writeln('We found the color.. lets exit');
        Exit;
      End;
     
      MarkTime(i);
     
      Repeat
        OpenBankGlass('akb', False, False);
      Until FindColorTolerance(x, y, 4106994, 187, 26, 325, 40,
        10) Or (TimeFromMark(i) > 2000 + Random(2000));
       
      If (FindColorTolerance(x, y, 4106994, 187, 26, 325, 40, 10)) Then
      Begin
        Writeln('We found the color.. lets exit');
        Exit;    
      End Else
      Begin
        Writeln('We didnt find the color.. Terminate!');
        TerminateScript;
        //NextPlayer(False); //Multiplayer
      End;
     
    End;

    Why are you searching for colors? What is that for? Too see if the bank is open?

    If so use BankScreen

    Rogeruk's Al-Kharid Tanner V1.1 [Released]
    Rogeruk's Barbarian Crafter [Coming Soon]
    Rogeruk's Guild Fisher [Coming Soon]
    !! - Taking Requests - !!

  10. #10
    Join Date
    Oct 2009
    Location
    Melb, Australia
    Posts
    179
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Yeah it's looking for the colour of the heading in the bankscreen. I'll try out the BankScreen function then :P.

    And the code you posted, that's basically doing the same as mine, I want to make the OpenBankFast() and OpenBankGlass() break after the allocated time.

    EDIT:
    Don't worry, I found the bank.scar and looked at all the functions. OpenBank() seems to do what I wanted.

  11. #11
    Join Date
    Apr 2007
    Location
    UK
    Posts
    2,295
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Yea they all have intergrated bankscreen checks.

    Rogeruk's Al-Kharid Tanner V1.1 [Released]
    Rogeruk's Barbarian Crafter [Coming Soon]
    Rogeruk's Guild Fisher [Coming Soon]
    !! - Taking Requests - !!

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
  •