PDA

View Full Version : How to Use Radial Walking!



Bionicle
09-16-2009, 04:43 AM
Welcome to my fourth tut, how to use radial walking!

What is Radial Walking

Radial walking is one of the three walking procedures. It is the easiest, perfect for beginners. It is also the least accurate, if you do it wrong, but i'll get to that part later. It finds a color on a specified segment on the mini map, and clicks on it.

Multiple Radial Walking --IF YOU HAVE ONLY ONE PLACE YOU WANT TO WALK TO, SKIP THIS--

Add a new procedure. Name it:
procedure RadialWalking(RadialWalkin: Integer);

Now add:
begin
case RadialWalkin of //what this is, is a 'case statement'. With it, you can have more then one procedure in this procedure. They are numbered, and when used later in your script, you would call it 'ProcedureName(#)'

Now I'm going to teach you the RadialWalk function. Here is the layout:
RadialWalk(TheColor: Integer; StartRadial, EndRadial: Integer; Radius: Integer; Xmod, Ymod: Integer): Boolean;

TheColor: this is the color of the place your walking. Put the color of the place your walking to on your mini map here.
StartRadial & EndRadial: this is the start and end of the section of the mini map you want this to search for. It is measured in degrees. So say you want it to search the north/east quarter of the mini map for your color, you would put '0, 90,'. (If you fail at angles, get a protractor ;))
Radius: this is, in pixels, how far away from the center of the mini map you want it to search for your color. 60 is the furthest point.
Xmod & Ymod: if it clicks somewhere, and the flag doesn't show up, how many pixels do you want it to click away from that area?

Here's an example of this procedure I used in one of my scripts:
procedure RadialWalking(RadialWalkin: Integer);
begin
case RadialWalkin of
1: RadialWalk(15855597, 0, 100, 60, 5, 5); //the 15855597 would be where your color would go. to pick a color, go to SCAR, and press Ctrl + Alt + P and click on the spot that your color is. It will wright the color in the debug box.
2: RadialWalk(42495, 0, 90, 60, 5, 5); //0, 90 is the section on the mini map it searches for, in this case, the whole north/west corner
3: RadialWalk(8083520, 90, 180, 60, 5, 5); //60 means it will search all the way out to the edge of the mini map from the center
4: RadialWalk(5606229, 35, 140, 60, 5, 5); //the 5, 5, means that if the flag doesn't appear, it will search 5 pixels away from that area
end;
end;

Now to incorporate this into your script. Here is an example, again, from one of my scripts:
procedure WalkToBank;
var
i: Integer;

begin
if not loggedin then exit; //this should be at the beginning of each of your procedures or functions
Setrun(true); //this turns run on
for i := 1 to 5 do //if you don't know what this is, look up my tut on loops ;)
begin
RadialWalking(i); //this means that the first loop through it will use RadialWalking(1), then the second time through, RadialWalking(2), etc. Remember, this is the procedure we made before?
end;
end;

Single Radial Walking--IF YOU HAVE MULTIPLE RADIALS, SKIP THIS--

Now I'm going to teach you the RadialWalk function. Here is the layout:
RadialWalk(TheColor: Integer; StartRadial, EndRadial: Integer; Radius: Integer; Xmod, Ymod: Integer): Boolean;

TheColor: this is the color of the place your walking. Put the color of the place your walking to on your mini map here.
StartRadial & EndRadial: this is the start and end of the section of the mini map you want this to search for. It is measured in degrees. So say you want it to search the north/east quarter of the mini map for your color, you would put '0, 90,'. (If you fail at angles, get a protractor ;))
Radius: this is, in pixels, how far away from the center of the mini map you want it to search for your color. 60 is the furthest point.
Xmod & Ymod: if it clicks somewhere, and the flag doesn't show up, how many pixels do you want it to click away from that area?

Now to add this into your script. Here is an example of one in mine:
RadialWalk(15855597, 0, 90, 60, 5, 5); //the 15855597 would be where your color would go. to pick a color, go to SCAR, and press Ctrl + Alt + P and click on the spot that your color is. It will wright the color in the debug box.
//0, 90 is the section on the mini map it searches for, in this case, the whole north/west corner
//60 means it will search all the way out to the edge of the mini map from the center
//the 5, 5, means that if the flag doesn't appear, it will search 5 pixels away from that area

AutoColor

AutoColor is very useful. What it is, is it finds the color of a specific place/object specified. There are very few of these though, they are:

// * function FindColorRecordEx(var rx, ry: Integer; ColorRecord: TAutoColorInfo; x1, y1, x2, y2: Integer; RGBXYZCheck: Boolean): Integer; | by Sumilion, small edits by EvilChicken!
// * function FindColorRecord(var rx, ry: Integer; Road: TAutoColorInfo): Integer; | by Sumilion
// * function FindWaterColor: Integer; | by: Tarajunky, fixed by BobboHobbo and edited by EvilChicken!
// * function FindRoadColor: Integer; | by Tarajunky, edited by EvilChicken!
// * function FindVarrockRoadColor: Integer; | by Tarajunky, edited by EvilChicken!
// * function FindFallyRoadColor: Integer; | by Tarajunky, edited by EvilChicken!
// * function FindLumbyRoadColor: Integer; | by ZephyrsFury, small edit by EvilChicken!
// * function FindRockColor: Integer; | by Tarajunky
// * function FindStoneColor: Integer; | by Tarajunky
// * function FindDirtRoadColor: Integer; | by ZephyrsFury
// * function FindBridgeColor: Integer; | by Tarajunky
// * function FindLadderColor: Integer; | by Tarajunky
// * function FindSandColor: Integer; | by Tarajunky
// * function AutoColorThis(Bitmap, MaxTol, X1, Y1, X2, Y2:Integer) : integer; | by Sumilion
// * function FindTreeColor: Integer;

So an example of using one of these AutoColors would be the following, this one would find Varrock road and click on it, if you were near it:

RadialWalk(FindVarrockRoadColor, 0, 90, 60, 5, 5);

Now you are officially able to use radial walks! Congratulations! Thanks for reading my tut, any questions, comments or corrections please post below :p and if you like my tut, use the blue check mark at the top corner of this box ;)!

Main
09-19-2009, 07:32 AM
Needs more example for leechers.
Also, tpa isn't necessary.
Looks good nonetheless

Mr. Doctor
09-19-2009, 08:56 AM
You are posting a lot of tuts, but the thing is (not being rude) you don't explain a lot. Im saying that you are not telling why it is not or is needed.

Bionicle
09-19-2009, 09:55 PM
09/19/09 - fixed up alot and deleted alot (TPA's gone ;)) should be easier to understand, and a bit less reading :). Also i added a a bit more explanation to this tut, as Junkj asked for ;)

Rich
09-21-2009, 12:06 AM
Perhaps add about AutoColor.scar? You can put FindVarrockRoadColor as the color in the RadialWalk function. Ex: RadialWalk(FindVarrockRoadColor, 0, 90, 60, 5, 5);

Other than that, good.
Richard.

Bionicle
09-21-2009, 12:37 AM
Perhaps add about AutoColor.scar? You can put FindVarrockRoadColor as the color in the RadialWalk function. Ex: RadialWalk(FindVarrockRoadColor, 0, 90, 60, 5, 5);

Other than that, good.
Richard.

added ;)

Rich
09-21-2009, 01:58 AM
Also, I forgot about the RadialWalking Aid. That's in Scripting Tools in the SRL folder. If you have enough time, perhaps add about RadialRoadWalk, and RadialWalkEx?

Richard.

Smarter Child
09-22-2009, 07:56 AM
You are posting a lot of tuts, but the thing is (not being rude) you don't explain a lot. Im saying that you are not telling why it is not or is needed.

Lol. Whether or not his tutorials are "good" enough, he is being active in the community and is trying to teach to the best of his abilities. That's what really matters ;).

Nice job, check out my RadialWalking tut in beginner section, if you want some reference check mine or check Fawki's tut in the wiki [ His tut rox ]

Well Done~

:)

Bionicle
09-22-2009, 07:57 AM
Lol. Whether or not his tutorials are "good" enough, he is being active in the community and is trying to teach to the best of his abilities. That's what really matters ;).

Nice job, check out my RadialWalking tut in beginner section, if you want some reference check mine or check Fawki's tut in the wiki [ His tut rox ]

Nice job~

well i did rush through this one, as i only had half an hour to complete it due to guitar lessons ;)
i did fix it up and made it more readable with more examples so it be bettr now :D

Rich
09-22-2009, 02:45 PM
well i did rush through this one, as i only had half an hour to complete it due to guitar lessons ;)
i did fix it up and made it more readable with more examples so it be bettr now :D

Meh, I think beginner will still be able to learn from it. It's not over-complicated, too long, and just gets the job done. Naice.

Offtopic: SC, change your sig please...It's waaay too big.

WT-Fakawi
09-23-2009, 08:05 PM
StartRadial & EndRadial: this is the start and end of the section of the mini map you want this to search for. It is measured in degrees. So say you want it to search the north/east quarter of the mini map for your color, you would put '0, 90,'. (If you fail at angles, get a protractor ;))

Vital is to understand the concept of clock- and counterclockwise and it's implications to the direction you are walking. For further referece see this (http://www.villavu.com/forum/showthread.php?t=372)thread

Cartmann
10-01-2009, 04:11 AM
What is the difference between Multi RW and Single RW?

Bionicle
10-01-2009, 05:23 AM
What is the difference between Multi RW and Single RW?

Multi is when you have more then one place you want to walk to, and you will make a case statement inside a procedure to call it later.
single is just when you have one, and you don't need a procedure to call it.

Cartmann
10-02-2009, 01:34 AM
so single RW would be used in a (ex.) figthing script where it uses the yellow dots to locate a mob, and a multi RW would be used in longer walks, evt. down a road or a varrock to fally walker?

Bionicle
10-02-2009, 06:40 AM
so single RW would be used in a (ex.) figthing script where it uses the yellow dots to locate a mob, and a multi RW would be used in longer walks, evt. down a road or a varrock to fally walker?

exactly.

Sabzi
10-02-2009, 11:08 PM
Teach how to use them properly. Always use their result.
I know this is not a failsafe tutorial but you must mention them and how to use them.
Result := RadialWalk ...
or
if not RadialWalk then ...




A simple tutorial but you can learn from it if you don't know the functions already. <- Means it's good.

Cartmann
10-03-2009, 04:18 PM
What purpose doese Result = ??, do?
is that a bolian? so you have an invisible "if" infront of it?

Sabzi
10-03-2009, 05:27 PM
What purpose doese Result = ??, do?
is that a bolian? so you have an invisible "if" infront of it?

Nope, there isn't any invisible "if". But yes all RadialWalking functions returns a boolean. You use "Result :=" when you set a functions result. So I would use that in the case example.

BuckWild
11-27-2011, 07:01 AM
Thank you for this. Helping a ton.

Aegis
11-29-2011, 05:41 AM
Hey, thanks for this tutorial! I'm probably not going to be using it in my current scripting project, but it's nice to know nonetheless.

Again, thanks!

HardRockers
12-31-2011, 01:47 AM
So in theory, this should walk from the iron ore near yanille to the bank, but it doesn't:

program WalkingTester;
{$i SRL\SRL.scar}
{$i sps/sps.simba}



procedure RadialWalking(RadialWalkin: Integer);
begin
case RadialWalkin of
1: RadialWalk(2786392, 180, 210, 60, 5, 5); //the 15855597 would be where your color would go. to pick a color, go to SCAR, and press Ctrl + Alt + P and click on the spot that your color is. It will wright the color in the debug box.
2: RadialWalk(15461625, 180, 210, 60, 5, 5); //0, 90 is the section on the mini map it searches for, in this case, the whole north/west corner
3: RadialWalk(11448246, 180, 270, 60, 5, 5); //60 means it will search all the way out to the edge of the mini map from the center
end;
end;

procedure WalkToBank;
var
i: Integer;

begin
if not loggedin then exit; //this should be at the beginning of each of your procedures or functions
MakeCompass('N');
Setrun(true); //this turns run on
for i := 1 to 3 do //if you don't know what this is, look up my tut on loops ;)
begin
RadialWalking(i); //this means that the first loop through it will use RadialWalking(1), then the second time through, RadialWalking(2), etc. Remember, this is the procedure we made before?
end;
end;

begin
SetupSRL;
WalkToBank;
end.