Results 1 to 2 of 2

Thread: Help with autocolour

  1. #1
    Join Date
    Aug 2008
    Location
    Auckland
    Posts
    132
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Help with autocolour

    Guys im struggling with autocolour, shuttleu showed me most of it, so i know how to do the colours ect. But when I run my script it displays the error, "colour not found" is this because I clicked on minimap, instead of whole client. Because I think thats the problem, help would be appreciated.
    SCAR Code:
    function TinColour: Integer;
    var
      arP: TPointArray;
      arC: TIntegerArray;
      tmpCTS, i, arL: Integer;
      H, S, L: Extended;
      X, Y, Z: Extended;
    begin
      tmpCTS := GetColorToleranceSpeed;
      ColorToleranceSpeed(1);

      FindColorsSpiralTolerance(MMCX, MMCY, arP, 10000547, MMX1, MMY1, MMX2, MMY2, 7);
      if (Length(arP) = 0) then
      begin
        Writeln('Failed to find the color, no result.');
        ColorToleranceSpeed(tmpCTS);
        Exit;
      end;

      arC := GetColors(arP);
      ClearSameIntegers(arC);
      arL := High(arC);

      for i := 0 to arL do
      begin
        ColorToHSL(arC[i], H, S, L);

        if (H >= 0.00) and (H <= 1.41) and (S >= 5.40) and (S <= 6.40) and (L >= 60.18) and (L <= 63.16) then
        begin
          ColorToXYZ(arC[i], X, Y, Z);

          if (X >= 30.21) and (X <= 33.76) and (Y >= 30.67) and (Y <= 34.38) and (Z >= 32.32) and (Z <= 35.88) then
          begin
            Result := arC[i];
            Writeln('AutoColor = ' + IntToStr(arC[i]));
            Break;
          end;
        end;
      end;

      ColorToleranceSpeed(tmpCTS);

      if (i = arL + 1) then
        Writeln('AutoColor failed in finding the color.');
    end;


    function CopperColour: Integer;
    var
      arP: TPointArray;
      arC: TIntegerArray;
      tmpCTS, i, arL: Integer;
      R, G, B: Integer;
      X, Y, Z: Extended;
    begin
      tmpCTS := GetColorToleranceSpeed;
      ColorToleranceSpeed(2);
      SetColorSpeed2Modifiers(0.16, 0.26);

      FindColorsSpiralTolerance(MMCX, MMCY, arP, 8498363, MMX1, MMY1, MMX2, MMY2, 29);
      if (Length(arP) = 0) then
      begin
        Writeln('Failed to find the color, no result.');
        ColorToleranceSpeed(tmpCTS);
        SetColorSpeed2Modifiers(0.2, 0.2);
        Exit;
      end;

      arC := GetColors(arP);
      ClearSameIntegers(arC);
      arL := High(arC);

      for i := 0 to arL do
      begin
        ColorToRGB(arC[i], R, G, B);

        if (R >= 115) and (R <= 237) and (G >= 83) and (G <= 237) and (B >= 53) and (B <= 226) then
        begin
          ColorToXYZ(arC[i], X, Y, Z);

          if (X >= 11.02) and (X <= 78.20) and (Y >= 10.30) and (Y <= 83.28) and (Z >= 4.88) and (Z <= 83.19) then
          begin
            Result := arC[i];
            Writeln('AutoColor = ' + IntToStr(arC[i]));
            Break;
          end;
        end;
      end;

      ColorToleranceSpeed(tmpCTS);
      SetColorSpeed2Modifiers(0.2, 0.2);

      if (i = arL + 1) then
        Writeln('AutoColor failed in finding the color.');
    end;
    Heres both of them, I think the problems to do when I toggled the minimap but anyway.
    ~Tom~

  2. #2
    Join Date
    Oct 2008
    Location
    C:\Simba\Includes\
    Posts
    7,566
    Mentioned
    19 Post(s)
    Quoted
    180 Post(s)

    Default

    Well looks like to me that you're trying to find the color of tin and copper in the mainscreen. Having it look in the minimap rather than the mainscreen. Change the MM's to MS. Besides that it looks great. That should work. Hope this helps.

    ~Camo
    Away for awhile, life is keeping me busy. | Want to get my attention in a thread? @Kyle Undefined; me.
    { MSI Phoenix || SRL Stats Sigs || Paste || Scripts || Quotes || Graphics }

    When posting a bug, please post debug! Help us, help you!

    I would love to change the world, but they won't give me the source code. || To be the best, you've got to beat the rest. || Logic never changes, just the syntax.
    If you PM me with a stupid question or one listed in FAQ, or about a script that is not mine, I will NOT respond.


    SRL is a Library of routines made by the SRL community written for the Program Simba. We produce Scripts for the game Runescape.


Thread Information

Users Browsing this Thread

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

Similar Threads

  1. AutoColour is 100% failing.
    By HarryJames in forum OSR Help
    Replies: 12
    Last Post: 01-28-2009, 06:49 PM
  2. Best way to autocolour roads?
    By Ruski in forum OSR Help
    Replies: 2
    Last Post: 07-31-2008, 06:03 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
  •