SRL Archive - RS3 Help

SPS no longer working?


meep152

2015-04-14 16:31:33

EDIT: this problem has been resolved by reinstalling SIMBA and restarting my PC. Looking at the actual code for TSPSArea.walkPath(path: TPointArray), I assume the problem had something to do with getSystemTime() not returning the correct value.



Hi, I am currently experiencing a problem with SPS: the character moves to the first listed point, but seems to ignore all the other points listed in the Tpointarray.

For example, given the following procedure
procedure walkballoon();
var
castlewars: TSPSArea;
pathtoball: Tpointarray;
begin
if tabBackpack.isfull then
begin
castlewars.setup('castlewars3', RUNESCAPE_OTHER);
pathtoball := [Point(216, 201), Point(230, 182), Point(250, 179), Point(271, 179), Point(276, 160), Point(273, 142), Point(273, 124), Point(278, 113), Point(283, 107)];
castlewars.walkPath(pathtoball);
minimap.waitPlayerMoving();
end;
end;

the character will only walk to Point(216, 201), then he will stop and move on to the next procedure - even though he has not reached the balloon yet.

The script used to walk all the Tpoints, all the way up to the balloon; but as of 2-3 days ago, it ignores all points other than the first. I am wondering if there was an update to SIMBA, changing how SPS.walkPath works? Because otherwise, I am baffled as to why the script will no longer walk properly, when I did not change anything in the walking procedures.

I already tried updating my SPS map twice, and that did not work either.
Help with this [confusing] issue is greatly appreciated. :)

Renzanity

2015-04-14 16:41:19

From: meep152
<snip>


How about you do the basic way and do:

procedure walkballoon();
var
pathtoball: Tpointarray;
begin
if tabBackpack.isfull then
begin
pathtoball := [Point(216, 201), Point(230, 182), Point(250, 179), Point(271, 179), Point(276, 160), Point(273, 142), Point(273, 124), Point(278, 113), Point(283, 107)];
if SPS.walkPath(pathtoball) then
minimap.waitPlayerMoving();
end;
end;

//other code goes here..

begin
declarePlayers();
setupSRL();

SPS.setup('castlewars3', RUNESCAPE_OTHER);

end.

Not sure as to why yours isn't working, but I'm pretty sure this would.

meep152

2015-04-14 18:49:07

From: renzanity
How about you do the basic way and do:

snip
Not sure as to why yours isn't working, but I'm pretty sure this would.


Hi, thank you for your response.

I had to "locally declare" the SPS map in that procedure because that is the only way I know of to walk multiple SPS maps, and it used to work fine jsut a few days ago. I use your method (the basic way) for the only other walking procedure in my script, listed below. ( I picked a bad example in my original post to hilight my problem… sorry!)

procedure walkentrana();
var
pathtoAltar: TPointArray;
o: TPoint;
begin
if minimap.findSymbol(o, MM_SYMBOL_WATER , minimap.getBounds()) then
begin
pathtoAltar := [Point(209, 194), Point(219, 212), Point(228, 227), Point(246, 233), Point(265, 231), Point(284, 233), Point(307, 234), Point(322, 230), Point(326, 215), Point(347, 213), Point(368, 210), Point(385, 212), Point(401, 212), Point(414, 212), Point(416, 195), Point(406, 177), Point(403, 152), Point(406, 127), Point(406, 106)];
SPS.walkpath(pathtoAltar);
minimap.waitPlayermoving();
end;
end;


And I call the SPS map in the "main loop" of the script:

begin
clearDebug();
smartEnableDrawing := true;
setupSRL();
declarePlayers();

if not isLoggedIn() then
begin
players[currentPlayer].login();
exitTreasure();
minimap.clickCompass();
end;

begin
SPS.setup('entrana3', RUNESCAPE_OTHER); //calling SPS map
repeat
openBank();
withdrawEss();
repairpouchesifneeded();
walkballoon();
clickballoon();
waitwhiletravelling();
walkentrana();
enteraltar();
craftrunes();
teletocw();
until (false);
end;
End.

Unfortunately, even then, the script still only walks to the first point, then moves on to the next procedure.
Thank you for the input though… hopefully we can find a fix to this problem! :D

Turpinator

2015-04-14 19:39:15

Post your map. On inspection of the walking points, it seems as if they are too far away. 3-5 tiles is best.

meep152

2015-04-14 20:10:27

From: Turpinator
Post your map. On inspection of the walking points, it seems as if they are too far away. 3-5 tiles is best.


Here are both maps I used for walking.
[ATTACH=CONFIG]25609[/ATTACH][ATTACH=CONFIG]25608[/ATTACH]

(I know they are a bit sloppy with debug boxes/lines/etc., but they used to work without problem)

meep152

2015-04-16 14:38:24

Just as an update to this problem:
I don't think this problem is due to faulty maps, because when I check the Ln message on the script, I see the following:

—- Path exists (C:\Simba\Includes\SPS\img\runescape_other\castlewars3.png)
—- Setup area "castlewars3" in 4294967343ms
– .init()
– .getPlayerPos(): result = {X = 214, Y = 206}, took 4294967530 ms
—- Waiting while the player is moving…
– .walkPath(): result = False
—- Waiting while the player is moving…

I have no idea why it says that it is taking 4294967530 ms to set up the map, but this appears to be a problem with getSystemTime(). So does anyone have an idea on how to "reset" getSystemTime() to display the proper value? Of course, I may be wrong in assuming that this is the source of my problem… but it's worth a shot!

Renzanity

2015-04-16 17:00:02

From: meep152
<snip>…hopefully we can find a fix to this problem! :D


Hi again,

Hmm, how about you call your SPS.setup like so:
[SPOILER=Preview]

begin
clearDebug();
smartEnableDrawing := true;
setupSRL();
declarePlayers();

SPS.setup('entrana3', RUNESCAPE_OTHER); //call your SPS map here and not on the mainloop
//so that it may load before the script proceeds
if not isLoggedIn() then //with the following procedures (worth a shot)
begin
players[currentPlayer].login();
exitTreasure();
minimap.clickCompass();
end;

begin
repeat
openBank();
withdrawEss();
repairpouchesifneeded();
walkballoon();
clickballoon();
waitwhiletravelling();
walkentrana();
enteraltar();
craftrunes();
teletocw();
until (false);
end;
End.
[/SPOILER]

I hope sometime soon you get to work it out. Goodluck, pal.:)

meep152

2015-04-16 19:48:54

From: renzanity
Hi again,

Hmm, how about you call your SPS.setup like so:
[SPOILER=Preview]

begin
clearDebug();
smartEnableDrawing := true;
setupSRL();
declarePlayers();

SPS.setup('entrana3', RUNESCAPE_OTHER); //call your SPS map here and not on the mainloop
//so that it may load before the script proceeds
if not isLoggedIn() then //with the following procedures (worth a shot)
begin
players[currentPlayer].login();
exitTreasure();
minimap.clickCompass();
end;

begin
repeat
openBank();
withdrawEss();
repairpouchesifneeded();
walkballoon();
clickballoon();
waitwhiletravelling();
walkentrana();
enteraltar();
craftrunes();
teletocw();
until (false);
end;
End.
[/SPOILER]

I hope sometime soon you get to work it out. Goodluck, pal.:)


Hello, thank you for the suggestion and encouragement. :)
We both were barking up the wrong tree, as the problem ended up being a result of getSystemTime() not producing the correct value. Why it happened is beyond me, but I removed/reinstalled SIMBA +restarted my PC, and I am happy to say that upon restarting, getSystemTime() provided the correct value - allowing my character to make use of sps.walkpath once again. :D

Thank you once again, for your diligence and persistence in brainstorming solutions; it is much appreciated. :)

((Updated original post as resolved, and posted fix))