Results 1 to 10 of 10

Thread: How to repeat until true?

  1. #1
    Join Date
    Jan 2012
    Posts
    36
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default How to repeat until true?

    So I am making a port phasmatys cannonball smither.
    I won't go into any more details, I just want to loop FindDTM until it returns true.

    This is how I tried doing it:

    Simba Code:
    program PhasmatysBaller;
    {$i srl/srl.simba}
    {$i sps/sps.simba}

    //Global variables

    var

    Booth:Integer;
    Booth2:Integer;
    Booth3:Integer;
    clicklog:Integer;


    //End of global variables


    procedure bank;

    var

    x, y:Integer;

    begin

    Booth := DTMFromString('mWAAAAHicY2FgYPgExJyMDAz/gDQjkJYGYhkg1gBiESAurk1gqGxJYwiNU2WISDBgYAeqQ8aMaBgEAIzgBws=');
    Booth2 := DTMFromString('mWAAAAHicY2FgYPgBxLyMDAxfgLQAkPaBYlcoLq1PYqhqSWeISjJkCI/TZ2AHqkPGjGgYBADAVAfi');
    Booth3 := DTMFromString('mWAAAAHicY2FgYDgExLeB+CIQ3wLi50D8Aoi/AvE7IM7IC2HIL0lgCAwzYPALMmfgBoohY0Y0DAIAp2YLSg==');

    if FindDTM(Booth, x, y, MSX1, MSY1, MSX2, MSY2) or
        FindDTM(Booth2, x, y, MSX1, MSY1, MSX2, MSY2) or
          FindDTM(Booth3, x, y, MSX1, MSY1, MSX2, MSY2) then

    begin
    mouse(x, y, 3, 3, true);
    end;
    FreeDTM(Booth);
    FreeDTM(Booth2);
    FreeDTM(Booth3);
    end;


    //////////////////////////////////////////////////////////////////////

    function open:boolean;

    var
     x, y:Integer;
     clicklog:Integer;
     clicklog2:Integer;

     begin

     clicklog := DTMFromString('mbQAAAHicY2VgYGBhZGB4AaSfAbE0kC0PxFeA+CIQXwXi81D+zp07GFwKxBlUvLkYohtMGLSCeBg4gHrQMSMWDAYANr4LaQ==');
     clicklog2 := DTMFromString('mQwAAAHicY2ZgYGBhZGB4AaRlgPQlIL4MxBeB+N+/vwzWySIMTtliDIJAeRhmRMJAAABWvQgr');

     if FindDTM(clicklog, x, y, 26, 380, 480, 480) then
     begin
     result :=true;
     freeDTM(clicklog);
     freeDTM(clicklog2);
     end else
     result :=false;
     freeDTM(clicklog);
     freeDTM(clicklog2);
     end;

    //////////////////////////////////////////////////////////////////////


      procedure Clickgreen;

      var
       x, y:Integer;
       green:Integer;

       begin

       green := DTMFromString('mbQAAAHicY2VgYGBhZGB4AaSfAbE0kC0PxFeA+CIQXwXi81D+zp07GFwKxBlUvLkYohtMGLSCeBg4gHrQMSMWDAYANr4LaQ==');

       if FindDTM(Clicklog, x, y, 26, 380, 480, 480) then
       begin
       mouse(x, y, 4, 4, true);
       end;
       freeDTM(green);
       end;

    //////////////////////////////////////////////////////////////////


      procedure FindBar;


     var
      x, y:Integer;
      bar:Integer;

     begin

     bar := DTMFromString('mlwAAAHicY2dgYOiD4kYoPQ2KW4H4NBDfAOJLQHwCiE8C8VkgPgXEzbW1QJKJQVVZmSE5Ph7Mb29sBLO5gTK4MCMeDAUAnDMRBw==');

     if FindDTM(bar, x, y, 0, 0, 500, 328) then
    begin
    mouse(x, y, 2, 2, false);
    end;
    freeDTM(bar);
    end;

    /////////////////////////////////////////////////////////////////////






    begin
    SetUpSRL;

      bank

      wait(2000);

    repeat
    open;
    until(true);

    wait(1000 + random(201));
    Clickgreen
    wait(1000 + random(512));
    FindBar
    end.

    What am I doing wrong?

  2. #2
    Join Date
    Dec 2011
    Location
    Toronto, Ontario
    Posts
    6,424
    Mentioned
    84 Post(s)
    Quoted
    863 Post(s)

    Default

    Simba Code:
    repeat
      wait(10);
    until(findDTM(scnsdijnc));

  3. #3
    Join Date
    Nov 2011
    Location
    Louisiana
    Posts
    881
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    wouldn't it be...

    Simba Code:
    repeat
    wait(20);
    until(FindDTM);

    I could be wrong...

    Damnit Sin ninja'd me.

  4. #4
    Join Date
    Feb 2006
    Location
    Aussie
    Posts
    937
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Take clickGreen for example, how about:

    Simba Code:
    procedure Clickgreen;

    var
      x, y, green: Integer;

    begin
      green := DTMFromString('mbQAAAHicY2VgYGBhZGB4AaSfAbE0kC0PxFeA+CIQXwXi81D+zp07GFwKxBlUvLkYohtMGLSCeBg4gHrQMSMWDAYANr4LaQ==');
      repeat
        if FindDTM(Clicklog, x, y, 26, 380, 480, 480) then
        begin
         mouse(x, y, 4, 4, true);
        end;
      until(FindDTM(Clicklog, x, y, 26, 380, 480, 480));
      freeDTM(green);
    end;

    Might i also suggest giving http://villavu.com/forum/showthread.php?t=60288 a read through?

    EDIT: Ninja'd, also, i didn't read your post correctly, but from either three of the responses, you get the basic idea how to do it, and can apply it however you like.
    Last edited by Jagex_Fagex; 03-28-2012 at 02:36 PM.

  5. #5
    Join Date
    Dec 2011
    Location
    Berlin
    Posts
    795
    Mentioned
    0 Post(s)
    Quoted
    5 Post(s)

    Default

    Simba Code:
    repeat
      wait(10);
    until(findDTM(scnsdijnc));  // (scnsdijnc) there should be the name of your DTM i think

    I will try to answer all Runescape related questions!

  6. #6
    Join Date
    Dec 2011
    Location
    Toronto, Ontario
    Posts
    6,424
    Mentioned
    84 Post(s)
    Quoted
    863 Post(s)

    Default

    Nah, scnsdijnc are your parameters.

  7. #7
    Join Date
    Oct 2006
    Location
    finland, helsinki
    Posts
    2,501
    Mentioned
    3 Post(s)
    Quoted
    2 Post(s)

    Default

    repeat
    wait(10)
    until Open

    Code:
    • Narcle: I recall Jukka releasing a bunch of scripts like this before... Its how he rolls I think. rofl
    • Solarwind: Dude, you are like... t3h s3x.
    • Hy71194: JuKKa you're a machine! You released 3 scripts in 10 minutes! :O
    • benjaa: woah.... Jukka is the man Guildminer pwns all
    • NaumanAkhlaQ: And JuKKa Is my Her0!

  8. #8
    Join Date
    Nov 2011
    Location
    Louisiana
    Posts
    881
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by Imanoobbot View Post
    Simba Code:
    repeat
      wait(10);
    until(findDTM(scnsdijnc));  // (scnsdijnc) there should be the name of your DTM i think
    LOL. Why did you copy Sin's post word for word and just comment in the DTM line....

    -____-

  9. #9
    Join Date
    Dec 2011
    Location
    Toronto, Ontario
    Posts
    6,424
    Mentioned
    84 Post(s)
    Quoted
    863 Post(s)

    Default

    Currently Active Users Viewing This Thread: 10 (10 members and 0 guests)
    Sin, Home, Janilabo, JuKKa, masterBB, mixster, peetu, Runescape Pro, weeps, WT-Fakawi+
    Mother of god..

  10. #10
    Join Date
    Jan 2012
    Posts
    36
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Allright, thanks for the bunch of input. Now I should be able to complete my port phasmatys cannonballer.

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
  •