Using Radial Walk
Created by IP-Drowner
I used to be like you about 1 hour ago. Until i read the include file which held Radial Walk i now understand that function and you will too if you read this tutorial. Ok, it is not necessary to read this little intro but you should if you like me. Well, that's the end of the introduction.
Requirements:[list][*]Basic knowledge of procedures/functions.[*]Knowledge of a few SRL functions/procedures.[*]Knowledge of variable types (Integer, String, Boolean, Float, Extended etc).
1 - What is Radial Walking:
Radial walking is another word for Mini Map walking. Using the Mini Map to walk is what Radial Walking basically is. Well, there you have it, now you know what Radial Walking is.
2 - What to set in Radial Walk:
This is the top part of the function:
function RadialWalk(TheColor: Integer; StartRadial, EndRadial: Integer; Radius: Integer; Xmod, Ymod: Integer): Boolean;
TheColor is the colour it will search for in the Runescape Mini Map.
StartRadial is the start point in where to find the colour in the Mini Map.
EndRadial is the end point in where to find the colour in the Mini Map.
Radius is how far from the centre outwards to find the colour.
XMod is just like the function's Mouse rx. Like Mouse(x,y,rx,ry);, which stands for RandomX. It is the randomness of making a straight line when moving the mouse to the found colour.
YMod is just like the function's Mouse ry. Like Mouse(x,y,rx,ry);, which stands for RandomY. It is the randomness of making a straight line when mocing the mouse to the found colour.
3.1 - Setting TheColor:
Ok, TheColor is just what colour to find while scanning the Mini Map. So if you want it to find the road colour you should use SRL's FindRoadColor function inside AutoColor.scar. So, i replace TheColor with FindRoadColor so it will find the road colour then will return an integer value. So, instead of using my own custom picked colour (The colour will change, we can't use Tolerance in Radial Walk) i will use FindRoadColor. So, the start of my Radial Walk looks like this:
3.2 - Setting StartRadial and EndRadial:
I didn't give much of a good explanation of Start Radial and End Radial at the beginning of this tutorial. Ok, Radial is like compass degrees. 90 is the degrees for East. 270 is the degrees for West. 0 is the degrees for North (You can't use 360) and 180 is the degrees for South. Now instead of putting in a string like 'n' or 's', we put in numbers. So, if i replace StartRadial with 90 (East) and EndRadial with 180 (South), it will search for TheColor in between East and South. Take a look at this picture for example:
It will search for TheColor in the shaded red area. Also, if i wanted it to search from South first i would replace 90 with 180 to it starts the search at 180 degrees and put the EndRadial as the original StartRadial (Thanks to Fawaki ). But i just want it to first search from East to south as i am walking SE.This should be easy enough to understand, so lets move on. My RadialWalk function now looks like:
3.3 - Setting Radius:
Radius is basically how far from the centre outwards to find TheColor. The furthest it can search for (yet the height of the Mini Map) is the number 72. So, If if i put 72 as the Radius, it will search the shaded red area of this image (pretending it was the Mini Map):
But if i put a lower value, the shaded red area of the image will decrease in width. Now i want it to search from the centre (the white dot in the middle of the Mini map, which is you by the way) straight to the edge of the Mini Map. So i replace radius with 72 and now he RadialWalk function in SCAR looks like this:
But that isn't enough, move on to the next step to add the final stage.
3.4 - Setting XMod and YMod:
XMod and YMod is used in the function MouseFindNoFlag (Will not discuss here, Thanks to Zeph, it is MouseFindNoFlasg btw). So, this means if it clicks and no flag appears, it will move the mouse to a maximum of that random coordinates (x, y) until a flag does appear. Now that i want my RadialWalk to actually make sure a flag is there no matter what i will put XMod and YMod as 99 so it will move a maximum of 99 coordinates away inside the Mini Map and then click if it does not find the flag. Now m new RadialWalk function looks like this:
4 - Ending Notes/Credits:
Thanks for reading my tutorial on Radial Walking and now i hope you understand it as well as me now.
WT-Fawaki - Thanks for pointing one ting out
ZephyrsFury - Thanks for pointing another think out (<-You don't get the wink )