SRL Archive - SRL Archives

function RadialWalkFS


Laimonas171

2009-08-31 18:23:21

Everybody Knows functions like


{*******************************************************************************
function RadialWalk(TheColor: Integer; StartRadial, EndRadial: Integer; Radius: Integer; Xmod, Ymod: Integer): Boolean;
by Nielsie95

And
{*******************************************************************************
function FindSymbol(var rx, ry: Integer; Name: String): Boolean;
By: Stupid3ooo

So i dicede to make something useful. I added RadialWalk and FindSymbol into one function. And get this function.

{*******************************************************************************
function RadialWalkFS(Name: String;TheColor: Integer; StartRadial, EndRadial: Integer; Radius: Integer; Xmod, Ymod: Integer): Boolean;
By: Laimonas171
Description: Walks TheColor from StartRadial to EndRadial for Radius Distance from found symbol.
Valid Arguments:
TheColors: Any Typed Color, RoadColor or WaterColor will can be to.
StartRadial/EndRadial: 0=N,90=E,180=S,270=W. (numbers Between 0 and 359 (360=0))
Radius: Distance from Found Symbol on minimap.
XMod, YMod: deviation from MouseFindFlag. -2 to 2.
IMPORTANT:
Make sure you search color not out of minimap, example symbol apears on very right side.
You shouldn't search color on StartRadial=45, EndRadial=135.
*******************************************************************************}
function RadialWalkFS(Name: String;TheColor: Integer; StartRadial, EndRadial: Integer; Radius: Integer; Xmod, Ymod: Integer): Boolean;
var
tpa: TPointArray;
I, rx, ry: Integer;

begin
FindSymbol(rx, ry, Name);
Result := (GetSymbolColor(rx, ry, LowerCase(Name)) > 0);
Begin
Result := False;
if RadialWalkEx(tpa, rx, ry, TheColor, 0, 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;
end;

How it works?

Example:

[INDENT]You standing on road and you need to get near bank doors.
(i need it if i do not see bank symbol.)
Road color can find with FindVarrockRoadColor;

Simple FindSymbol can find just Guide symbol for example. and RadialWalk
Scan[/INDENT]
RadialWalk Scan for
StartRadial 350 EndRadial 10

Scans it look on image.

Procedure FaindRoadNearBankDoors;
var RoadColour, c:integer;

begin
repeat
c := c + 1;
if (not(RadialWalk(RoadColour, 350, 10, 72, 0, 0))) then
begin
RoadColour := FindVarrockRoadColor
c := c - 1;
end;
until(c >= 1);
end;

And get colors in that range

So mouse click depends for Radius value.
it can click to low or high on minimap. +-.. I dont saying what they are bad but you should know where you standing or something.



RadialWalkFS Scan for
StartRadial 260 EndRadial 280


Procedure FaindRoadNearBankDoors;
var RoadColour, c:integer;

begin
repeat
c := c + 1;
if (not(RadialWalkFS('guide', RoadColour, 260, 280, 90, 0, 0))) Then
begin
RoadColour := FindVarrockRoadColor
c := c - 1;
end;
until(c >= 1);
end;
Scans it look on image.

And get colors in that range.


I think, I really proved what it is more accurate in that situation. (and it can be also used in more other i think. )

~Laimonas171

Daniel

2009-09-01 10:33:32


FindSymbol(rx, ry, Name);
Result := (GetSymbolColor(rx, ry, LowerCase(Name)) > 0);
Begin
Result := False;


That just doesn't make any sense..

You set the result to a true or false statement, yet you set it as false as the next..

Therefore, it's only really doing RadialWalk and rx and ry are basically useless as they're called in the var section of RadialWalkEx..

BobboHobbo

2009-09-01 16:06:18

Dans right xD, im a little lost in the code too.

Laimonas171

2009-09-02 02:26:33

this function found Symbol and makes it center of color finding procedure. like i show on images.

Smarter Child

2009-09-02 02:43:19

So basically the symbol is like the midpoint, like the mm middle, then radialwalk can base the Startradial/EndRadial/Radius of the symbol?

Edit: But what if it cannot find the symbol, or someone is standing on it :confused:

Laimonas171

2009-09-02 19:45:44

From: Smarter Child
So basically the symbol is like the midpoint, like the mm middle, then radialwalk can base the Startradial/EndRadial/Radius of the symbol?

Edit: But what if it cannot find the symbol, or someone is standing on it :confused:


someone can stand it find it to. but you must be sure what symbol is in range (you can use fale safe.)
like
 if not findsymbol(x, y, 'bank') then
do something and then use that function.