Results 1 to 5 of 5

Thread: Dirt Color ?

  1. #1
    Join Date
    Mar 2007
    Posts
    1,223
    Mentioned
    0 Post(s)
    Quoted
    5 Post(s)

    Dirt Color ?

    Hey guys, I was wandering if anyone can help me with this? I want this script to go east of GE which it does and as some of you know if you go east there is a route to the varrock palace, so i want it to go east and click the dirt color, but my script only finds the dirt color and writes it in the debug box but it never clicks the color in the minimap.
    This is the script please help;
    SCAR Code:
    program Yewchopper;
    {.include SRL/SRL/misc/SMART.scar}
    {.include SRL/SRL.scar}

    var x, y : integer;

    const

      //Smart Setup//
      SmartWorld      = 118;   //  what world do you want to login to??
      Signed          = True;  // leave alone..

    procedure DeclarePlayers;
      begin
      HowManyPlayers :=1;  // how many players do you want
      NumberOfPlayers(HowManyPlayers);
      CurrentPlayer:=0
      Players[0].Name        := '';      //Character Name
      Players[0].Pass        := '';    //Character Pass
      Players[0].Nick        := '';     //Nickname 3 - 4 Letter's of char name
      Players[0].Active      := True;   //true if you want this player to be ran in the script false if you dont want it to run
    end;

    procedure SetupSmart;
    begin
      SmartSetupEx(SmartWorld, false, Signed);
      ClearDebug;
      WriteLn('Setting up Smart... Please Hold...');
      Wait(10000 + random(5000));
      SetTargetDC(SmartGetDC);
      While not(SmartReady) do Wait(100);
    end;

    Function GEFloorColor : Integer; // by Cazaz --- THANKS!
    var
      H,S,L,X,Y,Z : Extended;
      R,G,B,P,A,TestColor,xx,xy : Integer;
      TPA : TPointArray;
    begin
      if Not(LoggedIn) then Exit;
        xx:= MMCX;
        xy := MMCY;
        FindColorsSpiralTolerance(xx, xy, TPA, 6910322, MMX1, MMY1, MMX2, MMY2, 60)
        P := High(TPA);
        for A := 0 to P do
        begin
          if RS_OnMinimap(TPA[A].X, TPA[A].Y) then
          begin
            TestColor := GetColor(TPA[A].X, TPA[A].Y);
            if SimilarColors(TestColor, 6910322, 50) then
            begin
               ColorToRGB(TestColor, R, G, B);
               ColorToHSL(TestColor, H, S, L);
               ColorToXYZ(TestColor, X, Y, Z);
               if InRange(R - G, -9, 9) then
                 if InRange(R - B, 0, 17) then
                   if InRange(G - B, 1, 17) then
                     if InRange(Round(S) - Round(H), -23, 0) then
                       if InRange(Round(L) - Round(H), 16, 34) then
                         if InRange(Round(S) - Round(L), -57, -19) then
                           if InRange(Round(X) - Round(Y), -8, 6) then
                             if InRange(Round(Y) - Round(Z), -4, 6) then
                               if GetColor(TPA[A].X + 2, TPA[A].Y + 2) = TestColor then
                                 if GetColor(TPA[A].X + 1, TPA[A].Y + 1) = TestColor then
                                 begin
                                   Writeln('GEFloorColor = '+Inttostr(TestColor));
                                   Result := TestColor;
                                   Exit;
                                 end;
          end;
        end;
      end;
      Writeln('Couldnt find GEFloorColorColor!');
      Result := 0;
    end;


    Function myFindDirtRoadColor : Integer;  // Thanks for editing CAZAX! :)
    var
      H,S,L,X,Y,Z : Extended;
      R,G,B,P,A,TestColor,xx,xy : Integer;
      TPA : TPointArray;
    begin
      if Not(LoggedIn) then Exit;
        xx:= MMCX;
        xy := MMCY;
        FindColorsSpiralTolerance(xx, xy, TPA, 2513511, MMX1, MMY1, MMX2, MMY2, 60)
        P := High(TPA);
        for A := 0 to P do
        begin
          if RS_OnMinimap(TPA[A].X, TPA[A].Y) then
          begin
            TestColor := GetColor(TPA[A].X, TPA[A].Y);
            if SimilarColors(TestColor, 2513511, 50) then
            begin
               ColorToRGB(TestColor, R, G, B);
               ColorToHSL(TestColor, H, S, L);
               ColorToXYZ(TestColor, X, Y, Z);
               if InRange(R - G, -6, 29) then
                 if InRange(R - B, 30, 75) then
                   if InRange(G - B, 31, 64) then
                     if InRange(Round(S) - Round(H), 28, 48) then
                       if InRange(Round(L) - Round(H), 1, 21) then
                         if InRange(Round(S) - Round(L), 12, 44) then
                           if InRange(Round(X) - Round(Y), -8, 9) then
                             if InRange(Round(Y) - Round(Z), -4, 13) then
                               if GetColor(TPA[A].X + 2, TPA[A].Y + 2) = TestColor then
                                 if GetColor(TPA[A].X + 1, TPA[A].Y + 1) = TestColor then
                                 begin
                                   Writeln('DirtRoadColor = '+Inttostr(TestColor));
                                   Result := TestColor;
                                   Exit;
                                 end;
          end;
        end;
      end;
      Writeln('Couldnt find DirtRoadColor!');
      Result := 0;
    end;

    function Energy20: Boolean;
    var
      Colour: string;
      Level: Integer;
    begin
      Level := GetMMLevels('energy', Colour);
      Result := Level > 50;
    end;

    procedure WalktoYews;
    begin
      Status('setting up');
      SetAngle(True);
      MakeCompass('n');
      if Energy20 then
      begin
        SetRun(true);
      end;
      begin
        Status('Walking to yews');
        RadialWalk(GEFloorColor,80,100,65,-2,0);
        FFlag(0);
        if RadialWalk(myFindDirtRoadColor,70,110,65,-2,0)then
        begin
          FFlag(0);
        end else
        writeln('we arent at varrock');
        if RadialWalk(myFindDirtRoadColor,340,390,65,-2,0)then
        begin
          FFlag(0);
        end else
        writeln('we arent at varrock');
        FFlag(0);
        if FindSymbol(x,y,'tree')then
        Status('found tree symbol');
        begin
          Mouse(x,y,2,2,True);
        end;
      end;
    end;

    function FindTree(var tx, ty: Integer):boolean; //Made by Me :)...
    var
      i: integer;
      YewPoints: TPointArray;
      Yew2D : T2DPointArray;
      YewPoint : TPoint;
    begin
      if not LoggedIn then exit;
      x:= MSCX;
      y:= MSCY;
      begin
        FindColorsSpiralTolerance(tx,ty,YewPoints,2832993,MSX1,MSY1,MSX2,MSY2,6);
        Yew2D:= TPAtoATPAEx(YewPoints,3,3);
        for i:= 0 to length(Yew2D)-1 do
        begin
          if not LoggedIn then exit;
          Yewpoint:= MiddleTPA(Yew2D[i]);
          tx:= YewPoint.X;
          ty:= YewPoint.Y;
          MMouse(tx,ty,2,2);
          wait(90+random(50));
          if isuptext('hop')then
          begin
            GetMousePos(tx,ty);
            result:= true;
            Exit;
          end else Continue;
        end;
      end;
    end;


    begin
      SetupSmart;
      SetupSRL;
      DeclarePlayers;
      LoginPlayer;
      WalktoYews;
    end.

  2. #2
    Join Date
    Nov 2007
    Location
    Chile
    Posts
    1,901
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    It find the color, but it doesnt click. that means the angles you set arent right.


  3. #3
    Join Date
    Mar 2007
    Posts
    1,223
    Mentioned
    0 Post(s)
    Quoted
    5 Post(s)

    Default

    Angles what do you mean? Please describe using the script posted?
    It doesn't click I don't know why please help!

  4. #4
    Join Date
    Dec 2006
    Location
    Boss central
    Posts
    811
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by faster789 View Post
    Angles what do you mean? Please describe using the script posted?
    It doesn't click I don't know why please help!


    Wat he means is that it finding the colors but your radial walk is wrong so remake and try different angles i think
    Being A Boss

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

    Default

    For RadialWalk its recommended that you make angles over 20 degrees,
    Also try one of SRL's auto color functions FindDirtRoadColor I think it is

    Hope I Helped

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Replies: 5
    Last Post: 07-31-2007, 07:23 PM
  2. dirt cheap money site..
    By joshie in forum RuneScape News and General
    Replies: 6
    Last Post: 05-28-2007, 04:47 AM
  3. Useing grass color as road color??????
    By ronny.m.p in forum OSR Help
    Replies: 7
    Last Post: 04-28-2007, 09:42 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
  •