SRL Archive - OSR Help

What Am I Doing Wrong [SPS]


PatDuffy

2011-11-03 20:21:16

EDIT:Solved by not using SPS and switching to Camero's Color Walking method.


All I really need to do to complete my come-back script, a color dwarven resource miner, is make walking work and add variables and stats to make progress reports smooth.

Unfortunately, SPS is giving me trouble. I know I am most likely omitting something small, but I cannot find it at all. I properly added the extension at the top of the script, and I know I am properly calling this procedure, as it returns "Failed to walk to the mine" then logs out because its lost as its supposed to.

procedure Walk;
var
pts: TPointArray;
begin
SPS_Setup(RUNESCAPE_SURFACE,['9_8']);
pts := [Point(3870, 3215), Point(3912, 3224),
Point(3940, 3267), Point(3903, 3281)];
if (Players[CurrentPlayer].Loc='ready') then
begin
if (SPS_WalkPath(pts)) then
begin
writeln('Walked to mine');
Players[CurrentPlayer].Loc:='at ladder';
end else
begin
writeln('Failed to walk to the mine');
Players[CurrentPlayer].Loc :='lost';
Exit;
end;
end else
if (Players[CurrentPlayer].Loc='invfull guild') then
begin
InvertTPA(pts);
if (SPS_WalkPath(pts)) then
begin
writeln('Walked to the bank');
Players[CurrentPlayer].Loc:='banking';
end else
begin
writeln('Failed to walk to the bank');
Exit;
end;
end;
end;

Coh3n

2011-11-03 21:33:13

SPS doesn't work in the Resource dungeons (it will soon, though). But if you're walking from the bank to the mining guild ladders… Do you get some kind of error? Set SPS_Debug to true at the top of your mainloop and you'll be able to see exactly what it's doing.

PatDuffy

2011-11-03 22:08:33

Alright ill try that then see what it says

PatDuffy

2011-11-04 00:10:31

Did the debug and got this as my problem, seems its stuck constantly getting my position?

[SPS] SPS_Surface: Runescape Surface
[SPS] SPS_Areas: ['9_8']
[SPS] Maps loaded in 31ms.
[SPS] Area coords (9, 8)
[SPS] GetMyPos: Finished in 78 ms. Location = (3675, 3355)
[SPS] Area coords (9, 8)
[SPS] GetMyPos: Finished in 78 ms. Location = (3675, 3355)
[SPS] Area coords (9, 8)
[SPS] GetMyPos: Finished in 94 ms. Location = (3675, 3355)
[SPS] Area coords (9, 8)
[SPS] GetMyPos: Finished in 78 ms. Location = (3675, 3355)
[SPS] Area coords (9, 8)
[SPS] GetMyPos: Finished in 78 ms. Location = (3675, 3355)
[SPS] Area coords (9, 8)
[SPS] GetMyPos: Finished in 78 ms. Location = (3675, 3355)
[SPS] Area coords (9, 8)
[SPS] GetMyPos: Finished in 78 ms. Location = (3675, 3355)
[SPS] Area coords (9, 8)
[SPS] GetMyPos: Finished in 78 ms. Location = (3675, 3355)
[SPS] Area coords (9, 8)
[SPS] GetMyPos: Finished in 94 ms. Location = (3675, 3355)
[SPS] Area coords (9, 8)
[SPS] GetMyPos: Finished in 78 ms. Location = (3675, 3355)
[SPS] Area coords (9, 8)
[SPS] GetMyPos: Finished in 78 ms. Location = (3675, 3355)
[SPS] Area coords (9, 8)
[SPS] GetMyPos: Finished in 78 ms. Location = (3675, 3355)
[SPS] Area coords (9, 8)
[SPS] GetMyPos: Finished in 78 ms. Location = (3675, 3355)
[SPS] Area coords (9, 8)
[SPS] GetMyPos: Finished in 78 ms. Location = (3675, 3355)
[SPS] Area coords (9, 8)
[SPS] GetMyPos: Finished in 94 ms. Location = (3675, 3355)
[SPS] Area coords (9, 8)
[SPS] GetMyPos: Finished in 78 ms. Location = (3675, 3355)
[SPS] Area coords (9, 8)
[SPS] GetMyPos: Finished in 78 ms. Location = (3675, 3355)
[SPS] Area coords (9, 8)
[SPS] GetMyPos: Finished in 78 ms. Location = (3675, 3355)
[SPS] Area coords (9, 8)
[SPS] GetMyPos: Finished in 94 ms. Location = (3675, 3355)
[SPS] Area coords (9, 8)
[SPS] GetMyPos: Finished in 78 ms. Location = (3675, 3355)
[SPS] Area coords (9, 8)
[SPS] GetMyPos: Finished in 78 ms. Location = (3675, 3355)
[SPS] Area coords (9, 8)
[SPS] GetMyPos: Finished in 94 ms. Location = (3675, 3355)
[SPS] Area coords (9, 8)
[SPS] GetMyPos: Finished in 78 ms. Location = (3675, 3355)
[SPS] Area coords (9, 8)
[SPS] GetMyPos: Finished in 94 ms. Location = (3675, 3355)
[SPS] Area coords (9, 8)
[SPS] GetMyPos: Finished in 78 ms. Location = (3675, 3355)
[SPS] Area coords (9, 8)
[SPS] GetMyPos: Finished in 78 ms. Location = (3675, 3355)
[SPS] Area coords (9, 8)
[SPS] GetMyPos: Finished in 78 ms. Location = (3675, 3355)
[SPS] Area coords (9, 8)
[SPS] GetMyPos: Finished in 94 ms. Location = (3675, 3355)
[SPS] Area coords (9, 8)
[SPS] GetMyPos: Finished in 78 ms. Location = (3675, 3355)
[SPS] Area coords (9, 8)
[SPS] GetMyPos: Finished in 93 ms. Location = (3675, 3355)
[SPS] Area coords (9, 8)
[SPS] GetMyPos: Finished in 78 ms. Location = (3675, 3355)
[SPS] Area coords (9, 8)
[SPS] GetMyPos: Finished in 78 ms. Location = (3675, 3355)
[SPS] Area coords (9, 8)
[SPS] GetMyPos: Finished in 94 ms. Location = (3675, 3355)
[SPS] Area coords (9, 8)
[SPS] GetMyPos: Finished in 78 ms. Location = (3675, 3355)
[SPS] Area coords (9, 8)
[SPS] GetMyPos: Finished in 78 ms. Location = (3675, 3355)
[SPS] Area coords (9, 8)
[SPS] GetMyPos: Finished in 78 ms. Location = (3675, 3355)
[SPS] Area coords (9, 8)
[SPS] GetMyPos: Finished in 78 ms. Location = (3675, 3355)
[SPS] Area coords (9, 8)
[SPS] GetMyPos: Finished in 78 ms. Location = (3675, 3355)
[SPS] Area coords (9, 8)
[SPS] GetMyPos: Finished in 78 ms. Location = (3675, 3355)
[SPS] Area coords (9, 8)
[SPS] GetMyPos: Finished in 78 ms. Location = (3675, 3355)
[SPS] Area coords (9, 8)
[SPS] GetMyPos: Finished in 78 ms. Location = (3675, 3355)
[SPS] Area coords (9, 8)
[SPS] GetMyPos: Finished in 94 ms. Location = (3675, 3355)
[SPS] Area coords (9, 8)
[SPS] GetMyPos: Finished in 93 ms. Location = (3675, 3355)
[SPS] Area coords (9, 8)
[SPS] GetMyPos: Finished in 78 ms. Location = (3675, 3355)
[SPS] Area coords (9, 8)
[SPS] GetMyPos: Finished in 94 ms. Location = (3675, 3355)
[SPS] Area coords (9, 8)
[SPS] GetMyPos: Finished in 78 ms. Location = (3675, 3355)
[SPS] Area coords (9, 8)
[SPS] GetMyPos: Finished in 93 ms. Location = (3675, 3355)
[SPS] Area coords (9, 8)
[SPS] GetMyPos: Finished in 78 ms. Location = (3675, 3355)
[SPS] Area coords (9, 8)
[SPS] GetMyPos: Finished in 78 ms. Location = (3675, 3355)
[SPS] Area coords (9, 8)
[SPS] GetMyPos: Finished in 78 ms. Location = (3675, 3355)
[SPS] Area coords (9, 8)
[SPS] GetMyPos: Finished in 78 ms. Location = (3675, 3355)
[SPS] Area coords (9, 8)
[SPS] GetMyPos: Finished in 93 ms. Location = (3675, 3355)
[SPS] Area coords (9, 8)
[SPS] GetMyPos: Finished in 78 ms. Location = (3675, 3355)
[SPS] Area coords (9, 8)
[SPS] GetMyPos: Finished in 78 ms. Location = (3675, 3355)
[SPS] Area coords (9, 8)
[SPS] GetMyPos: Finished in 93 ms. Location = (3675, 3355)
[SPS] Area coords (9, 8)
[SPS] GetMyPos: Finished in 78 ms. Location = (3675, 3355)
[SPS] Area coords (9, 8)
[SPS] GetMyPos: Finished in 78 ms. Location = (3675, 3355)
[SPS] Area coords (9, 8)
[SPS] GetMyPos: Finished in 78 ms. Location = (3675, 3355)
[SPS] Area coords (9, 8)
[SPS] GetMyPos: Finished in 78 ms. Location = (3675, 3355)
[SPS] Area coords (9, 8)
[SPS] GetMyPos: Finished in 94 ms. Location = (3675, 3355)
[SPS] Area coords (9, 8)
[SPS] GetMyPos: Finished in 93 ms. Location = (3675, 3355)
[SPS] Area coords (9, 8)
[SPS] GetMyPos: Finished in 94 ms. Location = (3675, 3355)
[SPS] Area coords (9, 8)
[SPS] GetMyPos: Finished in 78 ms. Location = (3675, 3355)
[SPS] Area coords (9, 8)
[SPS] GetMyPos: Finished in 78 ms. Location = (3675, 3355)
[SPS] Area coords (9, 8)
[SPS] GetMyPos: Finished in 94 ms. Location = (3675, 3355)
[SPS] Area coords (9, 8)
[SPS] GetMyPos: Finished in 94 ms. Location = (3675, 3355)
[SPS] Area coords (9, 8)
[SPS] GetMyPos: Finished in 78 ms. Location = (3675, 3355)
[SPS] Area coords (9, 8)
[SPS] GetMyPos: Finished in 78 ms. Location = (3675, 3355)
[SPS] Area coords (9, 8)
[SPS] GetMyPos: Finished in 94 ms. Location = (3675, 3355)
[SPS] Area coords (9, 8)
[SPS] GetMyPos: Finished in 78 ms. Location = (3675, 3355)
[SPS] Area coords (9, 8)
[SPS] GetMyPos: Finished in 78 ms. Location = (3675, 3355)
[SPS] Area coords (9, 8)
[SPS] GetMyPos: Finished in 94 ms. Location = (3675, 3355)
[SPS] Area coords (9, 8)
[SPS] GetMyPos: Finished in 78 ms. Location = (3675, 3355)
[SPS] Area coords (9, 8)
[SPS] GetMyPos: Finished in 78 ms. Location = (3675, 3355)
[SPS] Area coords (9, 8)
[SPS] GetMyPos: Finished in 78 ms. Location = (3675, 3355)
[SPS] Area coords (9, 8)
[SPS] GetMyPos: Finished in 93 ms. Location = (3675, 3355)
[SPS] Area coords (9, 8)
[SPS] GetMyPos: Finished in 78 ms. Location = (3675, 3355)
[SPS] Area coords (9, 8)
[SPS] GetMyPos: Finished in 78 ms. Location = (3675, 3355)

Sir R. M8gic1an

2011-11-04 08:08:14

your path is way far from the path you want.
Your x & y offsets must be wrong. I suggest you get your starting position (3675, 3355), compare it to your path's starting position (3870, 3215) and workout the x, y offset of (195, -140)

Apply that offset to all your points and you *should* be able toy walk ;)

-RM

PatDuffy

2011-11-04 10:58:33

From: Sir R. M8gic1an
your path is way far from the path you want.
Your x & y offsets must be wrong. I suggest you get your starting position (3675, 3355), compare it to your path's starting position (3870, 3215) and workout the x, y offset of (195, -140)

Apply that offset to all your points and you *should* be able toy walk ;)

-RM


Well you were right, it was my path, but it still will not walk properly(but it does atleast move now). I made a new path using SPS_GetMyPos and used those points as the path, but it ends up missing each point by a fair margin, resulting in it not being able to walk the full path.

As I am typing this I noticed that the values I was getting for SPS_GetMyPos are different now than they were 5 minutes ago by roughly (-100,50). Apparently the WalkPath and GetMyPos are returning different starting values?

Sir R. M8gic1an

2011-11-04 11:12:23

From: PatDuffy
Well you were right, it was my path, but it still will not walk properly(but it does atleast move now). I made a new path using SPS_GetMyPos and used those points as the path, but it ends up missing each point by a fair margin, resulting in it not being able to walk the full path.

As I am typing this I noticed that the values I was getting for SPS_GetMyPos are different now than they were 5 minutes ago by roughly (-100,50). Apparently the WalkPath and GetMyPos are returning different starting values?


Seems like yet another SPS map problem… I'd suggest you check Camaro's walking method if you want a quick temporary fix to this SPS problem..

-RM

PatDuffy

2011-11-04 11:20:46

From: Sir R. M8gic1an
Seems like yet another SPS map problem… I'd suggest you check Camaro's walking method if you want a quick temporary fix to this SPS problem..

-RM


I did a little research on that area of the map and fally east bank, my starting location, is very close to the edges of 9_8 and 9_7. I tried adding 9_7 to SPS_Setup which helped slightly, but every time I try to run my path, I get a different starting location for the same point. I keep attempting to compensate the x,y values for the differences, but its just not working.

I'll just not use SPS for my walking for now, it definitely has something to do with the borders of two areas messing with points.

Coh3n

2011-11-04 12:26:57

I'm not sure what the problem is. I've been using MSI's Crafting Guild Miner a lot and SPS is working just fine at Fally East bank. Have you tried just making the points in the path a lot closer together?