Results 1 to 3 of 3

Thread: How do I tell Simba to repeat something until it's found

  1. #1
    Join Date
    Mar 2013
    Posts
    94
    Mentioned
    0 Post(s)
    Quoted
    22 Post(s)

    Default How do I tell Simba to repeat something until it's found

    Basically how do I tell Simba to FindColorSpiralTolerance and repeat until it finds that color then allow me to use the color.

    How I do it now

    if FindColorSpiralTolerance(x,x,x,x,x,x,x,x) then
    writeLn('found the color')
    MoveMouse (x,x)

  2. #2
    Join Date
    Mar 2006
    Location
    Belgium
    Posts
    3,564
    Mentioned
    111 Post(s)
    Quoted
    1475 Post(s)

    Default

    Could use a "break" when you've found the colour.

    Simba Code:
    procedure IttyWitty;
    var
      x, y, Failsafe: Integer;

    begin
      Failsafe := 0;  // Resetting it to zero

    repeat
      if FindColorSpiralTolerance(x, y, 24352, MSX1, MSY1, MSX2, MSY2, 5) then
      begin
        Writeln('Found The Color');
        MMouse(x, y, 1, 1, True);
        Break;  // Breaks out of the loop and continues with the script.
      end else Failsafe := Failsafe +1 ;
      if Failsafe >= 10 then Break; // For not getting stuck in an inf. loop we add a failsafe.
      Wait(100); // To prevent lag we add a small wait.
    until(false)
    end;

    Creds to DannyRS for this wonderful sig!

  3. #3
    Join Date
    Mar 2013
    Posts
    94
    Mentioned
    0 Post(s)
    Quoted
    22 Post(s)

    Default

    thank you

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
  •