Log in

View Full Version : Learning SPS Walking



HardRockers
12-29-2011, 03:40 AM
Edit: sorry Wrong place. I just wasn't paying attention.


Hey I am trying to learn how to use SPS to walk from a site to the bank. I have written a script that will just do the walking and nothing else, and I am still having trouble. Can someone help me out a little?

And basically I have just taken the SPS tutorial thread and used it but with my own information and position.


program WalkingTester;
{$i SRL\SRL.scar}
{$i sps/sps.simba} // has to be included after SRL
{$i SRL\SRL\Misc\Stats.simba}



var
t: integer;
pts: TPointArray;
begin
smart_server := 1;
smart_members := false;
smart_signed := true;
smart_superDetail := false;

clearDebug();
setupSRL();

SPS_Debug := true;


SPS_Setup(RUNESCAPE_SURFACE, ['5_10']);
pts := [Point(2336, 4074), Point(2314, 4123), Point(2295, 4181), Point(2264, 4230), Point(2262, 4262)];
{
repeat
inc(t);

if (SPS_WalkPath(pts)) then
writeLn(format('Walked %d times', [t]));

invertTPA(pts);
until(t = 50);
}
SPS_GetMyPos();
end.




begin
SPS_WalkPath
SPS_Continue := true;
end.

Hero
12-29-2011, 05:32 AM
Edit: sorry Wrong place. I just wasn't paying attention.


Hey I am trying to learn how to use SPS to walk from a site to the bank. I have written a script that will just do the walking and nothing else, and I am still having trouble. Can someone help me out a little?

And basically I have just taken the SPS tutorial thread and used it but with my own information and position.

program WalkingTester;
{$i SRL\SRL.scar}
{$i sps/sps.simba} // has to be included after SRL
{$i SRL\SRL\Misc\Stats.simba}



var
t: integer;
pts: TPointArray;
begin
smart_server := 1;//This line down to.....,
smart_members := false;
smart_signed := true;
smart_superDetail := false;

clearDebug();
setupSRL();//This line should be in the "Main Loop"

SPS_Debug := true;

//Everything else should be in its own procedure.
SPS_Setup(RUNESCAPE_SURFACE, ['5_10']);
pts := [Point(2336, 4074), Point(2314, 4123), Point(2295, 4181), Point(2264, 4230), Point(2262, 4262)];
{
repeat
inc(t);

if (SPS_WalkPath(pts)) then
writeLn(format('Walked %d times', [t]));

invertTPA(pts);
until(t = 50);
}
SPS_GetMyPos();
end.//end with a period means the end of the entire script. So what is below this is not being used. Do what I said prior and close it with ; You will see in Simba as you code it will show you basic things like which begins and ends belong to which and when things are still left open or shut properly.



//This is your MainLoop and it is not being used because your code ended a few lines up.
begin
SPS_WalkPath
SPS_Continue := true;
end.

Also just so you know there are Simba tags that you can use to show your code instead of php tags.

Also take a look into this procedure that I use when I call upon SPS walking.

procedure WalkToBank;
begin
if not LoggedIn then Exit;
SPS_Setup(RUNESCAPE_SURFACE, ['5_10']);
SPS_Continue := True;

BankWalk := [Point(2317, 4063), Point(2315, 4116), Point(2311, 4161),
Point(2283, 4205), Point(2271, 4224), Point(2266, 4263)];

SPS_WalkPath(BankWalk);
FindNormalRandoms;
FFlag(9);
Wait(4000+random(500));
end;

Not how much easier all of that is to read and it will be easier for your script to find what it has to do. I think the SPS guide you read might be out dated. Here is what it could look like in a script.


program WalkAround;
{$i srl/srl.scar}
{$i sps/sps.simba}


procedure WalkToBank;
begin
if not LoggedIn then Exit;
SPS_Setup(RUNESCAPE_SURFACE, ['5_10']);
SPS_Continue := True;

BankWalk := [Point(2317, 4063), Point(2315, 4116), Point(2311, 4161),
Point(2283, 4205), Point(2271, 4224), Point(2266, 4263)];

SPS_WalkPath(BankWalk);
FindNormalRandoms;
FFlag(9);
Wait(4000+random(500));
end;


begin
SetupSRL;
ActivateClient;
WalkToBank;
end.//notice the period is at the last line

HardRockers
12-29-2011, 02:54 PM
Yes, thank you derp. I got it running now, now the points are just off. Hopefully it is just the snow like you said, but where I am walking there is no snow or christmassy thing happening so i really don't know. :( hopefully i can find a tutorial on walking another way.

Here was my final code that DID work except for the points.



program WalkingTester;
{$i SRL\SRL.scar}
{$i sps/sps.simba}



Procedure WalkToBank;
var
ToBanker:TPointArray;

Begin
SPS_Setup(RUNESCAPE_SURFACE, ['5_10']);
ToBanker := [Point(2363, 4106), Point(2337, 4153), Point(2303, 4202), Point(2272, 4234), Point(2260, 4263), Point(2260, 4278)];
Wait(3000);
SPS_WalkPath(ToBanker);
End;

begin
SetupSRL;
WalkToBank;
end.

Valkyrie
12-29-2011, 09:07 PM
thanks for the basics.