Page 1 of 2 12 LastLast
Results 1 to 25 of 26

Thread: Bank procedures.

  1. #1
    Join Date
    Dec 2007
    Posts
    2,766
    Mentioned
    2 Post(s)
    Quoted
    37 Post(s)

    Default Bank procedures.

    Hi...

    Three lower right options :

    SCAR Code:
    {*******************************************************************************
    Procedure DepositBank(Option: String);
    By : Dr D. Dervish
    Description: Will deposit the items using the three deposit methods
                 in the down-right corner of the Bank Screen
                 The valid options are :
                 inventory
                 equipped
                 summoned
    *******************************************************************************}

    Procedure DepositBank(Option: String);
    var
      x,y: Integer;

    Begin
      If (Not(BankScreen)) then
        Exit;

      Case Option of
        'inventory'  : Begin
                         MMouse(381,296,28,18);
                         If (IsUpText('arried')) then
                         Begin
                           GetMousePos(x,y);
                           Mouse(x,y,0,0,true);
                         End;
                       End;
        'equipped'   : Begin
                         MMouse(421,296,28,18);
                         If (IsUpText('worn')) then
                         Begin
                           GetMousePos(x,y);
                           Mouse(x,y,0,0,true);
                         End;
                       End;

        'summoned'   : Begin
                         MMouse(441,296,28,18);
                         If (IsUpText('beast')) then
                         Begin
                           GetMousePos(x,y);
                           Mouse(x,y,0,0,true);
                         End;
                       End;
      End;
    End;

    Searching :


    SCAR Code:
    {*******************************************************************************
    procedure SearchBank(Item: string);
    by: ZephyrsFury (mini fix by Dr D. Dervish for bank update).
    Description: Searches for Item in your bank.
    *******************************************************************************}


    procedure SearchBank(Item: string);
    var
      T, II: Integer;
    begin
      if (not(BankScreen)) then Exit;
      for II := 0 to 2 do
      begin
        FixBankTab;
        Mouse(72,296,28,18,true);
        T := GetSystemTime;
        while (BankScreen) and (not(FindTextTpa(0, 0, 350, 392, 399, 410, 'search', UpChars, Nothing))) do
        begin
          Wait(500 + Random(500));
          if (GetSystemTime - T > 5000) then Break;
        end;
        Wait(500 + Random(500));
        if (FindTextTpa(0, 0, 350, 392, 399, 410, 'search', UpChars, Nothing)) then
        begin
          TypeSend(Item);
          Exit;
        end;
      end;
    end;

    Note withdrawal :

    SCAR Code:
    {*******************************************************************************
    procedure NotedMode(Mode: boolean);
    by: Dr D. Dervish.
    Description: Changes the Mode to items if Mode boolean is set to false.
                 Changes the Mode to notes if Mode boolean is set to true .
    *******************************************************************************}

    Procedure NotedMode(Mode: Boolean);
    var
      x,y : Integer;

    Begin
      If (not(BankScreen)) then
        Exit;

      MMouse(243,296,28,18);
      Wait(750+random(250));
     
      If (IsUpText('note')) then
      Case Mode of

        True  : Begin
                  GetMousePos(x,y);
                  Mouse(x,y,0,0,true)
                End;
               
        False : Begin
                  Writeln('Withdrawal mode is already set to items.');
                  Exit;
                End;
      End;

      If (IsUpText('items')) then
      Case Mode of

        True  : Begin
                  Writeln('Withdrawal mode is already set to notes.');
                  Exit;
                End;

        False : Begin
                  GetMousePos(x,y);
                  Mouse(x,y,0,0,true);
                End;

       End;
    End;

    Hope you like it.

    Tell me if you find any errors.

  2. #2
    Join Date
    Dec 2007
    Posts
    515
    Mentioned
    0 Post(s)
    Quoted
    1 Post(s)

    Default

    Nice! This feature only existed for about 3 hours and already a script for it
    In the kingdom of the blind, the one-eyed man is king

  3. #3
    Join Date
    Apr 2007
    Posts
    2,593
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    It's equipment, not equipement.

    Sorry to be a grammar nazi, but it has to be fixed :S

  4. #4
    Join Date
    Dec 2007
    Posts
    2,766
    Mentioned
    2 Post(s)
    Quoted
    37 Post(s)

    Default

    Thank you both ^^.

    Lol TViYH : I wrote "equipped" in the description and used "equipement" in the script, thanks to you I found that out xD.

    Fixed .

  5. #5
    Join Date
    Jul 2008
    Location
    Poland
    Posts
    375
    Mentioned
    1 Post(s)
    Quoted
    0 Post(s)

    Default

    SCAR Code:
    {
    0 inventory
    1 equipped
    2 summoned
    }

    function DepositBank(Option: integer): boolean;

    var
      P: TPoint;
    begin
      if not BankScreen then Exit;
     
      if not InRange(Option, 0, 2) then
      begin
        srl_Warn('DepositBank', 'Unknown option ', warn_AllVersions);
        Exit;
      end;
     
      P.x := 397 + (37 * Option) - RandomRange(-10, 10);
      P.y := 309 - RandomRange(-10, 10);
     
      MMouse(P.x, P.y, 0, 0);
     
      if not IsUpText('posit') then Exit;
     
      GetMousePos(P.x, P.y);
      ClickMouse(P.x, P.y, True);
      Wait(RandomRange(700, 1200));
      Result := True;
    end;

    its what i made
    :P

  6. #6
    Join Date
    Dec 2007
    Posts
    2,766
    Mentioned
    2 Post(s)
    Quoted
    37 Post(s)

    Default

    Quote Originally Posted by Iroki AKA manfromczech View Post
    SCAR Code:
    {
    0 inventory
    1 equipped
    2 summoned
    }

    function DepositBank(Option: integer): boolean;

    var
      P: TPoint;
    begin
      if not BankScreen then Exit;
     
      if not InRange(Option, 0, 2) then
      begin
        srl_Warn('DepositBank', 'Unknown option ', warn_AllVersions);
        Exit;
      end;
     
      P.x := 397 + (37 * Option) - RandomRange(-10, 10);
      P.y := 309 - RandomRange(-10, 10);
     
      MMouse(P.x, P.y, 0, 0);
     
      if not IsUpText('posit') then Exit;
     
      GetMousePos(P.x, P.y);
      ClickMouse(P.x, P.y, True);
      Wait(RandomRange(700, 1200));
      Result := True;
    end;

    its what i made
    Does it work better than mine ?

    Mine worked well for me... It is simpler than yours but works flawlessly (I didn't say yours didn't ).

  7. #7
    Join Date
    Jul 2007
    Location
    Right now? Chair.
    Posts
    8,488
    Mentioned
    3 Post(s)
    Quoted
    12 Post(s)

    Default

    /me finds the flaw

    SCAR Code:
    DepositBank('eQuIpPeD'); // = fail

    also iroki's is more efficient for this.

    on the second one i'm not sure how the not will react in the while. it's quite tricky really.

    SCAR Code:
    while (BankScreen) and (not(FindTextTpa(0, 0, 350, 392, 399, 410, 'search', UpChars, Nothing))) do


    //i suggest

    while BankScreen do
    begin
      if FindTextTPA then break;
      //....
    end;


    for the last one, isn't there some kind of color you can check for the mode, instead of movign the mouse and checking text?

    good work.

    ~RM

    I & I know Zion. It is in the spirit, body and mind of every one of us
    RMouse(obj: TMSIObject): boolean;

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

    Default

    You need waits if you are going to keep the UpTexts there...
    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

  9. #9
    Join Date
    Dec 2007
    Posts
    2,766
    Mentioned
    2 Post(s)
    Quoted
    37 Post(s)

    Default

    Quote Originally Posted by Rasta Magician View Post
    /me finds the flaw

    SCAR Code:
    DepositBank('eQuIpPeD'); // = fail

    also iroki's is more efficient for this.

    on the second one i'm not sure how the not will react in the while. it's quite tricky really.

    SCAR Code:
    while (BankScreen) and (not(FindTextTpa(0, 0, 350, 392, 399, 410, 'search', UpChars, Nothing))) do


    //i suggest

    while BankScreen do
    begin
      if FindTextTPA then break;
      //....
    end;


    for the last one, isn't there some kind of color you can check for the mode, instead of movign the mouse and checking text?

    good work.

    ~RM
    I found it better to move the mouse and check the up text since this is to change the mode if necessary, not to return a boolean and I don't really know how I would compare the colors...

  10. #10
    Join Date
    Dec 2008
    Posts
    2,813
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    NO!

    don't search ;D

    look for the DTM, if it can't find it scroll down for like.. (you have to get the time) 750-1000.. then look again.. repeat.. then check the color right above the down arrow and if it's the color of the scroll bar, then you can't find it, and try to search

  11. #11
    Join Date
    Jul 2007
    Location
    Right now? Chair.
    Posts
    8,488
    Mentioned
    3 Post(s)
    Quoted
    12 Post(s)

    Default

    Quote Originally Posted by Dr D. Dervish View Post
    I found it better to move the mouse and check the up text since this is to change the mode if necessary, not to return a boolean and I don't really know how I would compare the colors...
    better only to move the mouse if you have to

    SCAR Code:
    {*******************************************************************************
    procedure NotedMode(Mode: boolean);
    by: Rasta Magician
    Description: Changes the Bank Mode to Mode
    *******************************************************************************}

    Procedure NotedMode(Mode: Boolean);
    begin
      if not BankScreen then exit;
      if not LoggedIn then exit;
     
      if (Mode)xor(GetColor(254, 318) = 3688012) then
      begin
        Mouse(243,296,28,18, true);
        wait(100);
      end;
    end;

    xor works like this:
    true + true = false
    true + false = true
    false + true = true
    false + false = false

    basically if one but not the other.

    The color at that point changes when noted = true;

    ~RM

    I & I know Zion. It is in the spirit, body and mind of every one of us
    RMouse(obj: TMSIObject): boolean;

  12. #12
    Join Date
    Jul 2008
    Location
    Poland
    Posts
    375
    Mentioned
    1 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by Dr D. Dervish View Post
    Does it work better than mine ?

    Mine worked well for me... It is simpler than yours but works flawlessly (I didn't say yours didn't ).
    I didnt tell that your isnt good, my is just smaller and, umm..., faster.
    Your is good too
    :P

  13. #13
    Join Date
    Dec 2007
    Posts
    2,766
    Mentioned
    2 Post(s)
    Quoted
    37 Post(s)

    Default

    Quote Originally Posted by Iroki AKA manfromczech View Post
    I didnt tell that your isnt good, my is just smaller and, umm..., faster.
    Your is good too
    Yours is alot more complex (and probably better)... You're a far better scripter than I am Iroki.

  14. #14
    Join Date
    Jul 2008
    Location
    Poland
    Posts
    375
    Mentioned
    1 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by Dr D. Dervish View Post
    Yours is alot more complex (and probably better)... You're a far better scripter than I am Iroki.
    Umm, you are as good scripter as I but you maybe dont know some things.
    :P

  15. #15
    Join Date
    Dec 2007
    Posts
    2,766
    Mentioned
    2 Post(s)
    Quoted
    37 Post(s)

    Default

    Quote Originally Posted by Iroki AKA manfromczech View Post
    Umm, you are as good scripter as I but you maybe dont know some things.
    Knowledge is power .

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

    Default

    Quote Originally Posted by Iroki AKA manfromczech View Post
    SCAR Code:
    {
    0 inventory
    1 equipped
    2 summoned
    }

    function DepositBank(Option: integer): boolean;

    var
      P: TPoint;
    begin
      if not BankScreen then Exit;
     
      if not InRange(Option, 0, 2) then
      begin
        srl_Warn('DepositBank', 'Unknown option ', warn_AllVersions);
        Exit;
      end;
     
      P.x := 397 + (37 * Option) - RandomRange(-10, 10);
      P.y := 309 - RandomRange(-10, 10);
     
      MMouse(P.x, P.y, 0, 0);
     
      if not IsUpText('posit') then Exit;
     
      GetMousePos(P.x, P.y);
      ClickMouse(P.x, P.y, True);
      Wait(RandomRange(700, 1200));
      Result := True;
    end;

    its what i made
    Iroki, clickmouse() ...
    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

  17. #17
    Join Date
    Jul 2008
    Location
    Poland
    Posts
    375
    Mentioned
    1 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by noidea View Post
    Iroki, clickmouse() ...
    ??
    :P

  18. #18
    Join Date
    Dec 2008
    Posts
    2,813
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    you used ClickMouse in your script.. >.>

  19. #19
    Join Date
    Jul 2008
    Location
    Poland
    Posts
    375
    Mentioned
    1 Post(s)
    Quoted
    0 Post(s)

    Default

    Yes but whats wrong with it?? i dont understand.
    :P

  20. #20
    Join Date
    Dec 2008
    Posts
    2,813
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Detectable I think?

  21. #21
    Join Date
    Jul 2008
    Location
    Poland
    Posts
    375
    Mentioned
    1 Post(s)
    Quoted
    0 Post(s)

    Default

    I think that it's the same detectable as Mouse(x, y, 0, 0, True); But i'm not sure.
    :P

  22. #22
    Join Date
    Dec 2008
    Posts
    2,813
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Mouse doesn't use ClickMouse.. it uses Hold/ReleaseMouse

    ClickMouse is different I believe..

  23. #23
    Join Date
    Dec 2007
    Posts
    2,766
    Mentioned
    2 Post(s)
    Quoted
    37 Post(s)

    Default

    No, clickmouse clicks down and releases instantly, Mouse holds down a random time and releases (like humans do), watch out with clickmouse it is increadibly bannable.

  24. #24
    Join Date
    Dec 2008
    Posts
    2,813
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by Dr D. Dervish View Post
    No, clickmouse clicks down and releases instantly, Mouse holds down a random time and releases (like humans do), watch out with clickmouse it is increadibly bannable.
    that's what I said I think?

    (not trying to be an ass.. just want to make sure that I've been explaining it right )

  25. #25
    Join Date
    Dec 2007
    Posts
    2,766
    Mentioned
    2 Post(s)
    Quoted
    37 Post(s)

    Default

    I said that to Iroki, but you went first .

Page 1 of 2 12 LastLast

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. help on procedures
    By takeout in forum OSR Help
    Replies: 5
    Last Post: 09-30-2007, 01:13 PM
  2. Help with procedures :s
    By Macro_FTW in forum OSR Help
    Replies: 1
    Last Post: 05-02-2007, 02:15 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •