Results 1 to 8 of 8

Thread: Loops and order of operation/smithing

  1. #1
    Join Date
    Dec 2011
    Posts
    70
    Mentioned
    0 Post(s)
    Quoted
    26 Post(s)

    Default Loops and order of operation/smithing

    Can you help me make this more stable, and loop friendly?
    This is a personal script that goes to furnace in alkarid and smelts cballs. everything works but returning to bank and looping. Any tips? Editted out some of the code to be discreet.

    Code:
    program cballworking3;
    {$DEFINE SMART8}
    {$I SRL-OSR/SRL.Simba}
    {$I SRL-OSR/SRL/Misc/Debug.Simba}
    
    var
      x, y, i: integer;
      TPA : TPointArray;
    
    Status:string;
    
    
    
    const
      AccountLogin = '';
      AccountPass = '';
      CharacterName = '';
      version = '1.0';
    
    procedure DeclarePlayer;
    begin
      HowManyPlayers := 1;
      NumberOfPlayers(HowManyPlayers);
      CurrentPlayer := 0;
      Players[0].Name := AccountLogin;
      Players[0].Pass := AccountPass;
      Players[0].Nick := CharacterName;
      Players[0].Active := True;
    end;
    
    
    
    
    
    
    
    
    
    Procedure openBank;
          begin
    until (BankScreen);
    end;
    
    
    
    Procedure closeBank;
    begin
    end;
    
    procedure Iswithdraw;
    begin
    openBankScreen;
      wait(800 + random(800));
      if bankscreen then
      begin
        writeln('banking');
        wait(800 + random(800));
        Deposit(2, 28, TRUE);
        wait(500 + random(500));
          begin
          MMouse(142, 75, 2, 2);
          wait(1200 + random(500));
          begin
            clickMouse2(mouse_right);
            chooseOptionMulti(['All']);
              writeln('WithDrawing');
            wait(800 + random(800));
    
          closeBank;
        end;
        end;
        end;
        end;
    
    
    procedure WalkingToFurnace;
    var
      i,x,y:Integer;
    begin
         makecompass('N');
         begin
        RadialWalk(5012609,10,76,44,1,1);    //click mm kebab
        wait(2000);
        RadialWalk(1732602,1,76,60,1,1);    //click mm furnace
        wait(2000);
        makecompass('W');
      end;
    end;
    
    
    procedure SmeltCBall;
    var
      pX, pY: integer;
    begin
    wait(5000);
      Status := ('Doing Procedure clbar')
      InvMouse(2, 1);
      Writeln('clbar');
      begin
      Wait(1200 + Random(100));
      MMouse(260, 95, 5, 5);
      ClickMouse2(true);
        wait(2000);
    begin
    //personal code here not ready to be released
              begin
    
    
        If FindSymbol(x,y,'Bank') then
        begin
          Mouse(x,y,1,1,true);
          FFlag(0);
          Writeln('Successfully completed Walking 1.');
          wait(10000);
        end else
          Writeln('Walking failed!');
          makecompass('S');
          RadialWalk(5012609,5,76,35,1,1);
    
      end;
      end;
      end;
      end;
      end;
    
    
    begin
      SetupSRL;
      activateclient;
      DeclarePlayer;
      LoginPlayer;
      wait(500);
      repeat
      walkingtofurnace;
      SmeltCBall;
      Iswithdraw;
      until(false)
    end.
    Any tips on making it better? I tried using the option to findcustobj for clicking the furnace but i went with static coords on screen >.< any ideas on improving that?
    Last edited by mafia miles; 04-15-2013 at 08:34 PM.

  2. #2
    Join Date
    Dec 2011
    Posts
    70
    Mentioned
    0 Post(s)
    Quoted
    26 Post(s)

    Default

    Updated. Please review post.

  3. #3
    Join Date
    Sep 2012
    Location
    Here.
    Posts
    2,007
    Mentioned
    88 Post(s)
    Quoted
    1014 Post(s)

    Default

    Instead of static co-ord clicking, I recommend using the ACA tool and using that to find most any object you want. It'll even write the full function for you to do it.

  4. #4
    Join Date
    Dec 2011
    Posts
    70
    Mentioned
    0 Post(s)
    Quoted
    26 Post(s)

    Default

    Thanks! any idea on looping though? not sure how becides the simple main method loop.

  5. #5
    Join Date
    Sep 2012
    Location
    Here.
    Posts
    2,007
    Mentioned
    88 Post(s)
    Quoted
    1014 Post(s)

    Default

    As far as the main method loop goes, I don't see much of an issue with it. Except perhaps changing the until(false) to an until(not LoggedIn). (LoggedIn is the EOC method, idk the name of the 07 method).

    Instead of using static co-ords to withdraw from your bank, you can use DTMs to find the desired object you wish to withdraw - or the simpler method is that bank slot dependent withdraw methods do exist actually and you can use them to withdraw from row 2 column 1 (or wherever).

  6. #6
    Join Date
    Dec 2011
    Posts
    70
    Mentioned
    0 Post(s)
    Quoted
    26 Post(s)

  7. #7
    Join Date
    Dec 2011
    Posts
    70
    Mentioned
    0 Post(s)
    Quoted
    26 Post(s)

    Default

    The aca tool I used print autocolor and it didnt work in my script should i do print function instead?

  8. #8
    Join Date
    Sep 2012
    Location
    Here.
    Posts
    2,007
    Mentioned
    88 Post(s)
    Quoted
    1014 Post(s)

    Default

    When you're learning to use color and TPAs, you will find it easiest to use "print function." And you can even add an uptext to verify in that section.

    Eventually as you improve, you will start using ACA to simply grab the color/tolerances/hue/sat you need.

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
  •