PDA

View Full Version : [Committed] Wind walking



Shuttleu
12-29-2011, 10:01 PM
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
12-29-2011, 10:27 PM
So wind walking generates a path from one point to another?

Shuttleu
12-29-2011, 11:10 PM
never mind, its all working now

~shut

Gushers
12-29-2011, 11:59 PM
Wait, how does Wind Walking work?

Shuttleu
12-30-2011, 12:00 AM
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

tls
12-30-2011, 01:38 AM
Look at MSI's path walking implementation. It's better.

Gushers
01-01-2012, 09:38 PM
Alright this is what I need! Where do you enter the points for it to walk from place to place, using the minimap.

Shuttleu
01-01-2012, 10:45 PM
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
01-01-2012, 10:53 PM
Care to make a tutorial?

Shuttleu
01-01-2012, 10:55 PM
what on?
how to use wind walking?

~shut

Hero
01-02-2012, 12:25 AM
It is pretty straight forward. Look at this post and his other post that he linked. Very very simple.

Grihmm
01-02-2012, 06:13 AM
what on?
how to use wind walking?

~shut

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

Shuttleu
01-02-2012, 10:34 AM
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
01-02-2012, 10:38 AM
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
01-03-2012, 02:43 PM
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
01-03-2012, 03:16 PM
ah sorry, move SPS_WalkToPosEx above SPS_WalkToPos

~shut

Swatarianess
01-03-2012, 04:07 PM
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
01-04-2012, 06:54 AM
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
01-04-2012, 08:47 AM
no, to make it easier, just replace your sps.simba with this one

~shut

Grihmm
01-04-2012, 08:56 AM
Thank you. :D

Grihmm
01-05-2012, 08:03 AM
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
01-05-2012, 08:09 AM
You haven't included SPS.

Grihmm
01-05-2012, 08:12 AM
>.< 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
01-08-2012, 02:54 AM
Just wanted to drop by and say I love your walking method!

imaloser
01-08-2012, 06:06 PM
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
01-08-2012, 06:20 PM
assuming the path is a directly straight line and SPS works properly, then yes

~shut

Hero
01-08-2012, 06:26 PM
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
01-08-2012, 09:19 PM
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
01-08-2012, 09:35 PM
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
01-17-2012, 11:44 AM
might be a stupid question but how do i find out what my points are for where i want to walk to??

Shuttleu
01-17-2012, 02:19 PM
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
01-17-2012, 11:59 PM
Thanks shuttleu.

putonajonny
01-23-2012, 06:31 PM
This might be of interest to some people: http://villavu.com/forum/showthread.php?p=902782

hamster31
01-29-2012, 08:11 AM
isn't this already added to sps

Shuttleu
01-29-2012, 09:43 AM
isn't this already added to sps

it might be now, but it wasnt

~shut

Coh3n
01-30-2012, 04:37 AM
It's in SPS1.5 I believe, not the "official" repository that's updated with SRL.

marpis
02-01-2012, 07:21 PM
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
02-03-2012, 11:44 PM
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
02-04-2012, 12:02 AM
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
02-04-2012, 12:19 AM
Oww ,my wrong ,so I propably edited it myself ,and then it got deleted by SPS update.