Results 1 to 3 of 3

Thread: Autocoloring

  1. #1
    Join Date
    Mar 2008
    Location
    Look behind you.
    Posts
    795
    Mentioned
    0 Post(s)
    Quoted
    1 Post(s)

    Default Autocoloring

    I came up with this autocoloring function:
    SCAR Code:
    function GraveYard: Boolean;
    var
      I, R, G, B, Len, TestColor: Integer;
      H, S, L, X, Y, Z: Extended;
      P: TPointArray;

    begin
      Result := False;
      FFlag(0);
      FindColorsSpiralTolerance(MMCX, MMCY, P, 1784393, MMX1, MMY1, MMX2, MMY2, 60);
      Len := High(P);
      for I := 0 to Len do
        if RS_OnMinimap(P[I].X, P[I].Y) then
        begin
          TestColor := GetColor(P[I].X, P[I].Y);
          ColorToRGB(TestColor, R, G, B);
          if InRange(R - B, 26, 66) then
            if InRange(R - G, -5, 35) then
              if InRange(G - B, 11, 51) then
              begin
                ColorToHSL(TestColor, H, S, L);
                if InRange(Round(H - L), -23, 7) then
                  if InRange(Round(S - H), 20, 50) then
                    if InRange(Round(S - L), 11, 41) then
                    begin
                      ColorToXYZ(TestColor, X, Y, Z);
                      if InRange(Round(X - Y), -7, 7) then
                        if InRange(Round(Y - Z), -4, 10) then
                        begin
                          Mouse(P[I].X, P[I].Y, 6, 6, True);
                          Result := True;
                          Exit;
                        end;
                    end;
              end;
        end;
      WriteLn('We didn''t find the graveyard color!');
    end;

    but i'm having this error:

    SCAR Code:
    Line 273: [Error] (17136:47): Type mismatch in script C:\Program Files (x86)\SCAR 3.20\Scripts\Ore Heroe.scar

    this is line 273:
    SCAR Code:
    If RadialWalk(GraveYard, 0, 360, 70, -1,-1) Then
    help, anyone? This is my first time autocoloring

  2. #2
    Join Date
    Dec 2008
    Posts
    2,813
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    GraveYard is a Boolean, not an integer

  3. #3
    Join Date
    Mar 2008
    Location
    Look behind you.
    Posts
    795
    Mentioned
    0 Post(s)
    Quoted
    1 Post(s)

    Default

    Quote Originally Posted by 99_ View Post
    GraveYard is a Boolean, not an integer
    I'm such an idiot ..

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
  •