Results 1 to 6 of 6

Thread: autocolor function not working

  1. #1
    Join Date
    Aug 2008
    Location
    !!LOL!!
    Posts
    247
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default autocolor function not working

    Here is my function:
    SCAR Code:
    program new;
    {.include srl/srl.scar}
    Function BankAutoColor: Integer;

    Var
    i, GC, RED, Blue, Green, TestColor: Integer;
    H, L, S: Extended;
    P: TPointArray;

    Begin
     GC := 6062752;
     FFlag(0);
     FindColorsSpiralTolerance(MMCX, MMCY, P, GC, MMX1, MMY1, MMX2, MMY2, 40);
     For i := 0 To High(P)-1 Do
      begin
       If RS_OnMinimap(P[i].x,P[i].y) Then
        begin
          TestColor := GetColor(P[i].x,P[i].y);
          ColorToRGB(TestColor, Red, Green, Blue);
          ColorToHSL(TestColor, H, S, L);
          If InRange(Red - Blue, 58, 78) Then
          If InRange(Red - Green, 24, 59) Then
          If InRange(Green - Blue, 11, 44) Then
             If InRange(Round(H - L), -34, 53) Then
             If InRange(Round(S - H), 40, 14) Then
             If InRange(Round(S - L), -27, -13) Then
               If GetColor(P[i].x + 2, P[i].y + 2) = TestColor Then
               If GetColor(P[i].x + 1, P[i].y + 1) = TestColor Then
               If GetColor(P[i].x, P[i].y + 2) = TestColor Then
               If GetColor(P[i].x + 2, P[i].y) = TestColor Then
               If GetColor(P[i].x, P[i].y + 1) = TestColor Then
               If GetColor(P[i].x + 1, P[i].y) = TestColor Then
               If GetColor(P[i].x + 2, P[i].y + 1) = TestColor Then
               If GetColor(P[i].x + 1, P[i].y + 2) = TestColor Then
                 begin
                   Result := TestColor;
                   Writeln('BankAutoColor = '+ IntToStr(Result) + '.');
                   Exit;
                 end;
        end;
      end;
     WriteLn('Couldnt Find BankAutoColor =(!');
     Result := 0;
    End;

    Begin
    SetupSRL;
    ActivateClient;
    Wait(1000);
    ClearDebug;
    BankAutocolor;
    End.
    it never finds the color i want is their something wrong with it?

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

    Default

    Did you use ACA? SRL/SRL/Scripting Tools/Auto Color Aid v2

  3. #3
    Join Date
    Aug 2008
    Location
    !!LOL!!
    Posts
    247
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    no i did my this folowing a tutorial

  4. #4
    Join Date
    Jan 2008
    Location
    NC, USA.
    Posts
    4,429
    Mentioned
    0 Post(s)
    Quoted
    4 Post(s)

    Default

    Try expanding your ranges IN CERTAIN SPOTS.
    Some ranges will be fine, some will not.
    What are you trying to autocolour?
    Quote Originally Posted by irc
    [00:55:29] < Guest3097> I lol at how BenLand100 has become noidea
    [01:07:40] <@BenLand100> i'm not noidea i'm
    [01:07:44] -!- BenLand100 is now known as BenLand42-
    [01:07:46] <@BenLand42-> shit
    [01:07:49] -!- BenLand42- is now known as BenLand420
    [01:07:50] <@BenLand420> YEA

  5. #5
    Join Date
    Dec 2006
    Location
    Canada, BC
    Posts
    728
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    hey i use a differant way to autocolor, (i asume you mean for like a path color or something on the minimap?)

    as you know every time you log in and out the colors in the minimap change alittle bit, so you pretty much just log in and out a few times and select 3 or 4 colors of the path or w/e you want to autocolor for. then put them into Color := [];

    I dont realy know if this is any better or worse than doing the traditional AutoColor thing, but so far its worked 100% for me

    SCAR Code:
    Function FindBankColor : Integer;
    var
      Color : TIntegerArray;
      TPA : TPointArray;
      Position : TPoint;
      x, y, i, maxTol, tol : Integer;

    begin
      if not LoggedIn then Exit;
      maxTol := 50;
      tol := 15 ;
      Color := [6062752, 6062752, 6062752, 6062752];
      for i := 0 to 3 do
      repeat
       if FindColorsTolerance(TPA, Color[i], 627, 40, 685, 102, tol) then
        begin
          for i := 0 to High(TPA) do
          begin
            Position := TPA[i];
            Result := GetColor(Position.x, Position.y);
            Writeln('BankColor(' + IntToStr(Position.x) + ', ' + IntToStr(Position.y) + '): ' + IntToStr(Result));
            Writeln('Tolerance: ' + IntToStr(tol));
            Exit;
          end;
        end else
        begin
          tol := tol + 10;
        end;
      until(tol >= maxTol);
      Writeln('Could Not Find BankColor');
    end;
    Lance. Da. Pants.

  6. #6
    Join Date
    Aug 2008
    Location
    !!LOL!!
    Posts
    247
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    @no idea im trying to autocolor the pink part of the bank on the minimap in alkharid but could u explain abit more about the range changing it in some spots plz?
    @lance thx ill see what i can do
    ok it finally worked wat i did is change some ranges in the hsl ranges and it worked, could somebody teach me how to work out the best ranges plz for future purposes! thanks
    well i really need some1 to tell me how to work out the ranges becoz i tried reloading rs and it chose wrong color and also what generic color shud i choose and thank you for ur time
    Last edited by hackncrack1; 05-03-2009 at 01:37 PM. Reason: problem still unsolved

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
  •