Page 1 of 4 123 ... LastLast
Results 1 to 25 of 81

Thread: A brief lesson on RadialWalk

  1. #1
    Join Date
    Feb 2006
    Location
    Amsterdam
    Posts
    6,136
    Mentioned
    28 Post(s)
    Quoted
    17 Post(s)

    Default A brief lesson on RadialWalk

    RadialWalk is a High Level Map Walker. It finds a color in any given direction, plants the flag and waits until the flag is within a fixed distance of the minimapcenter, in other words, it walks towards the flag. RadialWalk combines three low level routines: color-finding, mapwalking and flag waiting.

    RadialWalk uses simple geometry to scan for TheColor. It works with arcs, slices of a circle. It scans the MiniMap both clockwise and counterclockwise. While this may seem futile, it is yet the most powerful feature of RadialWalk. With the clockwise/counterclockwise setting, you can give the function "direction tendencies".


    See Picture 1.


    RadialWalk examples


    1.RadialWalk(TheColor,0,90,70,xmod,ymod)
    This will scan TheColor from North to East, starting at 70 distance and ending at the MiniMap Center (MMCX and MMCY)

    2.RadialWalk(TheColor,0,90,40,xmod,ymod)
    This will scan from North to East, starting at 40 distance and ending at the MiniMap Center.

    3.RadialWalk(TheColor,90,0,70,xmod,ymod)
    This will scan from East to North, starting at 70 distance and ending at the MiniMap Center.

    4.RadialWalk(TheColor,90,0,40,xmod,ymod)
    This will scan from East to North, starting at 40 distance and ending at the MiniMap Center.

    5.RadialWalk(TheColor,320,400,40,xmod,ymod)
    This will scan from NorthEast to NorthWest, starting at 70 distance and ending at the MiniMap Center.

    6.RadialWalk(TheColor,320,400,40,xmod,ymod)
    This will scan from NorthEast to NorthWest, starting at 40 distance and ending at the MiniMap Center.

    7.RadialWalk(TheColor,320,400,40,xmod,ymod)
    This will scan from NorthEast to NorthWest, starting at 20 distance and ending at the MiniMap Center.

    8,9 and 10. Scan from NorthWest to NortEast
    .

    11.RadialWalk(TheColor,160,200,70,xmod,ymod)
    This will scan from SouthSouthEastto SouthSouthWest, starting at 70 distance and ending at the MiniMap Center.

    12.RadialWalk(TheColor,200,160,70,xmod,ymod)
    This will scan from SSWto SSE, starting at 70 distance and ending at the MiniMap Center.

    13.RadialWalk(TheColor,10,200,70,xmod,ymod)
    This will scan from NNEto SSW, starting at 70 distance and ending at the MiniMap Center.

    13 and 14.. Here you can clearly see the difference in behaviour. While 13 will move your player in an Upwards direction, 14 does the exact opposite; it moves your Player Downwards, since it starts scanning at the bottom halve of the Minimap.

    to complete the Picture:

    16. Scans from WNW to E, 17 from E to WNW. 18 and 19 from WSW to N with different Radius. 20 and 21 from SW to NW and reverse


    This is how it is described inside the Manual:

    function RadialWalk(TheColor: Integer; StartRadial, EndRadial: Integer; Radius: Integer; Xmod, Ymod: integer): Boolean;
    By: WT-Fakawi & Wizzup?
    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 -360 to 1440. 0=N,90=E,180=S,270=W. DO NOT USE NUMBERS UNDER -360 or ABOVE 1440
    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.



    TheColor
    This argument is pretty self-explanatory. It is the color we are looking for. No furhter explanation is needed, I hope.


    StartRadial/EndRadial

    I guess by now you know what they do...

    Radius
    Distance from Minimap Center where the scanning BEGINS. RadialWalk works inwards: it starts at radius and scans towards the center.

    Xmod/Ymod
    The deviation from MouseFindFlag. RadialWalk uses MouseFindFlag to place the flag on the minimap. MouseFindFlag will click as long as it takes on the minimap until the flag appears. It will add Xmod and Ymod to each click. Fill in 1,1 for Xmod and Ymod, and the mouse will gradually move to the lower right corner of the minimap one pixel each click. See the table below.

    MouseFindFlag deviations.

    To end, here is a working example of a Special Version RadialWalk inside a small script. Use it with Paint. Set Paint a target window, select the pen, and run the script! It will demonstrate the use of RadialWalk.

    I have also enclosed some working examples of Special VersionLinearWalk, the "WindScreen" scanner.

    Code:
    program RadialWalk;
    
    var x, y:integer;
    
    //----------------------------------------------------------------------------//
    
    function RadialWalk(TheColor:Integer; StartRadial, EndRadial:Integer; Radius:Integer; Xmod, Ymod:integer): Boolean;// By Wizzup? and WT-Fakawi.
    
    var i: Integer;
    var X1, Y1: integer;
    begin
    
      if StartRadial < EndRadial then
         begin
           repeat
               for i:=StartRadial to EndRadial do
                  begin
                     X1:=Round (  Radius * Sin (i * Pi / 180)) + 646;
                     Y1:=Round (- Radius * Cos (i * Pi / 180)) + 84;
                     MoveMouse(X1, Y1);
                     HoldMouse(X1, Y1, True);
                     ReleaseMouse(X1, Y1, True);
                  end
              Radius:= Radius - 4;
            until Radius <= 1 ;
          end
    
      if StartRadial > EndRadial then
         begin
           repeat
               for i:=StartRadial Downto EndRadial do
                  begin
                     X1:=Round (  Radius * Sin (i * Pi / 180)) + 646;
                     Y1:=Round (- Radius * Cos (i * Pi / 180)) + 84;
                     MoveMouse(X1, Y1);
                     HoldMouse(X1, Y1, True);
                     ReleaseMouse(X1, Y1, True);
                     end
             Radius := Radius - 4;
           until Radius <= 1;
          end
    end;
    
    //----------------------------------------------------------------------------//
    
    function LinearWalk(TheColor : Integer; Direction : Integer; Radius : Integer; Xmod, Ymod : Integer) : Boolean;// By Wizzup? and WT-Fakawi.
    
    var
      i, j, StartRadial, EndRadial, InitRadius : Integer;
    var
      X1, Y1, Count : Integer;
    begin
    
      InitRadius := Radius;
    
      repeat
        StartRadial := 360 + Direction - Count;
        EndRadial   := 360 + Direction + Count;
        repeat
          for i := StartRadial to EndRadial do
          begin
                   X1:=Round (  Radius * Sin (i * Pi / 180)) + 646;
                   Y1:=Round (- Radius * Cos (i * Pi / 180)) + 84;
                   MoveMouse(X1, Y1);
                   HoldMouse(x1, y1, True);
                   ReleaseMouse(x1, y1, True);
          end;
          for i := EndRadial downto StartRadial do
          begin
                   X1:=Round (  Radius * Sin (i * Pi / 180)) + 646;
                   Y1:=Round (- Radius * Cos (i * Pi / 180)) + 84;
                   MoveMouse(X1,Y1);
                   HoldMouse(X1, Y1, True);
                   ReleaseMouse(X1, Y1, True);
          end;
          Radius := Radius - 4;
        until Radius <= 10;
        Radius := InitRadius;
        Count  := Count + 2;
      until ((StartRadial < 2) or (EndRadial > 720));
    
    end;
    
    //----------------------------------------------------------------------------//
    
    begin
      RadialWalk(0, 0, 80, 40, -1, -1);
      RadialWalk(0, 40, 50, 70, -1, 0);
      RadialWalk(0, 90, 120, 70, -1, 0);
      RadialWalk(0,200, 130, 70, -1, -1);
      RadialWalk(0, 260, 140, 40, -1, -1);
      RadialWalk(0, 420, 300, 70, -1, -1);
      LinearWalk(0, 320, 70, 1, 1);
    end.
    More on this subject:

    • function FindColorRadius(var x, y: Integer; Color, CenterX, CenterY, sAngle, eAngle, minRadius, maxRadius, Tolerance: Integer): Boolean;
      By: masquerader
    • procedure AWalk2(Angle, Radius, Color: Integer);
      By: Starblaster100
    • procedure MapWalk(var x, y: Integer; WalkAng, WalkDist: Integer);
    • procedure AngleWalker(gAngle: Extended; gDistance: Integer);
      By: based on Sythes AWalk/Liquid
    • procedure RoadWalk(RColor: Integer; Dir: String);
      By: Stupid3ooo
    SRL is a Library of routines made by the SRL community written for the Program Simba.
    We produce Scripts for the game Runescape.

  2. #2
    Join Date
    Feb 2006
    Posts
    71
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    ThankYou Fakawi I was helped a lot by this tutorial
    <3 SRL

  3. #3
    Join Date
    Feb 2006
    Location
    Myrtle Beach, SC USA!
    Posts
    841
    Mentioned
    2 Post(s)
    Quoted
    1 Post(s)

    Default

    wow execellent tut, simply amazing.

    Code:
    Program l331RepMachine;
    
    var Fawki : Integer;
    
    begin
     while  Fawki <> ( 1 * 1000 * 4000 * 5 ) do 
       Fawki := Fawki * Fawki;
     writeln (' Fawki''s Rep now Equals ' + IntToStr ( Fawki ) );
     writeln ('Your Rep Will Now Have To Go Backwards Because Your Are Maxed Out!');
    end.

  4. #4
    Join Date
    Feb 2006
    Location
    Australia, NSW.
    Posts
    1,461
    Mentioned
    1 Post(s)
    Quoted
    0 Post(s)

    Default

    Excellent. Finally, it know how to use this

  5. #5
    Join Date
    May 2006
    Location
    Bonnie Scotland!
    Posts
    299
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Fakawi, this procedure dosn't have tolerance, well I don't think it dose, so dose this mean im going to have to ask the user of my script to enter all the diffrent colors of where my script is going to click?
    ---

  6. #6
    Join Date
    Mar 2006
    Posts
    509
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    or you could make a color picking procedure to pick your colors and save them for that run?
    Currently Working on: Its a Secret
    WSP!! <3 bebe

  7. #7
    Join Date
    May 2006
    Location
    Bonnie Scotland!
    Posts
    299
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by Mutant Squirrle
    or you could make a color picking procedure to pick your colors and save them for that run?
    Lol, that sounds to advanced for me.
    I don't really understand auto color picking.

    Is there a way in which I can add tolerance to a color in my script and when I use this procedure it uses the color from my tolerance procedure, If you know what I mean, hard to explain.
    ---

  8. #8
    Join Date
    Feb 2006
    Posts
    1,022
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by King Keen
    Lol, that sounds to advanced for me.
    I don't really understand auto color picking.

    Is there a way in which I can add tolerance to a color in my script and when I use this procedure it uses the color from my tolerance procedure, If you know what I mean, hard to explain.
    if(FindColorTolerance(..., 5))then
    if(FindColorSpiralTolerance(..., 5))then

  9. #9
    Join Date
    May 2006
    Location
    Bonnie Scotland!
    Posts
    299
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by The Un-Named
    if(FindColorTolerance(..., 5))then
    if(FindColorSpiralTolerance(..., 5))then
    Lol.

    No, im talking about adding tol to a color and then using radialwalk. I don't want to use colorspiral, but im using auto color pick now so alls good.
    ---

  10. #10
    Join Date
    Feb 2006
    Location
    Australia, NSW.
    Posts
    1,461
    Mentioned
    1 Post(s)
    Quoted
    0 Post(s)

    Default

    King Kleen, i don't know if this is what you meant, but i wrote it anyway ..

    Code:
    function RadialWalkTol(TheColor,Tol:Integer; StartRadial,EndRadial:Integer; Radius:Integer; Xmod,Ymod:integer): Boolean;// By Wizzup? and WT-Fakawi.
    
    var i: Integer;
    var X1,Y1: integer;
    begin
    
    Result:=False;
    
    if StartRadial<EndRadial then
       begin
         repeat
             for i:=StartRadial to EndRadial do
                begin
                   x1:=Round (  Radius * Sine[i]) + 646;
                   y1:=Round (- Radius * Cose[i]) + 84;
                   if FindColorTolerance(X,Y,TheColor,X1,Y1,X1+1,Y1+1,Tol) then
                      begin
                         MouseFindNoFlag(X,Y,Xmod,Ymod);
                         Result:=True;
                         FFlag(10);
                         Exit;
                      end
                end
            Radius:=Radius-4;
          until Radius<=1 ;
        end
    
    
    if StartRadial>EndRadial then
       begin
         repeat
             for i:=StartRadial Downto EndRadial do
                begin
                   x1:=Round (  Radius * Sine[i]) + 646;
                   y1:=Round (- Radius * Cose[i]) + 84;
                   if FindColorTolerance(X,Y,TheColor,X1,Y1,X1+1,Y1+1,Tol) then
                      begin
                         MouseFindNoFlag(X,Y,Xmod,Ymod);
                         Result:=True;
                         FFlag(10);
                         Exit;
                      end
                   end
           Radius:=Radius-4;
         until Radius<=1;
        end
    end;

  11. #11
    Join Date
    May 2006
    Location
    Bonnie Scotland!
    Posts
    299
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Oh right copy the procedure into my script.

    And Kleen.
    Why you little..

    Anyways thanks Kane.
    Your a great help.
    ---

  12. #12
    Join Date
    Feb 2006
    Location
    Australia, NSW.
    Posts
    1,461
    Mentioned
    1 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by King Keen
    Oh right copy the procedure into my script.

    And Kleen.
    Why you little..

    Anyways thanks Kane.
    Your a great help.
    I don't understand if that was what you wanted or not, .. But, your welcome

    Enjoy, King Kleen.

  13. #13
    Join Date
    May 2006
    Location
    Bonnie Scotland!
    Posts
    299
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by XxKanexX
    I don't understand if that was what you wanted or not, .. But, your welcome

    Enjoy, King Kleen.
    Yeah thats what I was wanting.
    Thanks kane, works like a charm.
    ---

  14. #14
    Join Date
    Feb 2006
    Location
    Locked in RAM's closet !
    Posts
    2,001
    Mentioned
    0 Post(s)
    Quoted
    3 Post(s)

    Default

    i get a runtime error everytime i try to run the tol script kane made ... after i setup srl and then try to use radial walk tol i get canvas error. .

  15. #15
    Join Date
    May 2006
    Location
    Bonnie Scotland!
    Posts
    299
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by dark_sniper
    i get a runtime error everytime i try to run the tol script kane made ... after i setup srl and then try to use radial walk tol i get canvas error. .
    Works fine for me.
    ---

  16. #16
    Join Date
    Feb 2006
    Location
    Under a rock.
    Posts
    1,351
    Mentioned
    0 Post(s)
    Quoted
    2 Post(s)

    Default

    Quote Originally Posted by dark_sniper
    i get a runtime error everytime i try to run the tol script kane made ... after i setup srl and then try to use radial walk tol i get canvas error. .
    Make sure you declare:
    SetupSRL;
    in your main loop.
    SRL Developer
    ◘◘◘◘◘◘◘◘◘◘◘◘◘◘◘◘◘◘◘◘

  17. #17
    Join Date
    Feb 2006
    Location
    New Zealand
    Posts
    485
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Read what he said carefully. Cheesy!

  18. #18
    Join Date
    Feb 2006
    Location
    Locked in RAM's closet !
    Posts
    2,001
    Mentioned
    0 Post(s)
    Quoted
    3 Post(s)

    Default

    lol. works fine when SRL isnt setup... owell lemme try everything agian.

  19. #19
    Join Date
    May 2006
    Location
    West Coast
    Posts
    820
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Instead of using this you could use dtm's to walk from place to place. But this is a good guide, I didnt even know how to comprehend it looking at srl manual. Speaking of that, it needs some updating...

  20. #20
    Join Date
    Feb 2006
    Location
    New Zealand
    Posts
    485
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Radial walk is more effective then Dtms, you have to use FindDtmRotated...

  21. #21
    Join Date
    May 2006
    Location
    West Coast
    Posts
    820
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Hey fawk, Does this work after the Rs update?

  22. #22
    Join Date
    Feb 2006
    Location
    Under a rock.
    Posts
    1,351
    Mentioned
    0 Post(s)
    Quoted
    2 Post(s)

    Default

    db, just change it to RadialRoadWalk;

    By the way, I like this tut!

    I already knew everything except for the Xmod, Ymod, thanks for the help!!

    I know this is old, but it deserves to be at the top, as a lot of people do not know how to use this!
    SRL Developer
    ◘◘◘◘◘◘◘◘◘◘◘◘◘◘◘◘◘◘◘◘

  23. #23
    Join Date
    May 2006
    Location
    West Coast
    Posts
    820
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    ok fawki, Here is my problem...if you still read this. Well I was using RRW and it seems it works VERY nice, but once I go and plant the flag, it plants another one right away... and then another one and another one... and so one. Maybe instead of using a color finding procedure after it i will just use RRW after RRW.

  24. #24
    Join Date
    May 2006
    Posts
    1,230
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    maybe a flag option, that waits till the flag is gone, or the flag is near the plpayer like in wt-fawki lumbridge swamp miner.

    dont no what these functions are excactely called tho :S

  25. #25
    Join Date
    Feb 2006
    Location
    Amsterdam
    Posts
    13,691
    Mentioned
    146 Post(s)
    Quoted
    130 Post(s)

    Default

    MouseFindFlag keep clicking until the flag's found.
    FFlag(X) - waits for the flag to come within X pixels.
    CountFlag(X) - waits for the flag to come within X pixels, also picks the new roadcolor.



    The best way to contact me is by email, which you can find on my website: http://wizzup.org
    I also get email notifications of private messages, though.

    Simba (on Twitter | Group on Villavu | Website | Stable/Unstable releases
    Documentation | Source | Simba Bug Tracker on Github and Villavu )


    My (Blog | Website)

Page 1 of 4 123 ... LastLast

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. A brief lesson on fixing annoying errors :P
    By JAD in forum OSR Beginner Scripting Tutorials
    Replies: 257
    Last Post: 03-19-2013, 02:06 PM
  2. College Homework Lesson
    By Moloch in forum OSR Help
    Replies: 2
    Last Post: 11-05-2008, 02:04 PM
  3. A lesson on If-then's, For, While, and Cases!
    By Drakan in forum Outdated Tutorials
    Replies: 10
    Last Post: 08-23-2008, 02:02 AM
  4. Brief FindColorSpiral/FindObj Lesson
    By WhiteShadow in forum Outdated Tutorials
    Replies: 13
    Last Post: 07-01-2007, 02:29 PM
  5. A Quick lesson on Failsafes!
    By ronny.m.p in forum Outdated Tutorials
    Replies: 4
    Last Post: 06-29-2007, 09:06 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
  •