Results 1 to 11 of 11

Thread: How can i improve this

  1. #1
    Join Date
    May 2007
    Location
    England/Liverpool
    Posts
    1,004
    Mentioned
    9 Post(s)
    Quoted
    106 Post(s)

    How can i improve this

    I need some help to improve this it works but i want it running better
    SCAR Code:
    procedure Banking;
    begin
         MakeCompass('n');
         wait(1000);
         if(FindObj(x,y, 'Talk-to',(Bcolor1),30))then
         begin
         Mouse(x,y,2,2,False);
         ChooseOption('Bank');
         if(BankScreen)then
         begin
         wait(2000);
         DepositAll;
         WithDraw((Lobbies));
         CloseBank;
      end else
         if not(FindObj(x,y, 'Talk-to',(Bcolor1),30))then
         begin
         MakeCompass('e');
         wait(1000);
         if(FindObj(x,y, 'Talk-to',(Bcolor2),30))then
    begin
         Mouse(x,y,2,2,False);
         ChooseOption('Bank');
         wait(2000);
         DepositAll;
         WithDraw((Lobbies));
         CloseBank;
         end else
         if not(FindObj(x,y, 'Talk-to',(Bcolor2),30))then
         begin
         Banking;
        end;
       end;
    end;
    i want to scale it down a bit i will be very greatfull
    thanks

    CRU1Z1N........
    Previously Known or not Known as CRU1Z1N.
    If you want to succeed you should strike out on new paths, rather than travel the worn paths of accepted success.(John D. Rockefeller)

  2. #2
    Join Date
    Jun 2007
    Location
    Wednesday
    Posts
    2,446
    Mentioned
    3 Post(s)
    Quoted
    1 Post(s)

    Default

    SCAR Code:
    {*******************************************************************************
    function OpenBankFast(Location: String): Boolean;
    By: Wizzup? and Nielsie95
    Description: Opens the bank.
    Valid arguments are:
        'akb', 'al kharid', 'lb', 'lumbridge', 'veb', 'varrock east', 'vwb',
        'varrock west', 'feb', 'falador east', 'fwb', 'falador west', 'db', 'draynor',
        'eb', 'edgeville bank'
    *******************************************************************************}


    function OpenBankFast(Location: String): Boolean;

    It's a SRL banking function so you can use that instead of all your FindObj's that open the bank.
    By reading this signature you agree that mixster is superior to you in each and every way except the bad ways but including the really bad ways.

  3. #3
    Join Date
    May 2007
    Location
    England/Liverpool
    Posts
    1,004
    Mentioned
    9 Post(s)
    Quoted
    106 Post(s)

    Default

    Quote Originally Posted by mixster View Post
    SCAR Code:
    {*******************************************************************************
    function OpenBankFast(Location: String): Boolean;
    By: Wizzup? and Nielsie95
    Description: Opens the bank.
    Valid arguments are:
        'akb', 'al kharid', 'lb', 'lumbridge', 'veb', 'varrock east', 'vwb',
        'varrock west', 'feb', 'falador east', 'fwb', 'falador west', 'db', 'draynor',
        'eb', 'edgeville bank'
    *******************************************************************************}


    function OpenBankFast(Location: String): Boolean;

    It's a SRL banking function so you can use that instead of all your FindObj's that open the bank.
    cant use them my bank is at bh :S lol thats why main my own
    Previously Known or not Known as CRU1Z1N.
    If you want to succeed you should strike out on new paths, rather than travel the worn paths of accepted success.(John D. Rockefeller)

  4. #4
    Join Date
    Jun 2007
    Location
    Wednesday
    Posts
    2,446
    Mentioned
    3 Post(s)
    Quoted
    1 Post(s)

    Default

    FindObjCustom supports multiple colours, so instead of having the 3 separate ones you can just have the one with the 3 colours inputted, though I'm not sure if it works properly yet or not as there was an issue with it in rev 15/16 I believe.

    Otherwise, you can probably shorten it by doing:
    SCAR Code:
    if not FIndObj() then
      begin
        MakeCompas();
        if not FindObj() then Exit;
      end;
      Rest of code considering it finds the bank
    Of course not exactly like that, but the gist of it is if not FindTheBank then change the compass and try to find it again. If it still can't find it, then exit. Now run the rest of the code that deals with depositing everything and withdrawing the lobbies.
    By reading this signature you agree that mixster is superior to you in each and every way except the bad ways but including the really bad ways.

  5. #5
    Join Date
    May 2007
    Location
    England/Liverpool
    Posts
    1,004
    Mentioned
    9 Post(s)
    Quoted
    106 Post(s)

    Default

    i wanna know if i could make it go

    procedure Banking;
    begin
    MakeCompass('n');
    wait(1000);
    if(FindObj(x,y, 'Talk-to',(Bcolor1),30))then
    begin<--------------------TO HERE
    Mouse(x,y,2,2,False);
    ChooseOption('Bank');
    if(BankScreen)then
    begin
    wait(2000);
    DepositAll;
    WithDraw((Lobbies));
    CloseBank;
    end else
    if not(FindObj(x,y, 'Talk-to',(Bcolor1),30))then
    begin
    MakeCompass('e');
    wait(1000);
    if(FindObj(x,y, 'Talk-to',(Bcolor2),30))then<------FROM HERE
    begin<--------------------------SO I COULD GET RID OF ALL THIS
    Mouse(x,y,2,2,False);
    ChooseOption('Bank');
    wait(2000);
    DepositAll;
    WithDraw((Lobbies));
    CloseBank;
    end else
    if not(FindObj(x,y, 'Talk-to',(Bcolor2),30))then
    begin
    Banking;
    end;
    end;
    end;
    Previously Known or not Known as CRU1Z1N.
    If you want to succeed you should strike out on new paths, rather than travel the worn paths of accepted success.(John D. Rockefeller)

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

    Default

    A really good improvement would be to use FindObjTPA It's really easy, take a look at this small tutorial: http://www.villavu.com/forum/showthr...=28248?t=30759



  7. #7
    Join Date
    Mar 2008
    Posts
    1,492
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    SCAR Code:
    procedure Banking;
    {.include srl/srl.Scar}
    var
    i:integer;
    begin
      repeat
      i:=i+1
      MakeCompass('n');
      wait(1000);
      if (FindObjCustom(x,y, ['Talk-to'],[(Bcolor1),(Bcolor2),(Bcolor3)],30)) then
      begin
        Mouse(x,y,2,2,False);
        ChooseOption('Bank');
      until (Bankscreen) or (i>=10)
        if(BankScreen)then
        begin
          wait(2000);//if there is the bank screen there is no use for this...
          DepositAll;
          Withdraw((Lobbies));
          CloseBank;
        if (i>=10) then
        begin
          logout;
          TerminateScript;
        end;
        end;
      end;
    end;

    Should work...

  8. #8
    Join Date
    May 2007
    Location
    England/Liverpool
    Posts
    1,004
    Mentioned
    9 Post(s)
    Quoted
    106 Post(s)

    Default

    Cheers fella works much faster but i still wanna do as shows and ideas on that???
    Previously Known or not Known as CRU1Z1N.
    If you want to succeed you should strike out on new paths, rather than travel the worn paths of accepted success.(John D. Rockefeller)

  9. #9
    Join Date
    Mar 2008
    Posts
    1,492
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Do what? I dont get it... still wanna do as shows? i dont think there is really a way to do that any better...

  10. #10
    Join Date
    May 2007
    Location
    England/Liverpool
    Posts
    1,004
    Mentioned
    9 Post(s)
    Quoted
    106 Post(s)

    Default

    NVM ive sorted this part out now thanks for the help all of you

    CRU1Z1N..........
    Previously Known or not Known as CRU1Z1N.
    If you want to succeed you should strike out on new paths, rather than travel the worn paths of accepted success.(John D. Rockefeller)

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

    Default

    for future reference there's two ways you could do it.

    GoTo and Labels or my preferred way:

    SCAR Code:
    begin
      //...
      if not FindObj() then
        if not FindObj() then
          if not FindObj() then
          begin
            Logout;
            exit;
          end;
         
      ChooseOption('ank');
      //...
    end;


    ~RM

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

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. How do I improve this firemaker?
    By bionicllama in forum OSR Help
    Replies: 5
    Last Post: 07-10-2008, 06:06 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
  •