SRL Archive - SRL Archives

15 Walking procedure/functions Inside.


Wanted

2007-05-12 23:11:39

I spent a lot of time studying everything from the oldest Map Walkers like MapWalker to the Newest more powerful map walkers like RadialRoadWalk to bring every one here these.

I have permission from Starblaster to edit AWalk2.

Please post *any* advice.

The Stuff!

// * function BlindWalk(mmx, mmy, Xmod, ymod: Integer): Boolean; // * by Icefire908
// * function BlindRadialWalk(Radial, Radius, Xmod, Ymod : Integer): Boolean; // * by Icefire908
// * function BlindRadialDirectionWalk(Radial, Radius, Xmod, Ymod : Integer): Boolean; // * by Icefire908
// * procedure BlindWalkColor(mmx, mmy, Xmod, Ymod, Color, Tolerance, MaxClicks : Integer); // * by Icefire908
// * procedure BlindWalkDTM(mmx, mmy, Xmod, Ymod, DTM, MaxClicks : Integer); // * by Icefire908
// * procedure BlindWalkBitMap(mmx, mmy, Xmod, Ymod, Bitmap, Tolerance, MaxClicks : Integer); // * by Icefire908
// * procedure BlindWalkSymbolIn(mmx, mmy, Xmod, Ymod: Integer; Symbol: String; TempSymbolAccuracy: Extended; SX1, SY1, SX2, SY2, MaxClicks: Integer); // * by Icefire908
// * procedure BlindRadailWalkColor(Radial, Radius, Xmod, Ymod, Color, Tolerance, MaxClicks : Integer); // * by Icefire908
// * procedure BlindRadailWalkDTM(Radial, Radius, Xmod, Ymod, DTM, MaxClicks : Integer); // * by Icefire908
// * procedure BlindRadailWalkBitMap(Radial, Radius, Xmod, Ymod, Bitmap, Tolerance, MaxClicks : Integer); // * by Icefire908
// * procedure BlindRadialWalkSymbolIn(Radial, Radius, Xmod, Ymod: Integer; Symbol: String; TempSymbolAccuracy: Extended; SX1, SY1, SX2, SY2, MaxClicks: Integer); // * by Icefire908
// * procedure BlindRadailDirectionWalkColor(Radial, Radius, Xmod, Ymod, Color, Tolerance, MaxClicks : Integer); // * by Icefire908
// * procedure BlindRadailDirectionWalkDTM(Radial, Radius, Xmod, Ymod, DTM, MaxClicks : Integer); // * by Icefire908
// * procedure BlindRadailDirectionWalkBitMap(Radial, Radius, Xmod, Ymod, Bitmap, Tolerance, MaxClicks : Integer); // * by Icefire908
// * procedure BlindRadialDirectionWalkSymbolIn(Radial, Radius, Xmod, Ymod: Integer; Symbol: String; TempSymbolAccuracy: Extended; SX1, SY1, SX2, SY2, MaxClicks: Integer); // * by Icefire908



{*******************************************************************************
function BlindWalk(mmx, mmy, Xmod, Ymod: Integer): Boolean;
By: Icefire908
Description: Clicks on a coordinate on the Mini-Map then waits until flag is
gone. True if found flag.
*******************************************************************************}

function BlindWalk(mmx, mmy, Xmod, Ymod: Integer): Boolean;
var
FailSafe, OldMouseSpeed: Integer;
begin
OldMouseSpeed := MouseSpeed;
MouseSpeed := 1;
MouseFindNoFlag(mmx, mmy, Xmod, Ymod);
if not FlagPresent then
begin
while (not FlagPresent) or (FailSafe < 30) do
begin
Wait(100);
FailSafe := FailSafe + 1;
Result := True;
end;
if not (FailSafe >= 30) then
Result := True;
if (FailSafe >= 30) then WriteLn('ERROR: Could not find flag!');
end;
Flag;
MouseSpeed := OldMouseSpeed;
end;

{*******************************************************************************
function BlindRadialWalk(Radial, Radius, Xmod, Ymod : Integer): Boolean;
By: Icefire908, based from the idea's of Avaphi's AWalk3.
Description: Clicks on the Mini-Map According to an Angle and Radius then waits
until flag is gone. True if found flag.
*******************************************************************************}

function BlindRadialWalk(Radial, Radius, Xmod, Ymod : Integer): Boolean;
var
mmx, mmy : Integer;
begin
if (Radius > 57) or (Radius = 0) then
begin
Radius := 57;
WriteLn('ERROR: Please enter between 1-57 for radius!');
end;
mmx := Round ( Radius * Sin (Radial * Pi / 180)) + MMCX;
mmy := Round (- Radius * Cos (Radial * Pi / 180)) + MMCY;
Result := BlindWalk(mmx, mmy, Xmod, Ymod);
end;

{*******************************************************************************
function BlindRadialDirectionWalk(Radial, Radius, Xmod, Ymod : Integer): Boolean;
By: Icefire908, based from the idea's of Starblaster100's AWalk2.
Description: Same as BlindRadialWalk, but will always walk the same direction
even if compass moves.
*******************************************************************************}

function BlindRadialDirectionWalk(Radial, Radius, Xmod, Ymod : Integer): Boolean;
var
mmx, mmy: Integer;
begin
if (Radius > 57) or (Radius = 0) then
begin
Radius := 57;
WriteLn('Radius := 57, Please enter between 1-57 for radius!');
end;
mmx := Round(Radius * Sin((Pi/180)* FixD(rs_GetCompassAngleDegrees + Radial)) + MMCX);
mmy := Round(-Radius * Cos((Pi/180)* FixD(rs_GetCompassAngleDegrees + Radial)) + MMCY);
Result := BlindWalk(mmx, mmy, Xmod, Ymod);
end;

{*******************************************************************************
procedure BlindWalkColor(mmx, mmy, Xmod, Ymod, Color, Tolerance, MaxClicks : Integer);
By: Icefire908, based from the idea's of Starblaster100's AWalk2.
Description: Same as BlindWalk, but will walk until a MiniMap Color is found.
*******************************************************************************}

procedure BlindWalkColor(mmx, mmy, Xmod, Ymod, Color, Tolerance, MaxClicks : Integer);
var
Clicks: Integer;
begin
Clicks := 0;
repeat
BlindWalk(mmx, mmy, Xmod, Ymod);
Clicks := Clicks +1;
until (FindMMColorTol(x, y, Color, Tolerance)) or (Clicks >= MaxClicks);
if (Clicks >= MaxClicks) then WriteLn('ERROR: Did not find Mini Map Color!');
end;

{*******************************************************************************
procedure BlindWalkDTM(mmx, mmy, Xmod, Ymod, DTM, MaxClicks : Integer);
By: Icefire908, based from the idea's of Starblaster100's AWalk2.
Description: Same as BlindWalk, but will walk until a MiniMap DTM is found.
*******************************************************************************}

procedure BlindWalkDTM(mmx, mmy, Xmod, Ymod, DTM, MaxClicks : Integer);
var
Clicks: Integer;
begin
Clicks := 0;
repeat
BlindWalk(mmx, mmy, Xmod, Ymod);
Clicks := Clicks +1;
until (FindDTM(DTM, x, y, MMX1, MMY1, MMX2, MMY2)) or (Clicks >= MaxClicks);
if (Clicks >= MaxClicks) then WriteLn('ERROR: Did not find Mini Map DTM!');
end;

{*******************************************************************************
procedure BlindWalkBitMap(mmx, mmy, Xmod, Ymod, Bitmap, Tolerance, MaxClicks : Integer);
By: Icefire908, based from the idea's of Starblaster100's AWalk2.
Description: Same as BlindWalk, but will walk until a MiniMap Bitmap is found.
*******************************************************************************}

procedure BlindWalkBitMap(mmx, mmy, Xmod, Ymod, Bitmap, Tolerance, MaxClicks : Integer);
var
Clicks: Integer;
begin
Clicks := 0;
repeat
BlindWalk(mmx, mmy, Xmod, Ymod);
Clicks := Clicks +1;
until (FindBitMapToleranceIn(Bitmap, x, y, MMX1, MMY1, MMX2, MMY2, Tolerance)) or (Clicks >= MaxClicks);
if (Clicks >= MaxClicks) then WriteLn('ERROR: Did not find Mini Map Bitmap!');
end;

{*******************************************************************************
procedure BlindWalkSymbolIn(mmx, mmy, Xmod, Ymod: Integer; Symbol: String; TempSymbolAccuracy: Extended; SX1, SY1, SX2, SY2, MaxClicks: Integer);
By: Icefire908, based from the idea's of Starblaster100's AWalk2.
Description: Same as BlindWalk, but will walk until a MiniMap Symbol is found.
*******************************************************************************}

procedure BlindWalkSymbolIn(mmx, mmy, Xmod, Ymod: Integer; Symbol: String; TempSymbolAccuracy: Extended; SX1, SY1, SX2, SY2, MaxClicks: Integer);
var
Clicks: Integer;
OldSymbolAccuracy: Extended;
begin
Clicks := 0;
OldSymbolAccuracy := SymbolAccuracy;
SymbolAccuracy := TempSymbolAccuracy;
repeat
BlindWalk(mmx, mmy, Xmod, Ymod);
Clicks := Clicks +1;
until (FindSymbolIn(x, y, Symbol, SX1, SY1, SX2, SY2)) or (Clicks >= MaxClicks);
if (Clicks >= MaxClicks) then WriteLn('ERROR: Did not find Mini Map Symbol!');
SymbolAccuracy := OldSymbolAccuracy;
end;

{*******************************************************************************
procedure BlindRadailWalkColor(Radial, Radius, Xmod, Ymod, Color, Tolerance, MaxClicks : Integer);
By: Icefire908, based from the idea's of Starblaster100's AWalk2.
Description: Same as BlindRadialWalk, but will walk until a MiniMap Color is found.
*******************************************************************************}

procedure BlindRadailWalkColor(Radial, Radius, Xmod, Ymod, Color, Tolerance, MaxClicks : Integer);
var
Clicks: Integer;
begin
Clicks := 0;
repeat
BlindRadialWalk(Radial, Radius, Xmod, Ymod);
Clicks := Clicks +1;
until (FindMMColorTol(x, y, Color, Tolerance)) or (Clicks >= MaxClicks);
if (Clicks >= MaxClicks) then WriteLn('ERROR: Did not find Mini Map Color!');
end;

{*******************************************************************************
procedure BlindRadailWalkDTM(Radial, Radius, Xmod, Ymod, DTM, MaxClicks : Integer);
By: Icefire908, based from the idea's of Starblaster100's AWalk2.
Description: Same as BlindRadialWalk, but will walk until a MiniMap DTM is found.
*******************************************************************************}

procedure BlindRadailWalkDTM(Radial, Radius, Xmod, Ymod, DTM, MaxClicks : Integer);
var
Clicks: Integer;
begin
Clicks := 0;
repeat
BlindRadialWalk(Radial, Radius, Xmod, Ymod);
Clicks := Clicks +1;
until (FindDTM(DTM, x, y, MMX1, MMY1, MMX2, MMY2)) or (Clicks >= MaxClicks);
if (Clicks >= MaxClicks) then WriteLn('ERROR: Did not find Mini Map DTM!');
end;

{*******************************************************************************
procedure BlindRadailWalkBitMap(Radial, Radius, Xmod, Ymod, Bitmap, Tolerance, MaxClicks : Integer);
By: Icefire908, based from the idea's of Starblaster100's AWalk2.
Description: Same as BlindRadialWalk, but will walk until a MiniMap Bitmap is found.
*******************************************************************************}

procedure BlindRadailWalkBitMap(Radial, Radius, Xmod, Ymod, Bitmap, Tolerance, MaxClicks : Integer);
var
Clicks: Integer;
begin
Clicks := 0;
repeat
BlindRadialWalk(Radial, Radius, Xmod, Ymod);
Clicks := Clicks +1;
until (FindBitMapToleranceIn(Bitmap, x, y, MMX1, MMY1, MMX2, MMY2, Tolerance)) or (Clicks >= MaxClicks);
if (Clicks >= MaxClicks) then WriteLn('ERROR: Did not find Mini Map Bitmap!');
end;

{*******************************************************************************
procedure BlindRadialWalkSymbolIn(Radial, Radius, Xmod, Ymod: Integer; Symbol: String; TempSymbolAccuracy: Extended; SX1, SY1, SX2, SY2, MaxClicks: Integer);
By: Icefire908, based from the idea's of Starblaster100's AWalk2.
Description: Same as BlindRadialWalk, but will walk until a MiniMap Symbol is found.
*******************************************************************************}

procedure BlindRadialWalkSymbolIn(Radial, Radius, Xmod, Ymod: Integer; Symbol: String; TempSymbolAccuracy: Extended; SX1, SY1, SX2, SY2, MaxClicks: Integer);
var
Clicks: Integer;
OldSymbolAccuracy: Extended;
begin
Clicks := 0;
OldSymbolAccuracy := SymbolAccuracy;
SymbolAccuracy := TempSymbolAccuracy;
repeat
BlindRadialWalk(Radial, Radius, Xmod, Ymod);
Clicks := Clicks +1;
until (FindSymbolIn(x, y, Symbol, SX1, SY1, SX2, SY2)) or (Clicks >= MaxClicks);
if (Clicks >= MaxClicks) then WriteLn('ERROR: Did not find Mini Map Symbol!');
SymbolAccuracy := OldSymbolAccuracy;
end;

{*******************************************************************************
procedure BlindRadailDirectionWalkColor(Radial, Radius, Xmod, Ymod, Color, Tolerance, MaxClicks : Integer);
By: Icefire908, based from the idea's of Starblaster100's AWalk2.
Description: Same as BlindRadialDirectionWalk, but will walk until a MiniMap Color is found.
*******************************************************************************}

procedure BlindRadailDirectionWalkColor(Radial, Radius, Xmod, Ymod, Color, Tolerance, MaxClicks : Integer);
var
Clicks: Integer;
begin
Clicks := 0;
repeat
BlindRadialDirectionWalk(Radial, Radius, Xmod, Ymod);
Clicks := Clicks +1;
until (FindMMColorTol(x, y, Color, Tolerance)) or (Clicks >= MaxClicks);
if (Clicks >= MaxClicks) then WriteLn('ERROR: Did not find Mini Map Color!');
end;

{*******************************************************************************
procedure BlindRadailDirectionWalkDTM(Radial, Radius, Xmod, Ymod, DTM, MaxClicks : Integer);
By: Icefire908, based from the idea's of Starblaster100's AWalk2.
Description: Same as BlindRadialDirectionWalk, but will walk until a MiniMap DTM is found.
*******************************************************************************}

procedure BlindRadailDirectionWalkDTM(Radial, Radius, Xmod, Ymod, DTM, MaxClicks : Integer);
var
Clicks: Integer;
begin
Clicks := 0;
repeat
BlindRadialDirectionWalk(Radial, Radius, Xmod, Ymod);
Clicks := Clicks +1;
until (FindDTM(DTM, x, y, MMX1, MMY1, MMX2, MMY2)) or (Clicks >= MaxClicks);
if (Clicks >= MaxClicks) then WriteLn('ERROR: Did not find Mini Map DTM!');
end;

{*******************************************************************************
procedure BlindRadailDirectionWalkBitMap(Radial, Radius, Xmod, Ymod, Bitmap, Tolerance, MaxClicks : Integer);
By: Icefire908, based from the idea's of Starblaster100's AWalk2.
Description: Same as BlindRadialDirectionWalk, but will walk until a MiniMap Bitmap is found.
*******************************************************************************}

procedure BlindRadailDirectionWalkBitMap(Radial, Radius, Xmod, Ymod, Bitmap, Tolerance, MaxClicks : Integer);
var
Clicks: Integer;
begin
Clicks := 0;
repeat
BlindRadialDirectionWalk(Radial, Radius, Xmod, Ymod);
Clicks := Clicks +1;
until (FindBitMapToleranceIn(Bitmap, x, y, MMX1, MMY1, MMX2, MMY2, Tolerance)) or (Clicks >= MaxClicks);
if (Clicks >= MaxClicks) then WriteLn('ERROR: Did not find Mini Map Bitmap!');
end;

{*******************************************************************************
procedure BlindRadialDirectionWalkSymbolIn(Radial, Radius, Xmod, Ymod: Integer; Symbol: String; TempSymbolAccuracy: Extended; SX1, SY1, SX2, SY2, MaxClicks: Integer);
By: Icefire908, based from the idea's of Starblaster100's AWalk2.
Description: Same as BlindRadialWalk, but will walk until a MiniMap Symbol is found.
*******************************************************************************}

procedure BlindRadialDirectionWalkSymbolIn(Radial, Radius, Xmod, Ymod: Integer; Symbol: String; TempSymbolAccuracy: Extended; SX1, SY1, SX2, SY2, MaxClicks: Integer);
var
Clicks: Integer;
OldSymbolAccuracy: Extended;
begin
Clicks := 0;
OldSymbolAccuracy := SymbolAccuracy;
SymbolAccuracy := TempSymbolAccuracy;
repeat
BlindRadialDirectionWalk(Radial, Radius, Xmod, Ymod);
Clicks := Clicks +1;
until (FindSymbolIn(x, y, Symbol, SX1, SY1, SX2, SY2)) or (Clicks >= MaxClicks);
if (Clicks >= MaxClicks) then WriteLn('ERROR: Did not find Mini Map Symbol!');
SymbolAccuracy := OldSymbolAccuracy;
end;

Most Powerful in Package.
BlindRadialDirectionWalk -> Walks according the to current compass angle.
BlindRadialDirectionWalkSymbolIn -> Could easily walk you long distances across the map with 1 line of code.

BlindRadialDirectionWalkSymbolIn can be used to walk tremendous distances with only 2 lines of code!

this just an example!

procedure WalkFromDraynorToVarrock;
BlindRadialDirectionWalkSymbolIn ({Stuff to Pottery Place Symbol North});
BlindRadialDirectionWalkSymbolIn ({Stuff to Bank Symbol West});
end;

Possible Rune Myseteries Quest Runner?!!!

Thick As Blood

2007-05-13 00:37:28

DAY-UM!!!!!!!!

haha, just kidding, but really, damn, nice work dude. this is obviously going to be usefull in the comming SRL's, or maybe even for your own self :p

goodjob bro :)

Smartzkid

2007-05-13 01:04:47

Nice!

I like the blindradialwalksymbolin one (could you come up with a longer name for it?)

:D

SKy Scripter

2007-05-13 01:25:01


mmx := Round(Radius * Sin((Pi/180)* FixD(rs_GetCompassAngleDegrees + Radial)) + MMCX);
mmy := Round(-Radius * Cos((Pi/180)* FixD(rs_GetCompassAngleDegrees + Radial)) + MMCY);

lol i have seen this somewhere… *cough* My Compass Walk
but a really good job :D

Wanted

2007-05-13 13:33:14

Thanks, could some one please test these as well?:)

I've already tested BlindWalk, BlindRadialWalk, and BlindRadialDirectionWalk. They all should work.

Personal Fav.s

BlindWalk - Can't fail, perfect for short distance walking.
BlindRadialDirectionWalk - Always walks the same direction regardless of compass
BlindWalkSymbolIn - Can't fail walking, walks until a symbol is visble.
BlindRadialDirectionWalkSymbolIn - I found the most use out of this, good for LONG distance.

shaunthasheep

2007-05-13 17:13:43

From: Smartzkid
Nice!

I like the blindradialwalksymbolin one (could you come up with a longer name for it?)

:D


I like that one too.. and about the longer name..

BlindRadialWalkUntilSymbolFoundIn

and if he made it radialroadwalk until symbol.. he can name it

BlindRadialRoadWalkSymbolFoundIn

or if u want to get technical

BlindRadialRoadWalkUsingColorUntilSymbolFoundInWithXModAndYMod

lol =p

Wanted

2007-05-13 18:50:24

From: The_Rs_Monkey
I like that one too.. and about the longer name..

BlindRadialWalkUntilSymbolFoundIn

and if he made it radialroadwalk until symbol.. he can name it

BlindRadialRoadWalkSymbolFoundIn

or if u want to get technical

BlindRadialRoadWalkUsingColorUntilSymbolFoundInWithXModAndYMod

lol =p


It might be funny, but I just made Long distance walking Very possible and you can make it with only 1 line of code in your script. for instance.

BlindRadialDirectionWalkSymbolIn could get you from draynor to Edgville Bank with 1 line effectively.

Thick As Blood

2007-05-13 21:29:45

imagine the future of SRL, like, SRL 10.0, Commands like…

WalkTo('');
WalkToFrom(',');

Valid arguments would be like "Fallador" "Varrock" ect..

so like, something amazingly futuristic and advanced would be..



Procedure Bank;
Begin
If Location=Fallador Then
Begin
WalkToFrom('Varrock,Fallador');
Flag;
end;
end;

That would walk you from Fally, to Varrock, as humanlike as possible.

Wanted

2007-05-13 21:35:12

With BlindRadialDirectionWalkSymbolIn you can walk from draynor to varrock in 2 lines.


procedure WalkFromDraynorToVarrock;
BlindRadialDirectionWalkSymbolIn ({Stuff to Pottery Place Symbol North});
BlindRadialDirectionWalkSymbolIn ({Stuff to Bank Symbol West});
end;


I don't think you people are seeing the full potential of these procedures!

Edit: Look at the first post of this thread.

Bobarkinator

2007-05-13 23:03:05

This is amazing!!!!!! Flawless walking. Any script could be a banking script. This is pretty sweet. I'm testing these tomorrow.

Johura

2007-05-14 02:25:41

Thankyou so much, i cant wait to use BlindWalkSymbolIn :)

me_ntal

2007-05-14 17:02:23

Id love to see an example of these implemented

Abyssal

2007-05-14 17:33:12

Ooo very nice! I like it :)

I think I might be using these!

Wanted

2007-05-14 18:23:55

From: me_ntal
Id love to see an example of these implemented


I'm already putting them in 2 of my scripts, My aircrafter will have nearly flawless walking next release(lands right in-front of temple ruins every time), and my secret script is walking much much better.