Results 1 to 11 of 11

Thread: Need help with "Until" function

  1. #1
    Join Date
    Feb 2009
    Posts
    484
    Mentioned
    0 Post(s)
    Quoted
    1 Post(s)

    Default Need help with "Until" function

    Hey guys,

    I've been making a simple DTM script that will identify Tuna in bank and the withdraw them until inventory is full.

    I need a bit of help on what code to use for "Keep clicking until inventory is full"

    Here is what I have so far.

    Simba Code:
    program Tuna;

    {$i SRL\SRL.scar}


    Var
      Tuna, X, Y: Integer;

    begin

    SetupSRL;

    Tuna := DTMFromString('mwQAAAHic42RgYOABYjYg5gNiMSAWB2JBIOZggABGIOYGYhYgZoKKcUPVi0AxJxD3d3ZCVeDDhAEjERgOAEHKAoY=');
    if FindDTM(Tuna, X, Y, MSX1, MSY1, MSX2, MSY2) Then
      begin
      writeln('Found Tuna, clicking on it.');
      MMouse(X, Y, 5, 5);
      Wait(10+random(10))
      If isUptext('aw Tun') Then
        Begin
        Wait(10+Random(100));
        Mouse(X, Y, 0, 0, True)
        //Until(What to put in here?)
      end;

    FreeDTM(Tuna);
    end.

    Thanks

  2. #2
    Join Date
    Oct 2008
    Location
    C:\Simba\Includes\
    Posts
    7,566
    Mentioned
    19 Post(s)
    Quoted
    180 Post(s)

    Default

    Simba Code:
    repeat
      //code here
    until(InvFull);
    Away for awhile, life is keeping me busy. | Want to get my attention in a thread? @Kyle Undefined; me.
    { MSI Phoenix || SRL Stats Sigs || Paste || Scripts || Quotes || Graphics }

    When posting a bug, please post debug! Help us, help you!

    I would love to change the world, but they won't give me the source code. || To be the best, you've got to beat the rest. || Logic never changes, just the syntax.
    If you PM me with a stupid question or one listed in FAQ, or about a script that is not mine, I will NOT respond.


    SRL is a Library of routines made by the SRL community written for the Program Simba. We produce Scripts for the game Runescape.


  3. #3
    Join Date
    Feb 2009
    Posts
    484
    Mentioned
    0 Post(s)
    Quoted
    1 Post(s)

    Default

    Quote Originally Posted by Kyle Undefined View Post
    Simba Code:
    repeat
      //code here
    until(InvFull);
    Thanks a lot Kyle

    Exactly what I was looking for.

  4. #4
    Join Date
    Feb 2009
    Posts
    484
    Mentioned
    0 Post(s)
    Quoted
    1 Post(s)

    Default

    Okay, here is what I have now. Another problem.

    Right now it just spam clicks on the Tuna in the bank, which isn't really human like.

    Is there a way to fix this and click less often or slower?

    Simba Code:
    program Tuna;

    {$i SRL\SRL.scar}


    Var
      Tuna, X, Y: Integer;

    begin

    SetupSRL;

    Tuna := DTMFromString('mwQAAAHic42RgYOABYjYg5gNiMSAWB2JBIOZggABGIOYGYhYgZoKKcUPVi0AxJxD3d3ZCVeDDhAEjERgOAEHKAoY=');
    if FindDTM(Tuna, X, Y, MSX1, MSY1, MSX2, MSY2) Then
      begin

      MMouse(X, Y, 5, 5);
      Wait(10+random(10))
      If isUptext('aw tun') Then
        repeat
        writeln('Found Tuna, clicking on it.');
        Mouse(X, Y, 0, 0, True);
        Until(InvFull);
        writeln('Inventory Full, stopping')
      end;

    FreeDTM(Tuna);
    end.

    Cheers.

  5. #5
    Join Date
    Oct 2008
    Location
    C:\Simba\Includes\
    Posts
    7,566
    Mentioned
    19 Post(s)
    Quoted
    180 Post(s)

    Default

    Try this:

    Simba Code:
    program Tuna;
    {$i SRL\SRL.scar}

    var
      Tuna, X, Y: Integer;

    begin
      SetupSRL;

      Tuna := DTMFromString('mwQAAAHic42RgYOABYjYg5gNiMSAWB2JBIOZggABGIOYGYhYgZoKKcUPVi0AxJxD3d3ZCVeDDhAEjERgOAEHKAoY=');
      if FindDTM(Tuna, X, Y, MSX1, MSY1, MSX2, MSY2) Then
      begin
        MMouse(X, Y, 5, 5);
        Wait(10+random(10))
        If isUptext('aw tun') Then
        begin
          repeat
            Wait(RandomRange(2500, 750));
            writeln('Found Tuna, clicking on it.');
            Mouse(X, Y, 0, 0, True);
          Until(InvFull);
          writeln('Inventory Full, stopping');
        end;
      end;

      FreeDTM(Tuna);
    end.
    Away for awhile, life is keeping me busy. | Want to get my attention in a thread? @Kyle Undefined; me.
    { MSI Phoenix || SRL Stats Sigs || Paste || Scripts || Quotes || Graphics }

    When posting a bug, please post debug! Help us, help you!

    I would love to change the world, but they won't give me the source code. || To be the best, you've got to beat the rest. || Logic never changes, just the syntax.
    If you PM me with a stupid question or one listed in FAQ, or about a script that is not mine, I will NOT respond.


    SRL is a Library of routines made by the SRL community written for the Program Simba. We produce Scripts for the game Runescape.


  6. #6
    Join Date
    Feb 2009
    Posts
    484
    Mentioned
    0 Post(s)
    Quoted
    1 Post(s)

    Default

    Quote Originally Posted by Kyle Undefined View Post
    Try this:

    Simba Code:
    program Tuna;
    {$i SRL\SRL.scar}

    var
      Tuna, X, Y: Integer;

    begin
      SetupSRL;

      Tuna := DTMFromString('mwQAAAHic42RgYOABYjYg5gNiMSAWB2JBIOZggABGIOYGYhYgZoKKcUPVi0AxJxD3d3ZCVeDDhAEjERgOAEHKAoY=');
      if FindDTM(Tuna, X, Y, MSX1, MSY1, MSX2, MSY2) Then
      begin
        MMouse(X, Y, 5, 5);
        Wait(10+random(10))
        If isUptext('aw tun') Then
        begin
          repeat
            Wait(RandomRange(2500, 750));
            writeln('Found Tuna, clicking on it.');
            Mouse(X, Y, 0, 0, True);
          Until(InvFull);
          writeln('Inventory Full, stopping');
        end;
      end;

      FreeDTM(Tuna);
    end.
    Sweet, cheers

    Didn't think of that, so simple lol.

  7. #7
    Join Date
    Oct 2008
    Location
    C:\Simba\Includes\
    Posts
    7,566
    Mentioned
    19 Post(s)
    Quoted
    180 Post(s)

    Default

    Lol, no worries
    Away for awhile, life is keeping me busy. | Want to get my attention in a thread? @Kyle Undefined; me.
    { MSI Phoenix || SRL Stats Sigs || Paste || Scripts || Quotes || Graphics }

    When posting a bug, please post debug! Help us, help you!

    I would love to change the world, but they won't give me the source code. || To be the best, you've got to beat the rest. || Logic never changes, just the syntax.
    If you PM me with a stupid question or one listed in FAQ, or about a script that is not mine, I will NOT respond.


    SRL is a Library of routines made by the SRL community written for the Program Simba. We produce Scripts for the game Runescape.


  8. #8
    Join Date
    Feb 2009
    Posts
    484
    Mentioned
    0 Post(s)
    Quoted
    1 Post(s)

    Default

    Now that's working good, is there a way to make it repeat the whole script over and over again?

    Simba Code:
    program Tuna;
    {$i SRL\SRL.scar}

    var
      Tuna, X, Y: Integer;

    begin
      SetupSRL;

      Tuna := DTMFromString('mwQAAAHic42RgYOABYjYg5gNiMSAWB2JBIOZggABGIOYGYhYgZoKKcUPVi0AxJxD3d3ZCVeDDhAEjERgOAEHKAoY=');
      if FindDTM(Tuna, X, Y, MSX1, MSY1, MSX2, MSY2) Then
      begin
        MMouse(X, Y, 5, 5);
        Wait(10+random(10))
        If isUptext('aw tun') Then
        begin
          repeat
            Wait(RandomRange(700, 500));
            writeln('Found Tuna, clicking on it.');
            Mouse(X, Y, 0, 0, True);
          Until(InvFull);
          writeln('Inventory Full, stopping');
        end;
          If Invfull then
          begin
          DepositAll;
          end;



      end;

      FreeDTM(Tuna);
    end.

  9. #9
    Join Date
    Oct 2008
    Location
    C:\Simba\Includes\
    Posts
    7,566
    Mentioned
    19 Post(s)
    Quoted
    180 Post(s)

    Default

    You can do something like this:

    Simba Code:
    program Tuna;
    {$i SRL\SRL.scar}

    procedure Banking();
    var
      Tuna, x, y : Integer;
    begin
      Tuna := DTMFromString('mwQAAAHic42RgYOABYjYg5gNiMSAWB2JBIOZggABGIOYGYhYgZoKKcUPVi0AxJxD3d3ZCVeDDhAEjERgOAEHKAoY=');
      if(FindDTM(Tuna, X, Y, MSX1, MSY1, MSX2, MSY2))then
      begin
        MMouse(X, Y, 5, 5);
        Wait(10 + Random(10))
        if(isUptext('aw tun'))then
        begin
          repeat
            Wait(RandomRange(700, 500));
            WriteLn('Found Tuna, clicking on it.');
            Mouse(X, Y, 0, 0, True);
          until(InvFull);
          WriteLn('Inventory Full, stopping');
        end;
          if(Invfull)then
            DepositAll;
        FreeDTM(Tuna);
      end;
    end;

    begin
      SetupSRL;

      repeat
        Banking();
      until(IsKeyDown(VK_F10));
    end.

    It will repeat the procedure until you press the F10 key
    Away for awhile, life is keeping me busy. | Want to get my attention in a thread? @Kyle Undefined; me.
    { MSI Phoenix || SRL Stats Sigs || Paste || Scripts || Quotes || Graphics }

    When posting a bug, please post debug! Help us, help you!

    I would love to change the world, but they won't give me the source code. || To be the best, you've got to beat the rest. || Logic never changes, just the syntax.
    If you PM me with a stupid question or one listed in FAQ, or about a script that is not mine, I will NOT respond.


    SRL is a Library of routines made by the SRL community written for the Program Simba. We produce Scripts for the game Runescape.


  10. #10
    Join Date
    Feb 2009
    Posts
    484
    Mentioned
    0 Post(s)
    Quoted
    1 Post(s)

    Default

    Quote Originally Posted by Kyle Undefined View Post
    You can do something like this:

    Simba Code:
    program Tuna;
    {$i SRL\SRL.scar}

    procedure Banking();
    var
      Tuna, x, y : Integer;
    begin
      Tuna := DTMFromString('mwQAAAHic42RgYOABYjYg5gNiMSAWB2JBIOZggABGIOYGYhYgZoKKcUPVi0AxJxD3d3ZCVeDDhAEjERgOAEHKAoY=');
      if(FindDTM(Tuna, X, Y, MSX1, MSY1, MSX2, MSY2))then
      begin
        MMouse(X, Y, 5, 5);
        Wait(10 + Random(10))
        if(isUptext('aw tun'))then
        begin
          repeat
            Wait(RandomRange(700, 500));
            WriteLn('Found Tuna, clicking on it.');
            Mouse(X, Y, 0, 0, True);
          until(InvFull);
          WriteLn('Inventory Full, stopping');
        end;
          if(Invfull)then
            DepositAll;
        FreeDTM(Tuna);
      end;
    end;

    begin
      SetupSRL;

      repeat
        Banking();
      until(IsKeyDown(VK_F10));
    end.

    It will repeat the procedure until you press the F10 key
    Excellent.

  11. #11
    Join Date
    Feb 2007
    Location
    Het ademt zwaar en moedeloos vannacht.
    Posts
    7,211
    Mentioned
    26 Post(s)
    Quoted
    72 Post(s)

    Default

    Repeat loops can be nested like this, you don't have to create a new procedure (but for stuff like that it's good practice).
    Simba Code:
    program NoICantbebotheredToActuallyTestThis;
    var
      i, j : integer;
    begin
      i := 0;
      j := 0;
      repeat
        i := 0;
        writeln('This is loop 1');
        repeat
          i := i + 1;
          writeln('this is loop 2');
        until (i = 5);
        j := j + 1;
      until (j = 5);
    end.
    I made a new script, check 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
  •