Results 1 to 5 of 5

Thread: function FindKarajamaRoadColour: Integer;

  1. #1
    Join Date
    Dec 2006
    Location
    Sydney, New South Wales, Australia
    Posts
    4,603
    Mentioned
    15 Post(s)
    Quoted
    42 Post(s)

    Default function FindKarajamaRoadColour: Integer;

    function FindKarajamaRoadColour: Integer;

    This function automatically detects the Karajama Road colour. I've tested this on over 30 occasions (with over 20 logging in and out, and changing worlds ) and it works perfectly.

    This is for the Karajama Road Colour, that olive colour which represents the road in Karajama when you get off the wharf, which holds the boat from Port Sarim.

    Follow these instructions to include it into your script :
    Append (place at the last line) the following code into SRL\SRL\core\AutoColor.scar:
    scar Code:
    {*******************************************************************************
    function FindKarajamaRoadColour: Integer;
    by: Dan's The Man
    Description: Autodetecs the Karajama Road Colour on the Minimap
    *******************************************************************************}

    function FindKarajamaRoadColour: Integer;
    var
      TPA: TPointArray;
      i, bI, BakColour: Integer;
      Red, Green, Blue: Integer;
      TemporaryCTS: Integer;
    begin
      TemporaryCTS := GetColorToleranceSpeed;
      ColorToleranceSpeed(1);
      FindColorsSpiralTolerance(MMCX, MMCY, TPA, 1341335, MMX1, MMY1, MMX2, MMY2, 40);
      bI := High(TPA);
      if(bI + 1 > 0) then
      begin
        for i := 0 to bI do
        begin
          BakColour := GetColor(TPA[i].X, TPA[i].Y);
          ColorToRGB(BakColour, Red, Green, Blue);
          if(InRange(Red, 120, 175)) then
            if(InRange(Green, 80, 155)) then
              if(InRange(Blue, 10, 30)) then
                if(GetColor(TPA[i].X + 2, TPA[i].Y) = BakColour) then
                  if(GetColor(TPA[i].X, TPA[i].Y + 2) = BakColour) then
                    if(GetColor(TPA[i].X + 2, TPA[i].Y + 2) = BakColour) then
                      if(GetColor(TPA[i].X + 1, TPA[i].Y) = BakColour) then
                      begin
                        Result := BakColour;
                        Writeln('Found the Karajama Road Colour');
                        ColorToleranceSpeed(TemporaryCTS);
                        Exit;
                      end;
        end;
      end;
      Writeln('Could not find the Karajama Road Colour =(');
      ColorToleranceSpeed(TemporaryCTS);
    end;

    Enjoy
    Last edited by Daniel; 07-29-2009 at 02:51 PM.
    You may contact me with any concerns you have.
    Are you a victim of harassment? Please notify me or any other staff member.

    | SRL Community Rules | SRL Live Help & Chat | Setting up Simba | F.A.Q's |

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

    Default

    Looks good, but you might want to set the Result := -1; at the beginning, in case it doesn't find it. Good work, this should be added in AutoColor.Scar

  3. #3
    Join Date
    Dec 2006
    Location
    Sydney, New South Wales, Australia
    Posts
    4,603
    Mentioned
    15 Post(s)
    Quoted
    42 Post(s)

    Default

    Quote Originally Posted by NaumanAkhlaQ View Post
    Looks good, but you might want to set the Result := -1; at the beginning, in case it doesn't find it. Good work, this should be added in AutoColor.Scar
    Good idea, done
    You may contact me with any concerns you have.
    Are you a victim of harassment? Please notify me or any other staff member.

    | SRL Community Rules | SRL Live Help & Chat | Setting up Simba | F.A.Q's |

  4. #4
    Join Date
    Jul 2007
    Location
    Right now? Chair.
    Posts
    8,488
    Mentioned
    3 Post(s)
    Quoted
    12 Post(s)

    Default

    color has big changes not when you switch worlds, but when you re-load the client. Meaning you either re-load smart or the RS client.

    ~RM

    I & I know Zion. It is in the spirit, body and mind of every one of us
    RMouse(obj: TMSIObject): boolean;

  5. #5
    Join Date
    Dec 2006
    Location
    Sydney, New South Wales, Australia
    Posts
    4,603
    Mentioned
    15 Post(s)
    Quoted
    42 Post(s)

    Default

    Quote Originally Posted by Rasta Magician View Post
    color has big changes not when you switch worlds, but when you re-load the client. Meaning you either re-load smart or the RS client.

    ~RM
    Thanks, taken note Updated
    You may contact me with any concerns you have.
    Are you a victim of harassment? Please notify me or any other staff member.

    | SRL Community Rules | SRL Live Help & Chat | Setting up Simba | F.A.Q's |

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
  •