Results 1 to 3 of 3

Thread: not click color. bit of help needed here

  1. #1
    Join Date
    Jan 2008
    Posts
    89
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default not click color. bit of help needed here

    Alright well here is my function:

    SCAR Code:
    function GoToField : boolean;
    var
      x, y, DTM : integer;
      angle : extended;
      spots : TPointArray;
      spts : Tpoint;
    begin
      Status('Going to flax field');
      MakeCompass('n');
      SetAngle(True);
      if InBank then
      begin
        RunOrNot;
        GameTab(4);
        DTM := SetToField1;
        if FindDTMRotated(DTM, x, y, MMX1, MMY1, MMX2, MMY2, radians(-35),
          radians(35), 0.06, angle) then
        begin
          FreeDTM(DTM);
          MouseFlag(x, y, 4, 4);
        end else FreeDTM(DTM);
        DTM := SetToField2;
        if FindDTMRotated(DTM, x, y, MMX1, MMY1, MMX2, MMY2, radians(-35),
          radians(35), 0.06, angle) then
        begin
          FreeDTM(DTM);
          MouseFlag(x, y, 4, 4);
        end else FreeDTM(DTM);
        //FindSymbolIn(x, y, 'rare trees', MMCY, MMX1, 661, 145);
        //MouseFlag(x+8+random(6), y+5+random(7), 6, 6);
        FindColorsTolerance(spots, 10444893, MMx1, MMy1, MMx2, MMy2, 35);
        if not(GetArrayLength(spots) > 5) then
          begin
            MouseFlag(643+random(8), 125+random(6), 25, 25);
            FindColorsTolerance(spots, 10444893, MMx1, MMy1, MMx2, MMy2, 35);
          end;
        spts := MiddleTPA(spots);
        MouseFlag(spts.x, spts.y, 5, 5);
        Result := (GetArrayLength(spots) >= 5);
      end;
    end;

    its my walk to field function for my flaxpicker, but if most of you know there is that building a bit southeast of that first tree symbol, the one north of the flax field, and what my second click does, is somtimes clicks the corner of that building, and i cant figure out how to make sure it does NOT click that color of the building, otherwise my script would be flawless....any ideas? here's a color reference 10335168

    thanks in advance,
    prince

  2. #2
    Join Date
    Mar 2007
    Posts
    4,810
    Mentioned
    3 Post(s)
    Quoted
    3 Post(s)

    Default

    You could use:

    Instead of

    SCAR Code:
    Mouse(x,y,0,0,true)

    This..

    SCAR Code:
    Mouse(x+5,y-5,0,0,true)

    Just need to experiment.

  3. #3
    Join Date
    Jun 2007
    Posts
    785
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    SCAR Code:
    Function FindFlaxCustom(var cx, cy: Integer; Text: TStringArray; Color: TIntegerArray; Tolerance: Integer): Boolean;
    var
      a, b, c, i, x1, y1, x2, y2, x3, y3: Integer;
      Start: Boolean;
    begin
      For b := 0 to (GetArrayLength(Color)-1) do
      Begin
        if (FindColorSpiralTolerance(cx, cy, color[b], MSX1, MSY1, MSX2, MSY2, Tolerance)) then
        Begin
          Start := True;
          Break;
        end;
      end;
      If(Start)then
      Begin
        x1 := 245;
        y1 := 165;
        x2 := 277;
        y2 := 185;
        repeat
          If not(LoggedIn)then
            break;
          a := a + 1;
          If (a = 1) then
            c := c + 1
          else If (a = 3) then
            c := c + 1;
          For i := 1 to c do
          Begin
            If (a = 1) then
            Begin
              x1 := x1 + 30;
              x2 := x2 + 30;
            end else
            If (a = 2) then
            Begin
              y1 := y1 - 20;
              y2 := y2 - 20;
            end else
            If (a = 3) then
            Begin
              x1 := x1 - 30;
              x2 := x2 - 30;
            end else
            If (a = 4) then
            Begin
              y1 := y1 + 20;
              y2 := y2 + 20;
            end;
            If (x1 = 485) and (x2 = 517) then
              x2 := x2 - 2;
            If (y1 = 325) and (y2 = 345) then
              y2 := y2 - 7;
            If (x2 > 515) then
              Break;
            For b := 0 to (GetArrayLength(Color)-1) do
            Begin
              If (FindColorTolerance(cx, cy, Color[b], x1, y1, x2, y2, tolerance)) then
              Begin
                if not FindColorTolerance(x3, y3, { other color on the flax  e.g blue} , (cx - 5), (cy - 5), (cx + 5), (cy + 5), 5) then
                begin
                  Result := False;
                end else
                begin
                  MMouse(cx, cy, 0, 0)
                  if (IsUpTextMultiCustom(Text)) then
                  Begin
                    Result := True;
                    Exit;
                  end;
                end;
              end;
            end;
          end;
          if (a = 4) then a := 0;
        until (x2 > 515) or (Result = True);
      end;
    end;

    Use that Function it searches for an extra color in range of 30 pix of the main color.

    you can fill it in exact right as FindObjCustom.

    Just make sure you add an extra color on the flax. ( watch the script)

    [22:20] <[-jesus-]> freddy, go uninstall yourself

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Find A color And Click
    By atmmaster2 in forum Outdated Tutorials
    Replies: 23
    Last Post: 12-22-2007, 04:47 PM
  2. How to make it click a color
    By RudeBoiAlex in forum OSR Help
    Replies: 5
    Last Post: 03-05-2007, 03:57 AM
  3. Click here if color is not equal to...
    By twobac in forum OSR Help
    Replies: 3
    Last Post: 02-15-2007, 07:50 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •