Results 1 to 22 of 22

Thread: Radial walk

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

    Default Radial walk

    the radial walk function doesn't have any tolerance how can i found a way around that??

  2. #2
    Join Date
    Oct 2007
    Location
    Denmark
    Posts
    409
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    We also have the RadialWalkEx.
    pascal Code:
    function RadialWalkEx(var tpa: TPointArray; cx, cy, TheColor, tol: Integer; StartRadial, EndRadial: Integer; Radius: Integer): Boolean;

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

    Default

    wow nice function really nice thx

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

    Default

    how do i use it ?

  5. #5
    Join Date
    Mar 2008
    Location
    ::1
    Posts
    915
    Mentioned
    0 Post(s)
    Quoted
    1 Post(s)

    Default

    If you looked in the SRL include's code, you would see that RadialWalkEx does not walk to a place but rather returns the points of the color that it finds to the first argument, a TPA. So, that TPA would contain the points where it found the color (with tolerance). this might help.
    SCAR Code:
    {*******************************************************************************
    function RadialWalkEx(var tpa: TPointArray; cx, cy, TheColor, tol: Integer; StartRadial, EndRadial: Integer; Radius: Integer): Boolean;
    By: Nielsie95
    Description: Finds TheColor from StartRadial to EndRadial for Radius Distance.
    Valid Arguments:
    tpa: Result points.
    StartRadial/EndRadial: Any number between 0-720. 0=N,90=E,180=S,270=W.
    Radius: Distance from the centre of minimap, i.e. how far away the mouse clicks. Use numbers 20-72
    *******************************************************************************}

    Records and Types Save Code (and make you look better)
    Quote Originally Posted by Wizzup? View Post
    Is it possible to make Runescape a 2D game with this?... That would greatly simplify... Just about anything.

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

    Default

    so i have to make a tpa containing colors then use radialex?

  7. #7
    Join Date
    Feb 2007
    Location
    Access Violation at 0x00000000
    Posts
    2,865
    Mentioned
    3 Post(s)
    Quoted
    18 Post(s)

    Default

    Learn TPA's first if you use RadialEx.
    But RadialWalk is best used with an AutoColor function. If you learn TPA's you can easily make your own AutoColor function.
    Ce ne sont que des gueux


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

    Default

    i already tried auto coloring didn't work for me

  9. #9
    Join Date
    Feb 2007
    Location
    Access Violation at 0x00000000
    Posts
    2,865
    Mentioned
    3 Post(s)
    Quoted
    18 Post(s)

    Default

    What exactly are you trying to autocolor?
    Ce ne sont que des gueux


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

    Default

    im in alkharid doing smithing so i'm trying to auto color the pink part of bank

  11. #11
    Join Date
    Feb 2007
    Location
    Access Violation at 0x00000000
    Posts
    2,865
    Mentioned
    3 Post(s)
    Quoted
    18 Post(s)

    Default

    You mean on the main screen or on the minimap?
    Like the carpet inside of there? Or just the colour of the bank on the MM?

    I might be able to whip something up for you..
    Ce ne sont que des gueux


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

    Default

    im trying on the mm

  13. #13
    Join Date
    Feb 2007
    Location
    Access Violation at 0x00000000
    Posts
    2,865
    Mentioned
    3 Post(s)
    Quoted
    18 Post(s)

    Default

    You could try making a bitmap of a small piece of it, then use AutoColorThis(); with it. U can set tol there I believe.
    Ce ne sont que des gueux


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

    Default

    nice, but i would still wan to learn how to use radialwalkex no need for details just brief cud u do that for me plz?

  15. #15
    Join Date
    Feb 2007
    Location
    Access Violation at 0x00000000
    Posts
    2,865
    Mentioned
    3 Post(s)
    Quoted
    18 Post(s)

    Default

    If you look in SRL/SRL/Core/MapWalk.scar, you'll see that in the RadialWalk function they use RadialWalkEx too, but use "0" as tolerance.
    I've changed it a little and renamed it here:

    SCAR Code:
    {*******************************************************************************
    function RadialWalkTol(TheColor, Tol: Integer; StartRadial, EndRadial: Integer; Radius: Integer; Xmod, Ymod: Integer): Boolean;
    By: Nielsie95 (Tol added by Floor66)
    Description: Walks TheColor from StartRadial to EndRadial for Radius Distance
    Valid Arguments:
    TheColor: Any Color, but Road- or WaterColor will do fine :)
    StartRadial/EndRadial: Any number between 0-720. 0=N,90=E,180=S,270=W.
    Radius: Distance from the centre of minimap, i.e. how far away the mouse clicks. Use numbers 20-72
    XMod, YMod: deviation from MouseFindFlag. -2 to 2.
    *******************************************************************************}


    function RadialWalkTol(TheColor, Tol: Integer; StartRadial, EndRadial: Integer; Radius: Integer; Xmod, Ymod: Integer): Boolean;
    var
      tpa: TPointArray;
      i: Integer;
    begin
      Result := False;
      if RadialWalkEx(tpa, MMCX, MMCY, TheColor, Tol, StartRadial, EndRadial, Radius) then
        for i := 0 to High(tpa) do
          if MFNF(tpa[i].x, tpa[i].y, Xmod, Ymod) then
          begin
            FFlag(10);
            Result := True;
            Break;
          end;
    end;

    By the way:
    SCAR Code:
    Function AutoColorAKB: Integer;
    Var
      ThePoints : TPointArray;
      Groups : T2DPointArray;
      x, y, i, j : Integer;
    Begin
      j := GetColorToleranceSpeed;
      ColorToleranceSpeed(2);
      FindColorsTolerance(ThePoints, 6130339, MMX1, MMY1, MMX2, MMY2, 8);
      If Length(ThePoints) = 0 Then
      Begin
        WriteLn('AutoColorAKB failed.');
        ColorToleranceSpeed(j);
        Exit;
      End;
      Groups := TPAtoATPAEx(ThePoints, 10, 10);
      For i := 0 To High(Groups) Do
      Begin
        MiddleTPAEx(Groups[i], x, y);
        Result := GetColor(x, y);
        If Result <> -1 Then
        Begin
          WriteLn('BankColor = '+ IntToStr(GetColor(x, y)) +' at ('+ IntToStr(x) +', '+ IntToStr(y) +')');
          ColorToleranceSpeed(j);
          Exit;
        End;
      End;
      WriteLn('AutoColorAKB failed.');
      ColorToleranceSpeed(j);
    End;

    This works anyway ^^. No tol needed, just works with RadialWalk.
    Ce ne sont que des gueux


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

    Default

    hackncrack, please take the time to find the edit button at the bottom left of your post instead of posting twice in a row

    ~RM

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

  17. #17
    Join Date
    Jan 2008
    Location
    Ontario, Canada
    Posts
    7,805
    Mentioned
    5 Post(s)
    Quoted
    3 Post(s)

    Default

    hackncrack, You should look at using AutoColor Aid in the SRL include. It would let you make autocoloring functions very easily.
    Writing an SRL Member Application | [Updated] Pascal Scripting Statements
    My GitHub

    Progress Report:
    13:46 <@BenLand100> <SourceCode> @BenLand100: what you have just said shows you 
                        have serious physchological problems
    13:46 <@BenLand100> HE GETS IT!
    13:46 <@BenLand100> HE FINALLY GETS IT!!!!1

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

    Default

    ty for ur time guys but again i failed an in ned of ur help i tried this:
    SCAR Code:
    program Smither;
    {.include srl/srl.scar}

    Function AutoColor: integer;

    var
    TPA: TPointArray;
    ATPA: T2DPointArray;
    x, y, i, H, CTS: integer;

    Begin
     CTS := GetColorToleranceSpeed;
     ColorToleranceSpeed(2);
     FindColorsTolerance(TPA, 6454956, MMX1, MMY1, MMX2, MMY2, 15);
     If Length(TPA) = 0 Then  FindColorsTolerance(TPA, 5864095, MMX1, MMY1, MMX2, MMY2, 15);
     If Length(TPA) = 0 Then  FindColorsTolerance(TPA, 5861788, MMX1, MMY1, MMX2, MMY2, 15);
     If Length(TPA) = 0 Then  FindColorsTolerance(TPA, 6590128, MMX1, MMY1, MMX2, MMY2, 15);
     If Length(TPA) = 0 Then  FindColorsTolerance(TPA, 6326698, MMX1, MMY1, MMX2, MMY2, 15);
     If Length(TPA) = 0 Then
      begin
        Writeln('I give up, Exiting...');
        ColorToleranceSpeed(CTS);
        Exit;
      end;
       ATPA := TPAtoATPAEx(TPA, 10, 10)
       H := High(ATPA);
       For i := 0 to H Do
        begin
         MiddleTPAEx(ATPA[i], x, y);
         Result := GetColor(x, y);
         IF Result <> -1 Then
          begin
           Writeln('AutoColor = ' + IntToStr(GetColor(x,y)) + ' .');
           ColorToleranceSpeed(CTS);
           Exit;
          end;
        end;
     Writeln('AutoColoring Failed!');
     ColorToleranceSpeed(CTS);
    End;

    begin
    ClearDebug;
    SetupSRL;
    ActivateClient;
    Wait(1000);
    AutoColor;
    RadialWalk(AutoColor, 173, 220, 72, -1, 1);
    end.
    it didnt click the bank it clicked the kebab store,what is hapening???

  19. #19
    Join Date
    Mar 2007
    Posts
    1,700
    Mentioned
    0 Post(s)
    Quoted
    8 Post(s)

    Default

    FindColorsTolerance returns a boolean, so you don't need to check the length every time you call the function.
    SCAR Code:
    if not FindColorsTolerance(TPA, 6454956, MMX1, MMY1, MMX2, MMY2, 15) then
      if not FindColorsTolerance(TPA, 5864095, MMX1, MMY1, MMX2, MMY2, 15) then
        if not FindColorsTolerance(TPA, 5861788, MMX1, MMY1, MMX2, MMY2, 15) then
          if not FindColorsTolerance(TPA, 6590128, MMX1, MMY1, MMX2, MMY2, 15) then
            if not FindColorsTolerance(TPA, 6326698, MMX1, MMY1, MMX2, MMY2, 15) then
            begin
              Writeln('I give up, Exiting...');
              ColorToleranceSpeed(CTS);
              Exit;
            end;
    Either way, it would probably be better to find a median color of all of those, and make use of the SetColorspeed2Modifiers function.
    Also, your result will always be true, because no color picked off of the client will be -1. It will always be between 0 and 16777215.

    If you're trying to click inside a shop, the easiest way to do so would probably be symbol finding. More info here.

    Check out autocoloring in the tutorial island. ACA and this tutorial will help.
    Last edited by lordsaturn; 03-22-2009 at 07:59 PM.

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

    Default

    well il check out the tut later now im going to eat and im trying to click at the oink part of bank in alkharid directly from what i can see wen at smithing place on MM, and thx for ur help

  21. #21
    Join Date
    Mar 2008
    Location
    ::1
    Posts
    915
    Mentioned
    0 Post(s)
    Quoted
    1 Post(s)

    Default

    If you're looking for a good TPA tutorial, The Almighty TPA Tutorial is the way to go IMO.

    Records and Types Save Code (and make you look better)
    Quote Originally Posted by Wizzup? View Post
    Is it possible to make Runescape a 2D game with this?... That would greatly simplify... Just about anything.

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

    Default

    ok i have read the auto color tut, but however there are times when the color changes and its way too far from my range of colors set, how can i solve that?
    never mind found what to do didn't realise that somebody has asked this srry!!
    Last edited by hackncrack1; 04-17-2009 at 02:00 PM.

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
  •