Results 1 to 4 of 4

Thread: How can i simplify this?

  1. #1
    Join Date
    Oct 2011
    Location
    Australia, Vic
    Posts
    1,517
    Mentioned
    2 Post(s)
    Quoted
    120 Post(s)

    Default How can i simplify this?

    I need to simplifiy this procedure, it looks way to messy as it is.

    Simba Code:
    procedure RepairPouches;
    var
    x, y: integer;
    begin
      OpenBankCw;
      if Withdraw(AstralCollum, AstralRow, 1) then
        if Withdraw(CosmicCollum, CosmicRow, 1) then
          if Withdraw(AirCollum, AirRow, 2) then
            begin
              CloseBank;
              if GameTab(tab_magic) then
                begin
              MouseBox(680, 310, 694, 318, MOUSE_LEFT);
              Wait(500+random(250));
              MouseBox(407, 309, 459, 317, MOUSE_LEFT);
              Wait(7000+random(1000));
              ClickContinue(False, True);
              Wait(800+random(250));
              ClickContinue(False, True);
              Wait(800+random(250));
              ClickContinue(False, True);
              Wait(800+random(250));
              ClickContinue(False, True);
              Wait(800+random(250));
              ClickContinue(False, True);
              Wait(800+random(250));
              ClickContinue(False, True);
              SendKeys('1', 300);
              Wait(800+random(250));
              ClickContinue(False, True);
              Wait(800+random(250));
              ClickContinue(False, True);
            end;
          end;
    end;

  2. #2
    Join Date
    Mar 2012
    Location
    Grambling, LA
    Posts
    70
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by John View Post
    I need to simplifiy this procedure, it looks way to messy as it is.
    If I were you, I would use a loop (for, while or repeat).
    Simba Code:
    procedure RepairPouches;
    var
    x, y, i: integer;
    begin
      OpenBankCw;
      if not Withdraw(AstralCollum, AstralRow, 1) then exit;
      if not Withdraw(CosmicCollum, CosmicRow, 1) then exit;
      if not Withdraw(AirCollum, AirRow, 2) then exit;
      if BankScreen then CloseBank;
      if not GameTab(tab_magic) then exit;
      MouseBox(680, 310, 694, 318, MOUSE_LEFT);
      Wait(500+random(250));
      MouseBox(407, 309, 459, 317, MOUSE_LEFT);
      Wait(7000+random(1000));
      for i:=1 to 9 do
      begin
        if i=7 then
          SendKeys('1', 300)
        else
          ClickContinue(False, True);
        Wait(800+random(250));
      end;
    end;

  3. #3
    Join Date
    Oct 2011
    Location
    Australia, Vic
    Posts
    1,517
    Mentioned
    2 Post(s)
    Quoted
    120 Post(s)

    Default

    Quote Originally Posted by johnbrown8976 View Post
    If I were you, I would use a loop (for, while or repeat).
    Simba Code:
    procedure RepairPouches;
    var
    x, y, i: integer;
    begin
      OpenBankCw;
      if not Withdraw(AstralCollum, AstralRow, 1) then exit;
      if not Withdraw(CosmicCollum, CosmicRow, 1) then exit;
      if not Withdraw(AirCollum, AirRow, 2) then exit;
      if BankScreen then CloseBank;
      if not GameTab(tab_magic) then exit;
      MouseBox(680, 310, 694, 318, MOUSE_LEFT);
      Wait(500+random(250));
      MouseBox(407, 309, 459, 317, MOUSE_LEFT);
      Wait(7000+random(1000));
      for i:=1 to 9 do
      begin
        if i=7 then
          SendKeys('1', 300)
        else
          ClickContinue(False, True);
        Wait(800+random(250));
      end;
    end;
    Man that looks great!
    Tysm
    E: Why? lol http://puu.sh/vmP1
    Last edited by John; 05-18-2012 at 09:37 AM.

  4. #4
    Join Date
    Nov 2006
    Posts
    2,369
    Mentioned
    4 Post(s)
    Quoted
    78 Post(s)

    Default

    You could also consider using and instead of if then if then if then:
    Simba Code:
    procedure RepairPouches;
    var
    x, y, i: integer;
    begin
      OpenBankCw;
      if Withdraw(AstralCollum, AstralRow, 1) and Withdraw(CosmicCollum, CosmicRow, 1) and Withdraw(AirCollum, AirRow, 2) then
      begin
        CloseBank;
        if GameTab(tab_magic) then
        begin
          MouseBox(680, 310, 694, 318, MOUSE_LEFT);
          Wait(500+random(250));
          MouseBox(407, 309, 459, 317, MOUSE_LEFT);
          Wait(7000+random(1000));
          for i:=1 to 9 do
          begin
            if i=7 then
              SendKeys('1', 300)
            else
              ClickContinue(False, True);
            Wait(800+random(250));
          end;
       end;
    end;
    Quote Originally Posted by DeSnob View Post
    ETA's don't exist in SRL like they did in other communities. Want a faster update? Help out with updating, otherwise just gotta wait it out.

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
  •