the radial walk function doesn't have any tolerance how can i found a way around that??
the radial walk function doesn't have any tolerance how can i found a way around that??
We also have the RadialWalkEx.
pascal Code:function RadialWalkEx(var tpa: TPointArray; cx, cy, TheColor, tol: Integer; StartRadial, EndRadial: Integer; Radius: Integer): Boolean;
wow nice function really nice thx
how do i use it ?
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
*******************************************************************************}
so i have to make a tpa containing colors then use radialex?
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
i already tried auto coloring didn't work for me
What exactly are you trying to autocolor?
Ce ne sont que des gueux
im in alkharid doing smithing so i'm trying to auto color the pink part of bank
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
im trying on the mm
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
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?
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
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
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
ty for ur time guys but again i failed an in ned of ur help i tried this:
it didnt click the bank it clicked the kebab store,what is hapening???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.
FindColorsTolerance returns a boolean, so you don't need to check the length every time you call the function.Either way, it would probably be better to find a median color of all of those, and make use of the SetColorspeed2Modifiers 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;
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.
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
If you're looking for a good TPA tutorial, The Almighty TPA Tutorial is the way to go IMO.
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.
There are currently 1 users browsing this thread. (0 members and 1 guests)