Results 1 to 5 of 5

Thread: How to Wait for and click a color when it appears?

  1. #1
    Join Date
    Aug 2010
    Posts
    122
    Mentioned
    0 Post(s)
    Quoted
    7 Post(s)

    Default How to Wait for and click a color when it appears?

    The goal here is to wait until the offer completes and turns green like this. When that happens, I want to click there.





    Here is what I tried and failed with:

    Code:
    Function FindCompleteNature: Boolean; //x, y, 1999423, 54, 168, 152, 175, 0, 1000000000) : True;
    var
    x, y : Integer;
    begin;
      writeln('Waiting for nature runes buy to complete');
      wait(500 + random (50));
    if FindColorSpiralTolerance(x, y, 1999423 , 54, 168, 152, 175, 0) then
    MoveMouse(x, y);
        begin
        writeln('wewt');
        Mouse(x, y, 0, 0, True);
        end;
    end;
    Apologies for being dumb @ coding.

  2. #2
    Join Date
    Mar 2012
    Location
    Color :D
    Posts
    938
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Simba Code:
    Function FindCompleteNature: Boolean; //x, y, 1999423, 54, 168, 152, 175, 0, 1000000000) : True;
    var
      x, y : Integer;
    begin;
      writeln('Waiting for nature runes buy to complete');
      repeat
        wait(500 + random (50));
        Antiban; //So it doesn't logout
      until FindColorSpiralTolerance(x, y, 1999423 , 54, 168, 152, 175, 0);

      if FindColorSpiralTolerance(x, y, 1999423 , 54, 168, 152, 175, 0) then
      begin
        MMouse(x, y, 3, 3);
        writeln('wewt');
        ClickMouse2(mouse_Left);
        Result := True;
      end;
    end;
    Last edited by CephaXz; 05-15-2012 at 05:31 PM.

  3. #3
    Join Date
    Aug 2010
    Posts
    122
    Mentioned
    0 Post(s)
    Quoted
    7 Post(s)

    Default

    Thank you very much!

    More questions to come I am sure.


  4. #4
    Join Date
    Jan 2008
    Location
    C:\
    Posts
    1,483
    Mentioned
    2 Post(s)
    Quoted
    2 Post(s)

    Default

    Quote Originally Posted by Mister Snow View Post
    The goal here is to wait until the offer completes and turns green like this. When that happens, I want to click there.

    Code:
    Function FindCompleteNature: Boolean; //x, y, 1999423, 54, 168, 152, 175, 0, 1000000000) : True;
    var
    x, y : Integer;
    begin;
      writeln('Waiting for nature runes buy to complete');
      wait(500 + random (50));
    if FindColorSpiralTolerance(x, y, 1999423 , 54, 168, 152, 175, 0) then
    MoveMouse(x, y);
        begin
        writeln('wewt');
        Mouse(x, y, 0, 0, True);
        end;
    end;
    Try this out:
    Simba Code:
    function FindCompleteNature(WaitFor: Integer): Boolean;
    var
      x, y : Integer;
      t: Integer;
    begin
      Result := False;
      Writeln('Waiting for nature runes buy to complete');
      MarkTime(t);
      repeat
        if FindColorSpiralTolerance(x, y, 1999423, 54, 168, 152, 175, 1) then
        begin
          Result := True;
          Break;
        end;
        Wait(1000 + Random(500));
      until(TimeFromMark(t) > WaitFor);
      if Result then
        Mouse(x, y, 3, 3, True);
    end;

    That should do the trick

  5. #5
    Join Date
    Aug 2007
    Location
    Colorado
    Posts
    7,421
    Mentioned
    268 Post(s)
    Quoted
    1442 Post(s)

    Default

    We have this nifty function:
    Simba Code:
    function WaitFindColor(var X, Y: Integer; Color, x1, y1, x2, y2, Tol, MaxTime: Integer): Boolean;

    Current projects:
    [ AeroGuardians (GotR minigame), Motherlode Miner, Blast furnace ]

    "I won't fall in your gravity. Open your eyes,
    you're the Earth and I'm the sky..."


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
  •