SRL Archive - SRL Positioning System

Wind walking


Shuttleu

2011-12-29 17:01:59

Hi, one of the things i used a lot in my scripts is WindWalk from reflection, now as sps is sort of like reflection (in terms of map walking) but it doesnt have a wind walk, so i took the function from reflection, multiplied all the peramiters by 5, however the length of the array is rather long, (it should be about 5, but is returning about 20, sometimes even 45)

i renamed the function and this is what i have
program new;
{$i srl/srl.scar}
var
path: TPointArray;

function sps_WindPath(xs, ys, xe, ye, gravity, wind, minWait, maxWait, maxStep, targetArea: extended): TPointArray;
var
veloX, veloY, windX, windY, veloMag, dist, randomDist, lastDist, step: extended;
lastX, lastY: integer;
sqrt2, sqrt3, sqrt5: extended;
begin
sqrt2:= sqrt(2);
sqrt3:= sqrt(3);
sqrt5:= sqrt(5);
while hypot(xs - xe, ys - ye) > 1 do
begin
dist:= hypot(xs - xe, ys - ye);
wind:= minE(wind, dist);
if dist >= targetArea then
begin
windX:= windX / sqrt3 + (random(round(wind) * 2 + 5) - wind) / sqrt5;
windY:= windY / sqrt3 + (random(round(wind) * 2 + 5) - wind) / sqrt5;
end else
begin
windX:= windX / sqrt2;
windY:= windY / sqrt2;
if (maxStep < 15) then
begin
maxStep:= random(15) + 15;
end else
begin
maxStep:= maxStep / sqrt5;
end;
end;
veloX:= veloX + windX;
veloY:= veloY + windY;
veloX:= veloX + gravity * (xe - xs) / dist;
veloY:= veloY + gravity * (ye - ys) / dist;
if hypot(veloX, veloY) > maxStep then
begin
randomDist:= maxStep / 2.0 + random(round(maxStep) / 2);
veloMag:= sqrt(veloX * veloX + veloY * veloY);
veloX:= (veloX / veloMag) * randomDist;
veloY:= (veloY / veloMag) * randomDist;
end;
lastX:= Round(xs);
lastY:= Round(ys);
xs:= xs + veloX;
ys:= ys + veloY;
SetArrayLength(Result, GetArrayLength(Result) + 1);
Result[ High(Result) ] := Point(Round(xs), Round(ys));
step:= hypot(xs - lastX, ys - lastY);
lastdist:= dist;
end;
end;

begin
path:= sps_WindPath(490, 5075, 660, 5030, 25, 12.5, 0.0, 0.0, 22.5, 12.5);
writeln(length(path));
writeln(path);
end.

~shut

Claymore

2011-12-29 17:27:32

So wind walking generates a path from one point to another?

Shuttleu

2011-12-29 18:10:25

never mind, its all working now

~shut

Gushers

2011-12-29 18:59:30

Wait, how does Wind Walking work?

Shuttleu

2011-12-29 19:00:47

it creates a path from one position to another, however it doesnt take into account any walls or obsticals, so it is only useful for places that you go straight from one point to another without any walls

~shut

mormonman

2011-12-29 20:38:24

Look at MSI's path walking implementation. It's better.

Gushers

2012-01-01 16:38:38

Alright this is what I need! Where do you enter the points for it to walk from place to place, using the minimap.

Shuttleu

2012-01-01 17:45:06

go to this page http://villavu.com/forum/showthread.php?t=70505
and copy and paste everything from the first and second box into the end of sps.simba
then replace SPS_WalkToPos with the function in the third box

~shut

Grihmm

2012-01-01 17:53:46

Care to make a tutorial?

Shuttleu

2012-01-01 17:55:25

what on?
how to use wind walking?

~shut

Hero

2012-01-01 19:25:42

It is pretty straight forward. Look at this post and his other post that he linked. Very very simple.

Grihmm

2012-01-02 01:13:59

From: Shuttleu
what on?
how to use wind walking?

~shut


Yes. Simple it may be, but I'd still feel more comfortable with a guide.

Shuttleu

2012-01-02 05:34:33

well, i dont think it is really worthy of a guide

it is simply one function

just call this
SPS_WindWalk(Point(1234, 1234)); //replace those co-ordinates with the position you want to walk to

~shut

Grihmm

2012-01-02 05:38:33

Ah I see. I think I just found a better way to walk then RadialWalk. :3 Now if I can just get it to actually start the procedure. -.-

Grihmm

2012-01-03 09:43:51

I followed your directions earlier about pasting the two first boxes, etc. But when I try to use SPS_WindWalk it gives me this:

procedure WalkToFlax;

var
x, y:Integer;


begin
SPS_WindWalk(Point(255, 329));
SPS_WindWalk(Point(267, 327));
SPS_WindWalk(Point(267, 327));
Wait(3000);
end;

Debug says:
[Error] (64:3): Unknown identifier 'SPS_WindWalk' at line 63
Compiling failed.
[Error] (58:12): Unknown identifier 'SPS_WalkToPosEx' at line 57
Compiling failed.

Shuttleu

2012-01-03 10:16:16

ah sorry, move SPS_WalkToPosEx above SPS_WalkToPos

~shut

Swatarianess

2012-01-03 11:07:56

Nice so this would be more accurate then the normal SPS_Walkto();? or just faster to use? :D i'll switch my SPS_Walkto(); to the WindWalk and see the difference ^^

Grihmm

2012-01-04 01:54:33

So post all of this at the end of sps.simba?
function sps_WindWalk(T: TPoint): Boolean;
var
I, Tries: Integer;
M, P: TPoint;
CTRLPoints: TPointArray;
begin
P := T;
repeat
M := SPS_GetMyPos;
if Length(CtrlPoints)=0 then
CtrlPoints := sps_WindPath(M.x, M.y, P.X, P.Y, 22.5, 12.5, 40, 20);
Inc(Tries);
if(Tries > 20)then
Exit;
for I:= High(CtrlPoints) downto 0 do
if sps_WalkToPosEx(CtrlPoints[i], 20) then
begin
Result := I = High(CtrlPoints);
Break;
end;
until(Result);
end;

function SPS_WalkToPosEx(P: TPoint; FlagDist: Integer): boolean;
var
MM: TPoint;
begin
if not LoggedIn then Exit;
MM := SPS_PosToMM(P);

if (MM.X > 0) then
begin
Mouse(MM.X, MM.Y, 0, 0, True);
Wait(200+Random(300));
FFlag(FlagDist);
Result := True;
end;
end;

function SPS_WalkToPos(P: TPoint): boolean;
begin
result:= SPS_WalkToPosEx(p, 0);
end;

Shuttleu

2012-01-04 03:47:27

no, to make it easier, just replace your sps.simba with this one

~shut

Grihmm

2012-01-04 03:56:40

Thank you. :D

Grihmm

2012-01-05 03:03:48

After replacing my sps with yours I added in some SPS_WindWalk's into my script, but when I hit compile it comes up with this:
[Error] (63:3): Unknown identifier 'SPS_WindWalk' at line 62
Compiling failed.
This is my script.
program LletyaFlaxPicker;



var
UseAntiban:Boolean;


{$DEFINE SMART}
{$i SRL\SRL.scar}
{$i SRL\SRL\Misc\Debug.scar}
{$i SRL\SRL\Misc\Stats.simba}

//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
procedure DeclarePlayers;
begin
HowManyPlayers := 1;
NumberOfPlayers(HowManyPlayers);
CurrentPlayer := 0;

Players[0].Name := ''; // Username
Players[0].Pass := ''; // Password
Players[0].Nick := '';
Players[0].Active := True;
Players[0].Pin := ''; // Leave blank if the player doesn't have a bank pin
Players[0].BoxRewards := ['Xp', 'mote', 'ostume', 'oins', 'aphire', 'ssence'];

UseAntiban := True;
end;

procedure AntiRandoms;
begin
FindNormalRandoms;
LampSkill := 'Prayer'; // If you set the script to choose an experience lamp from a random event box, it will use the exp on the Prayer skill
LevelUp;
end;

procedure Antiban;
begin
if UseAntiban then
case random(40) of
0: RandomRClick;
1: PickUpMouse;
2: RandomRClick;
3: RandomMovement;
4: ExamineInv;
end;
end;

procedure PositionCamera;
begin
SetAngle(True);
MakeCompass('N');
end;

procedure WalkToFlax;




begin
SPS_WindWalk(Point(255, 329));
SPS_WindWalk(Point(267, 327));
SPS_WindWalk(Point(267, 327));
Wait(3000);
end;

procedure PickFlax;

var
x, y:Integer;


begin
InvCount;
if InvCount < 28 then
repeat
begin
FindObjCustom(x, y, ['pick', 'flax'], [15591530, 1326867, 1525270], 3);
Mouse(x, y, 3, 3, true);
end;
until (InvCount = 28);
end;

procedure WalkToBank;

var x, y:Integer;


begin
SPS_WindWalk(Point(258, 177));
SPS_WindWalk(Point(190, 25));
SPS_WindWalk(Point(255, 48));
end;

procedure BankFlax;

var x, y:Integer;

begin
if (FindObjCustom(x, y, ['banker', 'alk'], [11256262, 3912382, 7117761], 3)) then
begin
Mouse(x, y, 3, 3, false);
ChooseOption('Bank');
DepositAll;
CloseBank;
end;
end;










//The real deal is below.

begin
Smart_Server := 60;
Smart_Members := True;
Smart_Signed := True;
Smart_SuperDetail := False;

ClearDebug;
SetupSRL;
DeclarePlayers;
Wait(3000+random(5000));
LoginPlayer;
PositionCamera;
repeat
begin
WalkToFlax;
PickFlax;
WalkToBank;
BankFlax;
CloseBank;
until(false)
end;
end.

euphemism

2012-01-05 03:09:15

You haven't included SPS.

Grihmm

2012-01-05 03:12:43

>.< I am working with two windows of SIMBA, with small variations to test what would happen. I must have forgot to add that to this one. Thanks.

Edit: Now it gives me this:
[Error] C:\Simba\Includes\SRL/SRL/core/simba.simba(5:3): Duplicate identifier 'TDTMPointDef' at line 4
Compiling failed.

Gushers

2012-01-07 21:54:19

Just wanted to drop by and say I love your walking method!

imaloser

2012-01-08 13:06:11

Would this method work better as compared to DTM Walking if the situation were.. idk..
Starting at a random ring of kinship teleport & then proceeding the daemonheim bank?

Shuttleu

2012-01-08 13:20:49

assuming the path is a directly straight line and SPS works properly, then yes

~shut

Hero

2012-01-08 13:26:50

Yes you should be able to use this at the dung area. The only places you can't really use this at are places where there are walls or doors in your way like he said. I have used it in many other places which have a clear path and it works great. Very accurate too.

imaloser

2012-01-08 16:19:41

Well in that case fuck dtm walking, I'm picking this up.

Also I thought SPS doesn't work right now? I'm on simba 980..

Shuttleu

2012-01-08 16:35:55

From: imaloser
Well in that case fuck dtm walking, I'm picking this up.

Also I thought SPS doesn't work right now? I'm on simba 980..


it mostly works

also Simba 982 is out, you should update. Just click the update button up the top of Simba

~shut

John

2012-01-17 06:44:50

might be a stupid question but how do i find out what my points are for where i want to walk to??

Shuttleu

2012-01-17 09:19:57

open RS (browser or smart (i prefer browser))
copy this script to simba

{$loadlib sps}
{$i srl/srl.simba}
{$i sps/sps.simba}

begin
SetupSRL;
SPS_Setup(RUNESCAPE_SURFACE, ['4_4']);
end.
open C:/Simba/Includes/SPS/img/runescape_surface
find the image that has the part of the world you want to use
in the script, replace '4_4' with the name of the image you want to use
drag the crossheir to rs (if your using the browser)
play the script

it will output a TPoint, that is where you are standing

~shut

John

2012-01-17 18:59:22

Thanks shuttleu.

putonajonny

2012-01-23 13:31:54

This might be of interest to some people: http://villavu.com/forum/showthread.php?p=902782

hamster31

2012-01-29 03:11:31

isn't this already added to sps

Shuttleu

2012-01-29 04:43:24

From: hamster31
isn't this already added to sps


it might be now, but it wasnt

~shut

Coh3n

2012-01-29 23:37:04

It's in SPS1.5 I believe, not the "official" repository that's updated with SRL.

marpis

2012-02-01 14:21:21

It was supposed to be added in 1.5, but once again I've been too busy with my life.
Damn I miss the days when I had no life, and I could just write code…

bg5

2012-02-03 18:44:39

It was added to SPS for some time ,and now I see it's excluded. People leeching my script has a lot trouble with it.:D So I don't know if I should add windwalking to my script ,or it will be added to SPS.simba again?

Coh3n

2012-02-03 19:02:58

From: beginner5
It was added to SPS for some time ,and now I see it's excluded. People leeching my script has a lot trouble with it.:D So I don't know if I should add windwalking to my script ,or it will be added to SPS.simba again?
It's never been in SPS.simba… At least not the one in the SRL updater.

bg5

2012-02-03 19:19:54

Oww ,my wrong ,so I propably edited it myself ,and then it got deleted by SPS update.